32 #include <bitmaps.hlst>
37 #define EXT_FROM_TOP 1
38 #define EXT_FROM_LEFT 2
39 #define EXT_HORIZONTAL 3
40 #define EXT_VERTICAL 4
46 #define BMP_CAPTTYPE_1 1
47 #define BMP_CAPTTYPE_2 2
48 #define BMP_CAPTTYPE_3 3
68 :
SfxTabPage(pPage, pController,
"cui/ui/calloutpage.ui",
"CalloutPage", &rInAttrs)
81 , m_xMF_SPACING(m_xBuilder->weld_metric_spin_button(
"spacing",
FieldUnit::
MM))
82 , m_xLB_EXTENSION(m_xBuilder->weld_combo_box(
"extension"))
83 , m_xFT_BYFT(m_xBuilder->weld_label(
"byft"))
84 , m_xMF_BY(m_xBuilder->weld_metric_spin_button(
"by",
FieldUnit::
MM))
85 , m_xFT_POSITIONFT(m_xBuilder->weld_label(
"positionft"))
86 , m_xLB_POSITION(m_xBuilder->weld_combo_box(
"position"))
87 , m_xLineTypes(m_xBuilder->weld_combo_box(
"linetypes"))
88 , m_xFT_LENGTHFT(m_xBuilder->weld_label(
"lengthft"))
89 , m_xMF_LENGTH(m_xBuilder->weld_metric_spin_button(
"length",
FieldUnit::
MM))
90 , m_xCB_OPTIMAL(m_xBuilder->weld_check_button(
"optimal"))
91 , m_xCT_CAPTTYPE(new
ValueSet(m_xBuilder->weld_scrolled_window(
"valuesetwin", true)))
92 , m_xCT_CAPTTYPEWin(new
weld::CustomWeld(*m_xBuilder,
"valueset", *m_xCT_CAPTTYPE))
98 for (
int i = 0;
i < 3; ++
i)
100 for (
int i = 3;
i < 6; ++
i)
105 std::vector<OUString> aLineTypes;
106 aLineTypes.reserve(3);
107 for (
int i = 0;
i < 3; ++
i)
167 case SdrCaptionEscDir::Horizontal:
nEscDir=SdrCaptionEscDir::Vertical;
break;
168 case SdrCaptionEscDir::Vertical:
nEscDir=SdrCaptionEscDir::Horizontal;
break;
192 if (
m_xMF_BY->get_value_changed_from_saved())
228 eFUnit = FieldUnit::MM;
275 case SdrCaptionEscDir::Horizontal:
nEscDir=SdrCaptionEscDir::Vertical;
break;
276 case SdrCaptionEscDir::Vertical:
nEscDir=SdrCaptionEscDir::Horizontal;
break;
286 if(
nEscDir == SdrCaptionEscDir::Horizontal )
302 else if(
nEscDir == SdrCaptionEscDir::Vertical )
318 else if(
nEscDir == SdrCaptionEscDir::BestFit )
336 return std::make_unique<SvxCaptionTabPage>(pPage, pController, *
rOutAttrs);
348 nEscDir = SdrCaptionEscDir::BestFit;
356 nEscDir = SdrCaptionEscDir::Horizontal;
364 nEscDir = SdrCaptionEscDir::Vertical;
377 nEscDir = SdrCaptionEscDir::Horizontal;
390 nEscDir = SdrCaptionEscDir::Vertical;
397 if (&rListBox == m_xLB_EXTENSION.get())
399 SetupExtension_Impl(m_xLB_EXTENSION->get_active());
405 if (&rListBox == m_xLB_POSITION.get())
407 nPosition = m_xLB_POSITION->get_active();
413 if (&rButton != m_xCB_OPTIMAL.get())
416 if (m_xCB_OPTIMAL->get_active() || !m_xCB_OPTIMAL->get_sensitive())
418 m_xFT_LENGTHFT->set_sensitive(
false);
419 m_xMF_LENGTH->set_sensitive(
false);
423 m_xFT_LENGTHFT->set_sensitive(
true);
424 m_xMF_LENGTH->set_sensitive(
true);
430 SetupType_Impl( static_cast<SdrCaptionType>(m_xCT_CAPTTYPE->GetSelectedItemId()) );
437 case SdrCaptionType::Type1:
438 case SdrCaptionType::Type2:
443 case SdrCaptionType::Type3:
444 case SdrCaptionType::Type4:
463 , nAnchorCtrls(nAnchorTypes)
468 if (
nAnchorCtrls & (SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page | SvxAnchorIds::Fly))
486 if (rId ==
"RID_SVXPAGE_POSITION_SIZE")
496 else if (rId ==
"RID_SVXPAGE_SWPOSSIZE")
502 else if (rId ==
"RID_SVXPAGE_CAPTION")
#define LINK(Instance, Class, Member)
void SetFieldUnit(weld::MetricSpinButton &rField, FieldUnit eUnit, bool bAll)
std::unique_ptr< weld::MetricSpinButton > m_xMF_SPACING
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
SvxCaptionTabDialog(weld::Window *pParent, const SdrView *pView, SvxAnchorIds nAnchorTypes)
std::unique_ptr< weld::Label > m_xFT_LENGTHFT
const sal_uInt16 CAPTYPE_BITMAPS_COUNT
std::unique_ptr< weld::Label > m_xFT_BYFT
SvxAnchorIds nAnchorCtrls
std::unique_ptr< weld::MetricSpinButton > m_xMF_BY
constexpr TypedWhichId< SdrCaptionLineLenItem > SDRATTR_CAPTIONLINELEN(SDRATTR_CAPTION_FIRST+8)
void SetValidateFramePosLink(const Link< SvxSwFrameValidation &, void > &rLink)
IMPL_LINK(SvxCaptionTabPage, ExtensionSelectHdl_Impl, weld::ComboBox &, rListBox, void)
void RemoveTabPage(const OString &rName)
constexpr TypedWhichId< SdrAngleItem > SDRATTR_CAPTIONANGLE(SDRATTR_CAPTION_FIRST+2)
std::unique_ptr< weld::Label > m_xFT_POSITIONFT
std::unique_ptr< weld::MetricSpinButton > m_xMF_LENGTH
virtual void Reset(const SfxItemSet *) override
Link< SvxSwFrameValidation &, void > aValidateLink
FieldUnit GetModuleFieldUnit(const SfxItemSet &rSet)
std::vector< OUString > m_aStrVertList
virtual bool FillItemSet(SfxItemSet *) override
static const sal_uInt16 * GetRanges()
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
std::unique_ptr< weld::CheckButton > m_xCB_OPTIMAL
std::unique_ptr< ValueSet > m_xCT_CAPTTYPE
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_CAPTIONFIXEDANGLE(SDRATTR_CAPTION_FIRST+1)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void SetupExtension_Impl(sal_uInt16 nType)
constexpr TypedWhichId< SdrCaptionEscDirItem > SDRATTR_CAPTIONESCDIR(SDRATTR_CAPTION_FIRST+4)
void SetValidateFramePosLink(const Link< SvxSwFrameValidation &, void > &rLink)
link for the Writer to validate positions
constexpr TypedWhichId< SdrCaptionEscRelItem > SDRATTR_CAPTIONESCREL(SDRATTR_CAPTION_FIRST+6)
static const sal_uInt16 * GetRanges()
#define DBG_ASSERT(sCon, aError)
constexpr TypedWhichId< SdrCaptionEscAbsItem > SDRATTR_CAPTIONESCABS(SDRATTR_CAPTION_FIRST+7)
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
constexpr TypedWhichId< SdrMetricItem > SDRATTR_CAPTIONGAP(SDRATTR_CAPTION_FIRST+3)
int GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
std::unique_ptr< weld::ComboBox > m_xLB_EXTENSION
void SetupType_Impl(SdrCaptionType nType)
void SetMetricValue(weld::MetricSpinButton &rField, int nCoreValue, MapUnit eUnit)
SfxItemPool * GetPool() const
constexpr TypedWhichId< SdrCaptionTypeItem > SDRATTR_CAPTIONTYPE(SDRATTR_CAPTION_FIRST+0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SvxCaptionTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
SdrCaptionType nCaptionType
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
std::vector< OUString > m_aStrHorzList
static const sal_uInt16 * GetRanges()
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
std::unique_ptr< weld::CustomWeld > m_xCT_CAPTTYPEWin
std::unique_ptr< weld::ComboBox > m_xLineTypes
constexpr TypedWhichId< SdrCaptionFitLineLenItem > SDRATTR_CAPTIONFITLINELEN(SDRATTR_CAPTION_FIRST+9)
constexpr TypedWhichId< SdrCaptionEscIsRelItem > SDRATTR_CAPTIONESCISREL(SDRATTR_CAPTION_FIRST+5)
void EnableAnchorTypes(SvxAnchorIds nAnchorEnable)
static const sal_uInt16 pCaptionRanges[]
std::unique_ptr< weld::ComboBox > m_xLB_POSITION
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Image m_aBmpCapTypes[CAPTYPE_BITMAPS_COUNT]
virtual ~SvxCaptionTabPage() override
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
IMPL_LINK_NOARG(SvxCaptionTabPage, SelectCaptTypeHdl_Impl, ValueSet *, void)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
const SfxItemSet & rOutAttrs