diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-06-19 15:02:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-03 18:25:52 +0200 |
commit | 79daf40ec696e0855d4a2894f048e44188cfbbb6 (patch) | |
tree | 96cb3ec48472c06961c1f4392ea6e1b560980555 /cui | |
parent | b094921089beeecb2333075e174c8b1fa6d1b812 (diff) |
weld SvxAreaTabPage
which itself has 5 sub tab pages
Change-Id: If71e91248b5771af4845ad6dba997ac4c7841b5d
Reviewed-on: https://gerrit.libreoffice.org/56112
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/backgrnd.hxx | 4 | ||||
-rw-r--r-- | cui/source/inc/cuitabarea.hxx | 248 | ||||
-rw-r--r-- | cui/source/tabpages/backgrnd.cxx | 43 | ||||
-rw-r--r-- | cui/source/tabpages/tparea.cxx | 130 | ||||
-rw-r--r-- | cui/source/tabpages/tpbitmap.cxx | 430 | ||||
-rw-r--r-- | cui/source/tabpages/tpcolor.cxx | 6 | ||||
-rw-r--r-- | cui/source/tabpages/tpgradnt.cxx | 482 | ||||
-rw-r--r-- | cui/source/tabpages/tphatch.cxx | 353 | ||||
-rw-r--r-- | cui/source/tabpages/tppattern.cxx | 289 | ||||
-rw-r--r-- | cui/uiconfig/ui/areatabpage.ui | 12 | ||||
-rw-r--r-- | cui/uiconfig/ui/bitmaptabpage.ui | 78 | ||||
-rw-r--r-- | cui/uiconfig/ui/colorpage.ui | 54 | ||||
-rw-r--r-- | cui/uiconfig/ui/gradientpage.ui | 132 | ||||
-rw-r--r-- | cui/uiconfig/ui/hatchpage.ui | 106 | ||||
-rw-r--r-- | cui/uiconfig/ui/patterntabpage.ui | 108 |
15 files changed, 1319 insertions, 1156 deletions
diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx index b08e9b92d249..078e78f05297 100644 --- a/cui/source/inc/backgrnd.hxx +++ b/cui/source/inc/backgrnd.hxx @@ -144,12 +144,12 @@ private: class SvxBkgTabPage : public SvxAreaTabPage { - VclPtr<ListBox> m_pTblLBox; + std::unique_ptr<weld::ComboBoxText> m_xTblLBox; bool bHighlighting : 1; public: using SvxAreaTabPage::DeactivatePage; - SvxBkgTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ); + SvxBkgTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxBkgTabPage() override; virtual void dispose() override; diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 119c466a9971..de7fd90cc3e7 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -37,6 +37,7 @@ #define NO_BUTTON_SELECTED -1 +class ColorListBox; class SdrModel; class SvxBitmapCtl; class SvxColorListBox; @@ -46,37 +47,37 @@ class ButtonBox { private: sal_Int32 mnCurrentButton; - std::vector< VclPtr<PushButton> > maButtonList; - std::map< VclPtr<PushButton>, sal_Int32 > maButtonToPos; + std::vector<weld::ToggleButton*> maButtonList; + std::map<weld::ToggleButton*, sal_Int32 > maButtonToPos; void SelectButtonImpl( sal_Int32 nPos ) { if(mnCurrentButton != NO_BUTTON_SELECTED) { - maButtonList[mnCurrentButton]->SetPressed(false); + maButtonList[mnCurrentButton]->set_active(false); } mnCurrentButton = nPos; - maButtonList[mnCurrentButton]->SetPressed(true); + maButtonList[mnCurrentButton]->set_active(true); }; public: ButtonBox() { mnCurrentButton = NO_BUTTON_SELECTED; }; - void AddButton(VclPtr<PushButton> pButton) + void AddButton(weld::ToggleButton* pButton) { maButtonList.push_back(pButton); maButtonToPos.insert( std::make_pair(pButton, maButtonList.size() - 1) ); } sal_Int32 GetCurrentButtonPos() { return mnCurrentButton; } - sal_Int32 GetButtonPos( VclPtr<PushButton> pButton ) + sal_Int32 GetButtonPos(weld::ToggleButton* pButton) { - std::map< VclPtr<PushButton>, sal_Int32 >::const_iterator aBtnPos = maButtonToPos.find(pButton); + std::map<weld::ToggleButton*, sal_Int32>::const_iterator aBtnPos = maButtonToPos.find(pButton); if(aBtnPos != maButtonToPos.end()) return aBtnPos->second; else return -1; } - void SelectButton( VclPtr<PushButton> pButton) + void SelectButton(weld::ToggleButton* pButton) { sal_Int32 nPos = GetButtonPos(pButton); if(nPos != -1) @@ -224,13 +225,6 @@ class SvxAreaTabPage : public SvxTabPage static const sal_uInt16 pAreaRanges[]; private: ScopedVclPtr<SfxTabPage> m_pFillTabPage; - VclPtr<VclBox> m_pFillTab; - VclPtr<PushButton> m_pBtnNone; - VclPtr<PushButton> m_pBtnColor; - VclPtr<PushButton> m_pBtnGradient; - VclPtr<PushButton> m_pBtnHatch; - VclPtr<PushButton> m_pBtnBitmap; - VclPtr<PushButton> m_pBtnPattern; ButtonBox maBox; XColorListRef m_pColorList; @@ -254,7 +248,17 @@ private: XFillAttrSetItem m_aXFillAttr; SfxItemSet& m_rXFSet; - DECL_LINK(SelectFillTypeHdl_Impl, Button*, void); +protected: + std::unique_ptr<weld::Container> m_xFillTab; + std::unique_ptr<weld::ToggleButton> m_xBtnNone; + std::unique_ptr<weld::ToggleButton> m_xBtnColor; + std::unique_ptr<weld::ToggleButton> m_xBtnGradient; + std::unique_ptr<weld::ToggleButton> m_xBtnHatch; + std::unique_ptr<weld::ToggleButton> m_xBtnBitmap; + std::unique_ptr<weld::ToggleButton> m_xBtnPattern; + +private: + DECL_LINK(SelectFillTypeHdl_Impl, weld::ToggleButton&, void); template< typename TabPage > bool FillItemSet_Impl( SfxItemSet* ); @@ -262,10 +266,11 @@ private: void Reset_Impl( const SfxItemSet* ); template< typename TabPage > DeactivateRC DeactivatePage_Impl( SfxItemSet* pSet ); + public: using TabPage::DeactivatePage; - SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ); + SvxAreaTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxAreaTabPage() override; virtual void dispose() override; @@ -356,25 +361,6 @@ class SvxGradientTabPage : public SfxTabPage using TabPage::DeactivatePage; private: - VclPtr<ListBox> m_pLbGradientType; - VclPtr<FixedText> m_pFtCenter; - VclPtr<MetricField> m_pMtrCenterX; - VclPtr<MetricField> m_pMtrCenterY; - VclPtr<FixedText> m_pFtAngle; - VclPtr<MetricField> m_pMtrAngle; - VclPtr<MetricField> m_pMtrBorder; - VclPtr<Slider> m_pSliderBorder; - VclPtr<SvxColorListBox> m_pLbColorFrom; - VclPtr<MetricField> m_pMtrColorFrom; - VclPtr<SvxColorListBox> m_pLbColorTo; - VclPtr<MetricField> m_pMtrColorTo; - VclPtr<SvxPresetListBox> m_pGradientLB; - VclPtr<NumericField> m_pMtrIncrement; - VclPtr<CheckBox> m_pCbIncrement; - VclPtr<Slider> m_pSliderIncrement; - VclPtr<SvxXRectPreview> m_pCtlPreview; - VclPtr<PushButton> m_pBtnAdd; - VclPtr<PushButton> m_pBtnModify; const SfxItemSet& m_rOutAttrs; XColorListRef m_pColorList; @@ -386,24 +372,47 @@ private: XFillAttrSetItem m_aXFillAttr; SfxItemSet& m_rXFSet; - DECL_LINK( ClickAddHdl_Impl, Button*, void ); - DECL_LINK( ClickModifyHdl_Impl, Button*, void ); - DECL_LINK( ChangeGradientHdl, ValueSet*, void ); + XRectPreview m_aCtlPreview; + std::unique_ptr<weld::ComboBoxText> m_xLbGradientType; + std::unique_ptr<weld::Label> m_xFtCenter; + std::unique_ptr<weld::MetricSpinButton> m_xMtrCenterX; + std::unique_ptr<weld::MetricSpinButton> m_xMtrCenterY; + std::unique_ptr<weld::Label> m_xFtAngle; + std::unique_ptr<weld::MetricSpinButton> m_xMtrAngle; + std::unique_ptr<weld::MetricSpinButton> m_xMtrBorder; + std::unique_ptr<weld::Scale> m_xSliderBorder; + std::unique_ptr<ColorListBox> m_xLbColorFrom; + std::unique_ptr<weld::MetricSpinButton> m_xMtrColorFrom; + std::unique_ptr<ColorListBox> m_xLbColorTo; + std::unique_ptr<weld::MetricSpinButton> m_xMtrColorTo; + std::unique_ptr<PresetListBox> m_xGradientLB; + std::unique_ptr<weld::SpinButton> m_xMtrIncrement; + std::unique_ptr<weld::CheckButton> m_xCbIncrement; + std::unique_ptr<weld::Scale> m_xSliderIncrement; + std::unique_ptr<weld::Button> m_xBtnAdd; + std::unique_ptr<weld::Button> m_xBtnModify; + std::unique_ptr<weld::CustomWeld> m_xCtlPreview; + std::unique_ptr<weld::CustomWeld> m_xGradientLBWin; + + DECL_LINK( ClickAddHdl_Impl, weld::Button&, void ); + DECL_LINK( ClickModifyHdl_Impl, weld::Button&, void ); + DECL_LINK( ChangeGradientHdl, SvtValueSet*, void ); void ChangeGradientHdl_Impl(); - DECL_LINK( ClickRenameHdl_Impl, SvxPresetListBox*, void ); - DECL_LINK( ClickDeleteHdl_Impl, SvxPresetListBox*, void ); - DECL_LINK( ModifiedEditHdl_Impl, Edit&, void ); - DECL_LINK( ModifiedColorListBoxHdl_Impl, SvxColorListBox&, void ); - DECL_LINK( ModifiedListBoxHdl_Impl, ListBox&, void ); - DECL_LINK( ChangeAutoStepHdl_Impl, CheckBox&, void ); - DECL_LINK( ModifiedSliderHdl_Impl, Slider*, void ); + DECL_LINK( ClickRenameHdl_Impl, PresetListBox*, void ); + DECL_LINK( ClickDeleteHdl_Impl, PresetListBox*, void ); + DECL_LINK( ModifiedEditHdl_Impl, weld::SpinButton&, void ); + DECL_LINK( ModifiedMetricHdl_Impl, weld::MetricSpinButton&, void ); + DECL_LINK( ModifiedColorListBoxHdl_Impl, ColorListBox&, void ); + DECL_LINK( ModifiedListBoxHdl_Impl, weld::ComboBoxText&, void ); + DECL_LINK( ChangeAutoStepHdl_Impl, weld::ToggleButton&, void ); + DECL_LINK( ModifiedSliderHdl_Impl, weld::Scale&, void ); void ModifiedHdl_Impl(void const *); void SetControlState_Impl( css::awt::GradientStyle eXGS ); sal_Int32 SearchGradientList(const OUString& rGradientName); public: - SvxGradientTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ); + SvxGradientTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxGradientTabPage() override; virtual void dispose() override; @@ -431,18 +440,6 @@ class SvxHatchTabPage : public SvxTabPage using TabPage::DeactivatePage; private: - VclPtr<MetricField> m_pMtrDistance; - VclPtr<MetricField> m_pMtrAngle; - VclPtr<Slider> m_pSliderAngle; - VclPtr<ListBox> m_pLbLineType; - VclPtr<SvxColorListBox> m_pLbLineColor; - VclPtr<CheckBox> m_pCbBackgroundColor; - VclPtr<SvxColorListBox> m_pLbBackgroundColor; - VclPtr<SvxPresetListBox> m_pHatchLB; - VclPtr<SvxXRectPreview> m_pCtlPreview; - VclPtr<PushButton> m_pBtnAdd; - VclPtr<PushButton> m_pBtnModify; - const SfxItemSet& m_rOutAttrs; XColorListRef m_pColorList; @@ -456,24 +453,38 @@ private: MapUnit m_ePoolUnit; - DECL_LINK( ChangeHatchHdl, ValueSet*, void ); + XRectPreview m_aCtlPreview; + std::unique_ptr<weld::MetricSpinButton> m_xMtrDistance; + std::unique_ptr<weld::MetricSpinButton> m_xMtrAngle; + std::unique_ptr<weld::Scale> m_xSliderAngle; + std::unique_ptr<weld::ComboBoxText> m_xLbLineType; + std::unique_ptr<ColorListBox> m_xLbLineColor; + std::unique_ptr<weld::CheckButton> m_xCbBackgroundColor; + std::unique_ptr<ColorListBox> m_xLbBackgroundColor; + std::unique_ptr<PresetListBox> m_xHatchLB; + std::unique_ptr<weld::Button> m_xBtnAdd; + std::unique_ptr<weld::Button> m_xBtnModify; + std::unique_ptr<weld::CustomWeld> m_xHatchLBWin; + std::unique_ptr<weld::CustomWeld> m_xCtlPreview; + + DECL_LINK(ChangeHatchHdl, SvtValueSet*, void); void ChangeHatchHdl_Impl(); - DECL_LINK( ModifiedEditHdl_Impl, Edit&, void ); - DECL_LINK( ModifiedListBoxHdl_Impl, ListBox&, void ); - DECL_LINK( ModifiedColorListBoxHdl_Impl, SvxColorListBox&, void ); - DECL_LINK( ToggleHatchBackgroundColor_Impl, CheckBox&, void ); - DECL_LINK( ModifiedBackgroundHdl_Impl, SvxColorListBox&, void ); - DECL_LINK( ModifiedSliderHdl_Impl, Slider*, void ); + DECL_LINK( ModifiedEditHdl_Impl, weld::MetricSpinButton&, void ); + DECL_LINK( ModifiedListBoxHdl_Impl, weld::ComboBoxText&, void ); + DECL_LINK( ModifiedColorListBoxHdl_Impl, ColorListBox&, void ); + DECL_LINK( ToggleHatchBackgroundColor_Impl, weld::ToggleButton&, void ); + DECL_LINK( ModifiedBackgroundHdl_Impl, ColorListBox&, void ); + DECL_LINK( ModifiedSliderHdl_Impl, weld::Scale&, void ); void ModifiedHdl_Impl(void const *); - DECL_LINK( ClickAddHdl_Impl, Button*, void ); - DECL_LINK( ClickModifyHdl_Impl, Button*, void ); - DECL_LINK( ClickRenameHdl_Impl, SvxPresetListBox*, void ); - DECL_LINK( ClickDeleteHdl_Impl, SvxPresetListBox*, void ); + DECL_LINK( ClickAddHdl_Impl, weld::Button&, void ); + DECL_LINK( ClickModifyHdl_Impl, weld::Button&, void ); + DECL_LINK( ClickRenameHdl_Impl, PresetListBox*, void ); + DECL_LINK( ClickDeleteHdl_Impl, PresetListBox*, void ); sal_Int32 SearchHatchList(const OUString& rHatchName); public: - SvxHatchTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ); + SvxHatchTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxHatchTabPage() override; virtual void dispose() override; @@ -508,23 +519,6 @@ class SvxBitmapTabPage : public SvxTabPage static const sal_uInt16 pBitmapRanges[]; private: - VclPtr<SvxPresetListBox> m_pBitmapLB; - VclPtr<ListBox> m_pBitmapStyleLB; - VclPtr<VclBox> m_pSizeBox; - VclPtr<CheckBox> m_pTsbScale; - VclPtr<MetricField> m_pBitmapWidth; - VclPtr<MetricField> m_pBitmapHeight; - VclPtr<VclBox> m_pPositionBox; - VclPtr<ListBox> m_pPositionLB; - VclPtr<VclBox> m_pPositionOffBox; - VclPtr<MetricField> m_pPositionOffX; - VclPtr<MetricField> m_pPositionOffY; - VclPtr<VclBox> m_pTileOffBox; - VclPtr<ListBox> m_pTileOffLB; - VclPtr<MetricField> m_pTileOffset; - VclPtr<PushButton> m_pBtnImport; - VclPtr<SvxXRectPreview> m_pCtlBitmapPreview; - const SfxItemSet& m_rOutAttrs; XBitmapListRef m_pBitmapList; @@ -542,22 +536,42 @@ private: Size rBitmapSize; Size rFilledSize; Size rZoomedSize; - DECL_LINK( ModifyBitmapHdl, ValueSet*, void ); - DECL_LINK( ClickScaleHdl, Button*, void ); - DECL_LINK( ModifyBitmapStyleHdl, ListBox&, void ); - DECL_LINK( ModifyBitmapSizeHdl, Edit&, void ); - DECL_LINK( ModifyBitmapPositionHdl, ListBox&, void ); - DECL_LINK( ModifyPositionOffsetHdl, Edit&, void ); - DECL_LINK( ModifyTileOffsetHdl, Edit&, void ); - DECL_LINK( ClickRenameHdl, SvxPresetListBox*, void ); - DECL_LINK( ClickDeleteHdl, SvxPresetListBox*, void ); - DECL_LINK( ClickImportHdl, Button*, void ); + + XRectPreview m_aCtlBitmapPreview; + std::unique_ptr<PresetListBox> m_xBitmapLB; + std::unique_ptr<weld::ComboBoxText> m_xBitmapStyleLB; + std::unique_ptr<weld::Container> m_xSizeBox; + std::unique_ptr<weld::CheckButton> m_xTsbScale; + std::unique_ptr<weld::MetricSpinButton> m_xBitmapWidth; + std::unique_ptr<weld::MetricSpinButton> m_xBitmapHeight; + std::unique_ptr<weld::Container> m_xPositionBox; + std::unique_ptr<weld::ComboBoxText> m_xPositionLB; + std::unique_ptr<weld::Container> m_xPositionOffBox; + std::unique_ptr<weld::MetricSpinButton> m_xPositionOffX; + std::unique_ptr<weld::MetricSpinButton> m_xPositionOffY; + std::unique_ptr<weld::Container> m_xTileOffBox; + std::unique_ptr<weld::ComboBoxText> m_xTileOffLB; + std::unique_ptr<weld::MetricSpinButton> m_xTileOffset; + std::unique_ptr<weld::Button> m_xBtnImport; + std::unique_ptr<weld::CustomWeld> m_xCtlBitmapPreview; + std::unique_ptr<weld::CustomWeld> m_xBitmapLBWin; + + DECL_LINK( ModifyBitmapHdl, SvtValueSet*, void ); + DECL_LINK( ClickScaleHdl, weld::Button&, void ); + DECL_LINK( ModifyBitmapStyleHdl, weld::ComboBoxText&, void ); + DECL_LINK( ModifyBitmapSizeHdl, weld::MetricSpinButton&, void ); + DECL_LINK( ModifyBitmapPositionHdl, weld::ComboBoxText&, void ); + DECL_LINK( ModifyPositionOffsetHdl, weld::MetricSpinButton&, void ); + DECL_LINK( ModifyTileOffsetHdl, weld::MetricSpinButton&, void ); + DECL_LINK( ClickRenameHdl, PresetListBox*, void ); + DECL_LINK( ClickDeleteHdl, PresetListBox*, void ); + DECL_LINK( ClickImportHdl, weld::Button&, void ); void ClickBitmapHdl_Impl(); void CalculateBitmapPresetSize(); sal_Int32 SearchBitmapList(const OUString& rBitmapName); public: - SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ); + SvxBitmapTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxBitmapTabPage() override; virtual void dispose() override; @@ -584,16 +598,6 @@ class SvxPatternTabPage : public SvxTabPage using TabPage::DeactivatePage; private: - VclPtr<SvxPixelCtl> m_pCtlPixel; - VclPtr<SvxColorListBox> m_pLbColor; - VclPtr<SvxColorListBox> m_pLbBackgroundColor; - VclPtr<SvxPresetListBox> m_pPatternLB; - VclPtr<SvxXRectPreview> m_pCtlPreview; - VclPtr<PushButton> m_pBtnAdd; - VclPtr<PushButton> m_pBtnModify; - - std::unique_ptr<SvxBitmapCtl> m_pBitmapCtl; - const SfxItemSet& m_rOutAttrs; XColorListRef m_pColorList; @@ -605,17 +609,29 @@ private: XFillAttrSetItem m_aXFillAttr; SfxItemSet& m_rXFSet; - DECL_LINK( ClickAddHdl_Impl, Button*, void ); - DECL_LINK( ClickModifyHdl_Impl, Button*, void ); - DECL_LINK( ChangePatternHdl_Impl, ValueSet*, void ); - DECL_LINK( ChangeColorHdl_Impl, SvxColorListBox&, void ); - DECL_LINK( ClickRenameHdl_Impl, SvxPresetListBox*, void ); - DECL_LINK( ClickDeleteHdl_Impl, SvxPresetListBox*, void ); + SvxPixelCtl m_aCtlPixel; + XRectPreview m_aCtlPreview; + std::unique_ptr<ColorListBox> m_xLbColor; + std::unique_ptr<ColorListBox> m_xLbBackgroundColor; + std::unique_ptr<PresetListBox> m_xPatternLB; + std::unique_ptr<weld::Button> m_xBtnAdd; + std::unique_ptr<weld::Button> m_xBtnModify; + std::unique_ptr<weld::CustomWeld> m_xCtlPixel; + std::unique_ptr<weld::CustomWeld> m_xCtlPreview; + std::unique_ptr<weld::CustomWeld> m_xPatternLBWin; + std::unique_ptr<SvxBitmapCtl> m_xBitmapCtl; + + DECL_LINK( ClickAddHdl_Impl, weld::Button&, void ); + DECL_LINK( ClickModifyHdl_Impl, weld::Button&, void ); + DECL_LINK( ChangePatternHdl_Impl, SvtValueSet*, void ); + DECL_LINK( ChangeColorHdl_Impl, ColorListBox&, void ); + DECL_LINK( ClickRenameHdl_Impl, PresetListBox*, void ); + DECL_LINK( ClickDeleteHdl_Impl, PresetListBox*, void ); sal_Int32 SearchPatternList(const OUString& rPatternName); public: - SvxPatternTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ); + SvxPatternTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxPatternTabPage() override; virtual void dispose() override; diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 9d9fa98d1f54..c6c325b38fe3 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -1443,16 +1443,14 @@ void SvxBackgroundTabPage::PageCreated(const SfxAllItemSet& aSet) } } -SvxBkgTabPage::SvxBkgTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ) : - SvxAreaTabPage( pParent, rInAttrs ), - m_pTblLBox(nullptr), - bHighlighting(false) +SvxBkgTabPage::SvxBkgTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs) + : SvxAreaTabPage(pParent, rInAttrs) + , bHighlighting(false) { - VclPtr<vcl::Window> pBtn; - get(pBtn, "btngradient"); pBtn->Hide(); - get(pBtn, "btnhatch"); pBtn->Hide(); - get(pBtn, "btnbitmap"); pBtn->Hide(); - get(pBtn, "btnpattern"); pBtn->Hide(); + m_xBtnGradient->hide(); + m_xBtnHatch->hide(); + m_xBtnBitmap->hide(); + m_xBtnPattern->hide(); SfxObjectShell* pDocSh = SfxObjectShell::Current(); const SfxPoolItem* pItem = nullptr; @@ -1483,7 +1481,7 @@ SvxBkgTabPage::~SvxBkgTabPage() void SvxBkgTabPage::dispose() { - m_pTblLBox.clear(); + m_xTblLBox.reset(); SvxAreaTabPage::dispose(); } @@ -1501,9 +1499,9 @@ DeactivateRC SvxBkgTabPage::DeactivatePage( SfxItemSet* _pSet ) bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet ) { sal_uInt16 nSlot = SID_ATTR_BRUSH; - if ( m_pTblLBox && m_pTblLBox->IsVisible() ) + if (m_xTblLBox && m_xTblLBox->get_visible()) { - switch( m_pTblLBox->GetSelectedEntryPos() ) + switch (m_xTblLBox->get_active()) { case TBL_DEST_CELL: nSlot = SID_ATTR_BRUSH; @@ -1549,10 +1547,9 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet ) return true; } -VclPtr<SfxTabPage> SvxBkgTabPage::Create( TabPageParent pWindow, - const SfxItemSet* rAttrs ) +VclPtr<SfxTabPage> SvxBkgTabPage::Create(TabPageParent pWindow, const SfxItemSet* rAttrs) { - return VclPtr<SvxBkgTabPage>::Create( pWindow.pParent, *rAttrs ); + return VclPtr<SvxBkgTabPage>::Create(pWindow, *rAttrs); } void SvxBkgTabPage::PageCreated(const SfxAllItemSet& aSet) @@ -1563,21 +1560,15 @@ void SvxBkgTabPage::PageCreated(const SfxAllItemSet& aSet) SvxBackgroundTabFlags nFlags = static_cast<SvxBackgroundTabFlags>(pFlagItem->GetValue()); if ( nFlags & SvxBackgroundTabFlags::SHOW_TBLCTL ) { - VclPtr<vcl::Window> pBtn; - get(pBtn, "btnbitmap"); - pBtn->Show(); - get(m_pTblLBox, "tablelb"); - m_pTblLBox->SelectEntryPos(0); - m_pTblLBox->Show(); + m_xBtnBitmap->show(); + m_xTblLBox = m_xBuilder->weld_combo_box_text("tablelb"); + m_xTblLBox->set_active(0); + m_xTblLBox->show(); } else if (nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING) bHighlighting = bool(nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING); else if (nFlags & SvxBackgroundTabFlags::SHOW_SELECTOR) - { - VclPtr<vcl::Window> pBtn; - get(pBtn, "btnbitmap"); - pBtn->Show(); - } + m_xBtnBitmap->show(); } SvxAreaTabPage::PageCreated( aSet ); } diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index dbceed157716..655c532a1aab 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -82,72 +82,64 @@ void lclExtendSize(Size& rSize, const Size& rInputSize) |* \************************************************************************/ -SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ) : - - SvxTabPage( pParent, - "AreaTabPage", - "cui/ui/areatabpage.ui", - rInAttrs ), - m_pFillTabPage( nullptr ), - m_pColorList( nullptr ), - m_pGradientList( nullptr ), - m_pHatchingList( nullptr ), - m_pBitmapList( nullptr ), - m_pPatternList( nullptr ), - +SvxAreaTabPage::SvxAreaTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs) + : SvxTabPage(pParent, "cui/ui/areatabpage.ui", "AreaTabPage", rInAttrs) + , m_pFillTabPage(nullptr) + , m_pColorList(nullptr) + , m_pGradientList(nullptr) + , m_pHatchingList(nullptr) + , m_pBitmapList(nullptr) + , m_pPatternList(nullptr) // local fixed not o be changed values for local pointers - maFixed_ChangeType(ChangeType::NONE), - + , maFixed_ChangeType(ChangeType::NONE) // init with pointers to fixed ChangeType - m_pnColorListState(&maFixed_ChangeType), - m_pnBitmapListState(&maFixed_ChangeType), - m_pnPatternListState(&maFixed_ChangeType), - m_pnGradientListState(&maFixed_ChangeType), - m_pnHatchingListState(&maFixed_ChangeType), - m_aXFillAttr ( rInAttrs.GetPool() ), - m_rXFSet ( m_aXFillAttr.GetItemSet() ) + , m_pnColorListState(&maFixed_ChangeType) + , m_pnBitmapListState(&maFixed_ChangeType) + , m_pnPatternListState(&maFixed_ChangeType) + , m_pnGradientListState(&maFixed_ChangeType) + , m_pnHatchingListState(&maFixed_ChangeType) + , m_aXFillAttr(rInAttrs.GetPool()) + , m_rXFSet(m_aXFillAttr.GetItemSet()) + , m_xFillTab(m_xBuilder->weld_container("fillstylebox")) + , m_xBtnNone(m_xBuilder->weld_toggle_button("btnnone")) + , m_xBtnColor(m_xBuilder->weld_toggle_button("btncolor")) + , m_xBtnGradient(m_xBuilder->weld_toggle_button("btngradient")) + , m_xBtnHatch(m_xBuilder->weld_toggle_button("btnhatch")) + , m_xBtnBitmap(m_xBuilder->weld_toggle_button("btnbitmap")) + , m_xBtnPattern(m_xBuilder->weld_toggle_button("btnpattern")) { - - get(m_pBtnNone, "btnnone"); - get(m_pBtnColor, "btncolor"); - get(m_pBtnGradient, "btngradient"); - get(m_pBtnHatch, "btnhatch"); - get(m_pBtnBitmap, "btnbitmap"); - get(m_pBtnPattern, "btnpattern"); - get(m_pFillTab, "fillstylebox"); - maBox.AddButton( m_pBtnNone ); - maBox.AddButton( m_pBtnColor ); - maBox.AddButton( m_pBtnGradient ); - maBox.AddButton( m_pBtnHatch ); - maBox.AddButton( m_pBtnBitmap ); - maBox.AddButton( m_pBtnPattern ); - Link< Button*, void > aLink = LINK(this, SvxAreaTabPage, SelectFillTypeHdl_Impl); - m_pBtnNone->SetClickHdl(aLink); - m_pBtnColor->SetClickHdl(aLink); - m_pBtnGradient->SetClickHdl(aLink); - m_pBtnHatch->SetClickHdl(aLink); - m_pBtnBitmap->SetClickHdl(aLink); - m_pBtnPattern->SetClickHdl(aLink); + maBox.AddButton(m_xBtnNone.get()); + maBox.AddButton(m_xBtnColor.get()); + maBox.AddButton(m_xBtnGradient.get()); + maBox.AddButton(m_xBtnHatch.get()); + maBox.AddButton(m_xBtnBitmap.get()); + maBox.AddButton(m_xBtnPattern.get()); + Link<weld::ToggleButton&, void> aLink = LINK(this, SvxAreaTabPage, SelectFillTypeHdl_Impl); + m_xBtnNone->connect_toggled(aLink); + m_xBtnColor->connect_toggled(aLink); + m_xBtnGradient->connect_toggled(aLink); + m_xBtnHatch->connect_toggled(aLink); + m_xBtnBitmap->connect_toggled(aLink); + m_xBtnPattern->connect_toggled(aLink); SetExchangeSupport(); - TabPageParent aFillTab(m_pFillTab); + TabPageParent aFillTab(m_xFillTab.get()); // Calculate optimal size of all pages.. m_pFillTabPage.disposeAndReset(SvxColorTabPage::Create(aFillTab, &m_rXFSet)); - Size aSize = m_pFillTabPage->GetOptimalSize(); + Size aSize = m_pFillTabPage->get_container_size(); m_pFillTabPage.disposeAndReset(SvxGradientTabPage::Create(aFillTab, &m_rXFSet)); - lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize()); + lclExtendSize(aSize, m_pFillTabPage->get_container_size()); m_pFillTabPage.disposeAndReset(SvxBitmapTabPage::Create(aFillTab, &m_rXFSet)); - lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize()); + lclExtendSize(aSize, m_pFillTabPage->get_container_size()); m_pFillTabPage.disposeAndReset(SvxHatchTabPage::Create(aFillTab, &m_rXFSet)); - lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize()); + lclExtendSize(aSize, m_pFillTabPage->get_container_size()); m_pFillTabPage.disposeAndReset(SvxPatternTabPage::Create(aFillTab, &m_rXFSet)); - lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize()); + lclExtendSize(aSize, m_pFillTabPage->get_container_size()); m_pFillTabPage.disposeAndClear(); - m_pFillTab->set_width_request(aSize.Width()); - m_pFillTab->set_height_request(aSize.Height()); + m_xFillTab->set_size_request(aSize.Width(), aSize.Height()); } SvxAreaTabPage::~SvxAreaTabPage() @@ -157,13 +149,6 @@ SvxAreaTabPage::~SvxAreaTabPage() void SvxAreaTabPage::dispose() { - m_pBtnNone.clear(); - m_pBtnColor.clear(); - m_pBtnGradient.clear(); - m_pBtnHatch.clear(); - m_pBtnBitmap.clear(); - m_pBtnPattern.clear(); - m_pFillTab.clear(); m_pFillTabPage.disposeAndClear(); SvxTabPage::dispose(); } @@ -183,25 +168,25 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) default: case drawing::FillStyle_NONE: { - SelectFillTypeHdl_Impl( m_pBtnNone ); + SelectFillTypeHdl_Impl(*m_xBtnNone); break; } case drawing::FillStyle_SOLID: { m_rXFSet.Put( static_cast<const XFillColorItem&>( rSet.Get( GetWhich( XATTR_FILLCOLOR ) ) ) ); - SelectFillTypeHdl_Impl( m_pBtnColor ); + SelectFillTypeHdl_Impl(*m_xBtnColor); break; } case drawing::FillStyle_GRADIENT: { m_rXFSet.Put( static_cast<const XFillGradientItem&>( rSet.Get( GetWhich( XATTR_FILLGRADIENT ) ) ) ); - SelectFillTypeHdl_Impl( m_pBtnGradient ); + SelectFillTypeHdl_Impl(*m_xBtnGradient); break; } case drawing::FillStyle_HATCH: { m_rXFSet.Put( rSet.Get(XATTR_FILLHATCH) ); - SelectFillTypeHdl_Impl( m_pBtnHatch ); + SelectFillTypeHdl_Impl(*m_xBtnHatch); break; } case drawing::FillStyle_BITMAP: @@ -210,9 +195,9 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) // pass full item set here, bitmap fill has many attributes (tiling, size, offset etc.) m_rXFSet.Put( rSet ); if(!aItem.isPattern()) - SelectFillTypeHdl_Impl( m_pBtnBitmap ); + SelectFillTypeHdl_Impl(*m_xBtnBitmap); else - SelectFillTypeHdl_Impl( m_pBtnPattern ); + SelectFillTypeHdl_Impl(*m_xBtnPattern); break; } } @@ -335,15 +320,14 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs ) } } -VclPtr<SfxTabPage> SvxAreaTabPage::Create( TabPageParent pWindow, - const SfxItemSet* rAttrs ) +VclPtr<SfxTabPage> SvxAreaTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrs) { - return VclPtr<SvxAreaTabPage>::Create( pWindow.pParent, *rAttrs ); + return VclPtr<SvxAreaTabPage>::Create(pParent, *rAttrs); } namespace { -VclPtr<SfxTabPage> lcl_CreateFillStyleTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet ) +VclPtr<SfxTabPage> lcl_CreateFillStyleTabPage(sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet) { CreateTabPage fnCreate = nullptr; switch(nId) @@ -361,14 +345,16 @@ VclPtr<SfxTabPage> lcl_CreateFillStyleTabPage( sal_uInt16 nId, vcl::Window* pPar } -IMPL_LINK(SvxAreaTabPage, SelectFillTypeHdl_Impl, Button*, pButton, void) +IMPL_LINK(SvxAreaTabPage, SelectFillTypeHdl_Impl, weld::ToggleButton&, rButton, void) { - sal_Int32 nPos = maBox.GetButtonPos( static_cast<PushButton*>(pButton) ); + sal_Int32 nPos = maBox.GetButtonPos(&rButton); if(nPos != -1 && nPos != maBox.GetCurrentButtonPos()) { - maBox.SelectButton(static_cast<PushButton*>(pButton)); + maBox.SelectButton(&rButton); FillType eFillType = static_cast<FillType>(maBox.GetCurrentButtonPos()); - m_pFillTabPage.disposeAndReset( lcl_CreateFillStyleTabPage(eFillType, m_pFillTab, m_rXFSet) ); + m_pFillTabPage.disposeAndReset(lcl_CreateFillStyleTabPage(eFillType, m_xFillTab.get(), m_rXFSet)); + if (m_pFillTabPage) + m_pFillTabPage->SetTabDialog(GetTabDialog()); CreatePage( eFillType , m_pFillTabPage); } } diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index 982d15ae2669..edd5f5981c6e 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -67,73 +67,66 @@ const sal_uInt16 SvxBitmapTabPage::pBitmapRanges[] = 0 }; -SvxBitmapTabPage::SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ) : - - SvxTabPage( pParent, - "BitmapTabPage", - "cui/ui/bitmaptabpage.ui", - rInAttrs ), - m_rOutAttrs (rInAttrs ), - - m_pBitmapList( nullptr ), - - m_pnBitmapListState( nullptr ), - m_fObjectWidth(0.0), - m_fObjectHeight(0.0), - m_bLogicalSize(false), - m_aXFillAttr ( rInAttrs.GetPool() ), - m_rXFSet ( m_aXFillAttr.GetItemSet() ), - mpView(nullptr) +SvxBitmapTabPage::SvxBitmapTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs) + : SvxTabPage(pParent, "cui/ui/bitmaptabpage.ui", "BitmapTabPage", rInAttrs) + , m_rOutAttrs(rInAttrs) + , m_pBitmapList(nullptr) + , m_pnBitmapListState(nullptr) + , m_fObjectWidth(0.0) + , m_fObjectHeight(0.0) + , m_bLogicalSize(false) + , m_aXFillAttr(rInAttrs.GetPool()) + , m_rXFSet(m_aXFillAttr.GetItemSet()) + , mpView(nullptr) + , m_xBitmapLB(new PresetListBox(m_xBuilder->weld_scrolled_window("bitmapwin"))) + , m_xBitmapStyleLB(m_xBuilder->weld_combo_box_text("bitmapstyle")) + , m_xSizeBox(m_xBuilder->weld_container("sizebox")) + , m_xTsbScale(m_xBuilder->weld_check_button("scaletsb")) + , m_xBitmapWidth(m_xBuilder->weld_metric_spin_button("width", FUNIT_PERCENT)) + , m_xBitmapHeight(m_xBuilder->weld_metric_spin_button("height", FUNIT_PERCENT)) + , m_xPositionBox(m_xBuilder->weld_container("posbox")) + , m_xPositionLB(m_xBuilder->weld_combo_box_text("positionlb")) + , m_xPositionOffBox(m_xBuilder->weld_container("posoffbox")) + , m_xPositionOffX(m_xBuilder->weld_metric_spin_button("posoffx", FUNIT_PERCENT)) + , m_xPositionOffY(m_xBuilder->weld_metric_spin_button("posoffy", FUNIT_PERCENT)) + , m_xTileOffBox(m_xBuilder->weld_container("tileoffbox")) + , m_xTileOffLB(m_xBuilder->weld_combo_box_text("tileofflb")) + , m_xTileOffset(m_xBuilder->weld_metric_spin_button("tileoffmtr", FUNIT_PERCENT)) + , m_xBtnImport(m_xBuilder->weld_button("BTN_IMPORT")) + , m_xCtlBitmapPreview(new weld::CustomWeld(*m_xBuilder, "CTL_BITMAP_PREVIEW", m_aCtlBitmapPreview)) + , m_xBitmapLBWin(new weld::CustomWeld(*m_xBuilder, "BITMAP", *m_xBitmapLB)) { - get(m_pBitmapLB,"BITMAP"); - get(m_pBitmapStyleLB, "bitmapstyle"); - get(m_pSizeBox, "sizebox"); - get(m_pBitmapWidth, "width"); - get(m_pBitmapHeight, "height"); - get(m_pTsbScale, "scaletsb"); - get(m_pPositionBox, "posbox"); - get(m_pPositionLB, "positionlb"); - get(m_pPositionOffBox, "posoffbox"); - get(m_pPositionOffX, "posoffx"); - get(m_pPositionOffY, "posoffy"); - get(m_pTileOffBox, "tileoffbox"); - get(m_pTileOffLB, "tileofflb"); - get(m_pTileOffset, "tileoffmtr"); - get(m_pCtlBitmapPreview,"CTL_BITMAP_PREVIEW"); - get(m_pBtnImport, "BTN_IMPORT"); - // setting the output device m_rXFSet.Put( XFillStyleItem(drawing::FillStyle_BITMAP) ); m_rXFSet.Put( XFillBitmapItem(OUString(), Graphic()) ); - m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - - m_pBitmapLB->SetSelectHdl( LINK(this, SvxBitmapTabPage, ModifyBitmapHdl) ); - m_pBitmapLB->SetRenameHdl( LINK(this, SvxBitmapTabPage, ClickRenameHdl) ); - m_pBitmapLB->SetDeleteHdl( LINK(this, SvxBitmapTabPage, ClickDeleteHdl) ); - m_pBitmapStyleLB->SetSelectHdl( LINK(this, SvxBitmapTabPage, ModifyBitmapStyleHdl) ); - Link<Edit&, void> aLink1( LINK(this, SvxBitmapTabPage, ModifyBitmapSizeHdl) ); - m_pBitmapWidth->SetModifyHdl( aLink1 ); - m_pBitmapHeight->SetModifyHdl( aLink1 ); - m_pTsbScale->SetClickHdl( LINK(this, SvxBitmapTabPage, ClickScaleHdl) ); - m_pPositionLB->SetSelectHdl( LINK( this, SvxBitmapTabPage, ModifyBitmapPositionHdl ) ); - Link<Edit&, void> aLink( LINK( this, SvxBitmapTabPage, ModifyPositionOffsetHdl ) ); - m_pPositionOffX->SetModifyHdl(aLink); - m_pPositionOffY->SetModifyHdl(aLink); - m_pTileOffset->SetModifyHdl( LINK( this, SvxBitmapTabPage, ModifyTileOffsetHdl ) ); - m_pBtnImport->SetClickHdl( LINK(this, SvxBitmapTabPage, ClickImportHdl) ); + m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + + m_xBitmapLB->SetSelectHdl( LINK(this, SvxBitmapTabPage, ModifyBitmapHdl) ); + m_xBitmapLB->SetRenameHdl( LINK(this, SvxBitmapTabPage, ClickRenameHdl) ); + m_xBitmapLB->SetDeleteHdl( LINK(this, SvxBitmapTabPage, ClickDeleteHdl) ); + m_xBitmapStyleLB->connect_changed( LINK(this, SvxBitmapTabPage, ModifyBitmapStyleHdl) ); + Link<weld::MetricSpinButton&, void> aLink1( LINK(this, SvxBitmapTabPage, ModifyBitmapSizeHdl) ); + m_xBitmapWidth->connect_value_changed( aLink1 ); + m_xBitmapHeight->connect_value_changed( aLink1 ); + m_xTsbScale->connect_clicked(LINK(this, SvxBitmapTabPage, ClickScaleHdl)); + m_xPositionLB->connect_changed( LINK( this, SvxBitmapTabPage, ModifyBitmapPositionHdl ) ); + Link<weld::MetricSpinButton&, void> aLink( LINK( this, SvxBitmapTabPage, ModifyPositionOffsetHdl ) ); + m_xPositionOffX->connect_value_changed(aLink); + m_xPositionOffY->connect_value_changed(aLink); + m_xTileOffset->set_value(0, FUNIT_PERCENT); + m_xTileOffset->connect_value_changed( LINK( this, SvxBitmapTabPage, ModifyTileOffsetHdl ) ); + m_xBtnImport->connect_clicked( LINK(this, SvxBitmapTabPage, ClickImportHdl) ); // Calculate size of display boxes Size aSize = getDrawPreviewOptimalSize(this); - m_pBitmapLB->set_width_request(aSize.Width()); - m_pBitmapLB->set_height_request(aSize.Height()); - m_pCtlBitmapPreview->set_width_request(aSize.Width()); - m_pCtlBitmapPreview->set_height_request(aSize.Height()); + m_xBitmapLB->set_size_request(aSize.Width(), aSize.Height()); + m_xCtlBitmapPreview->set_size_request(aSize.Width(), aSize.Height()); SfxItemPool* pPool = m_rXFSet.GetPool(); mePoolUnit = pPool->GetMetric( XATTR_FILLBMP_SIZEX ); meFieldUnit = GetModuleFieldUnit( rInAttrs ); - SetFieldUnit( *m_pBitmapWidth, meFieldUnit, true ); - SetFieldUnit( *m_pBitmapHeight, meFieldUnit, true ); + SetFieldUnit( *m_xBitmapWidth, meFieldUnit, true ); + SetFieldUnit( *m_xBitmapHeight, meFieldUnit, true ); SfxViewShell* pViewShell = SfxViewShell::Current(); if( pViewShell ) @@ -148,32 +141,17 @@ SvxBitmapTabPage::~SvxBitmapTabPage() void SvxBitmapTabPage::dispose() { - m_pBitmapLB.clear(); - m_pBitmapStyleLB.clear(); - m_pSizeBox.clear(); - m_pBitmapWidth.clear(); - m_pBitmapHeight.clear(); - m_pTsbScale.clear(); - m_pPositionBox.clear(); - m_pPositionLB.clear(); - m_pPositionOffBox.clear(); - m_pPositionOffX.clear(); - m_pPositionOffY.clear(); - m_pTileOffBox.clear(); - m_pTileOffLB.clear(); - m_pTileOffset.clear(); - m_pCtlBitmapPreview.clear(); - m_pBtnImport.clear(); + m_xBitmapLBWin.reset(); + m_xBitmapLB.reset(); + m_xCtlBitmapPreview.reset(); SvxTabPage::dispose(); } - void SvxBitmapTabPage::Construct() { - m_pBitmapLB->FillPresetListBox( *m_pBitmapList ); + m_xBitmapLB->FillPresetListBox( *m_pBitmapList ); } - void SvxBitmapTabPage::ActivatePage( const SfxItemSet& rSet ) { XFillBitmapItem aItem( rSet.Get(XATTR_FILLBITMAP) ); @@ -181,8 +159,8 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& rSet ) sal_Int32 nPos = SearchBitmapList( aItem.GetName() ); if ( nPos != LISTBOX_ENTRY_NOTFOUND ) { - sal_uInt16 nId = m_pBitmapLB->GetItemId( static_cast<size_t>( nPos ) ); - m_pBitmapLB->SelectItem( nId ); + sal_uInt16 nId = m_xBitmapLB->GetItemId( static_cast<size_t>( nPos ) ); + m_xBitmapLB->SelectItem( nId ); } } @@ -199,15 +177,15 @@ DeactivateRC SvxBitmapTabPage::DeactivatePage( SfxItemSet* _pSet ) bool SvxBitmapTabPage::FillItemSet( SfxItemSet* rAttrs ) { rAttrs->Put(XFillStyleItem(drawing::FillStyle_BITMAP)); - size_t nPos = m_pBitmapLB->GetSelectItemPos(); + size_t nPos = m_xBitmapLB->GetSelectItemPos(); if(VALUESET_ITEM_NOTFOUND != nPos) { const XBitmapEntry* pXBitmapEntry = m_pBitmapList->GetBitmap(nPos); - const OUString aString(m_pBitmapLB->GetItemText( m_pBitmapLB->GetSelectedItemId() )); + const OUString aString(m_xBitmapLB->GetItemText( m_xBitmapLB->GetSelectedItemId() )); rAttrs->Put(XFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject())); } - BitmapStyle eStylePos = static_cast<BitmapStyle>(m_pBitmapStyleLB->GetSelectedEntryPos()); + BitmapStyle eStylePos = static_cast<BitmapStyle>(m_xBitmapStyleLB->get_active()); bool bIsStretched( eStylePos == STRETCHED ); bool bIsTiled( eStylePos == TILED ); @@ -222,17 +200,17 @@ bool SvxBitmapTabPage::FillItemSet( SfxItemSet* rAttrs ) case CUSTOM: case TILED: { - sal_Int64 nWidthPercent = m_pBitmapWidth->GetValue(); - sal_Int64 nHeightPercent = m_pBitmapHeight->GetValue(); - if(m_pTsbScale->IsEnabled() && m_pTsbScale->GetState() == TRISTATE_TRUE) + sal_Int64 nWidthPercent = m_xBitmapWidth->get_value(FUNIT_NONE); + sal_Int64 nHeightPercent = m_xBitmapHeight->get_value(FUNIT_NONE); + if (m_xTsbScale->get_sensitive() && m_xTsbScale->get_state() == TRISTATE_TRUE) { aSetBitmapSize.setWidth( -nWidthPercent ); aSetBitmapSize.setHeight( -nHeightPercent ); } else if (!m_bLogicalSize) { - aSetBitmapSize.setWidth( GetCoreValue(*m_pBitmapWidth, mePoolUnit) ); - aSetBitmapSize.setHeight( GetCoreValue(*m_pBitmapHeight, mePoolUnit) ); + aSetBitmapSize.setWidth( GetCoreValue(*m_xBitmapWidth, mePoolUnit) ); + aSetBitmapSize.setHeight( GetCoreValue(*m_xBitmapHeight, mePoolUnit) ); } else { @@ -251,16 +229,16 @@ bool SvxBitmapTabPage::FillItemSet( SfxItemSet* rAttrs ) rAttrs->Put( XFillBmpSizeYItem( aSetBitmapSize.Height() ) ); } - if(m_pPositionLB->IsEnabled()) - rAttrs->Put( XFillBmpPosItem( static_cast<RectPoint>( m_pPositionLB->GetSelectedEntryPos() ) ) ); - if(m_pPositionOffX->IsEnabled()) - rAttrs->Put( XFillBmpPosOffsetXItem( m_pPositionOffX->GetValue() ) ); - if(m_pPositionOffY->IsEnabled()) - rAttrs->Put( XFillBmpPosOffsetYItem( m_pPositionOffY->GetValue() ) ); - if(m_pTileOffBox->IsEnabled()) + if (m_xPositionLB->get_sensitive()) + rAttrs->Put( XFillBmpPosItem( static_cast<RectPoint>( m_xPositionLB->get_active() ) ) ); + if (m_xPositionOffX->get_sensitive()) + rAttrs->Put( XFillBmpPosOffsetXItem(m_xPositionOffX->get_value(FUNIT_PERCENT))); + if (m_xPositionOffY->get_sensitive()) + rAttrs->Put( XFillBmpPosOffsetYItem(m_xPositionOffY->get_value(FUNIT_PERCENT))); + if (m_xTileOffBox->get_sensitive()) { - TileOffset eValue = static_cast<TileOffset>(m_pTileOffLB->GetSelectedEntryPos()); - sal_uInt16 nOffsetValue = static_cast<sal_uInt16>(m_pTileOffset->GetValue()); + TileOffset eValue = static_cast<TileOffset>(m_xTileOffLB->get_active()); + sal_uInt16 nOffsetValue = static_cast<sal_uInt16>(m_xTileOffset->get_value(FUNIT_PERCENT)); sal_uInt16 nRowOff = (eValue == ROW) ? nOffsetValue : 0; sal_uInt16 nColOff = (eValue == COLUMN) ? nOffsetValue : 0; rAttrs->Put( XFillBmpTileOffsetXItem(nRowOff) ); @@ -300,11 +278,11 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) if(!aItem.isPattern()) { m_rXFSet.Put( aItem ); - m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlBitmapPreview->Invalidate(); + m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlBitmapPreview.Invalidate(); } else - m_pCtlBitmapPreview->Disable(); + m_xCtlBitmapPreview->set_sensitive(false); std::unique_ptr<GraphicObject> pGraphicObject; pGraphicObject.reset( new GraphicObject(aItem.GetGraphicObject()) ); @@ -324,34 +302,32 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) bStretched = rAttrs->Get( XATTR_FILLBMP_STRETCH ).GetValue(); if (bTiled) - m_pBitmapStyleLB->SelectEntryPos(static_cast<sal_Int32>(TILED)); + m_xBitmapStyleLB->set_active(static_cast<sal_Int32>(TILED)); else if (bStretched) - m_pBitmapStyleLB->SelectEntryPos( static_cast<sal_Int32>(STRETCHED) ); + m_xBitmapStyleLB->set_active(static_cast<sal_Int32>(STRETCHED)); else - m_pBitmapStyleLB->SelectEntryPos( static_cast<sal_Int32>(CUSTOM) ); + m_xBitmapStyleLB->set_active(static_cast<sal_Int32>(CUSTOM)); long nWidth = 0; long nHeight = 0; if(rAttrs->GetItemState(XATTR_FILLBMP_SIZELOG) != SfxItemState::DONTCARE) { - m_pTsbScale->EnableTriState( false ); - - if( rAttrs->Get( XATTR_FILLBMP_SIZELOG ).GetValue() ) + if (rAttrs->Get( XATTR_FILLBMP_SIZELOG ).GetValue()) { - m_pTsbScale->SetState( TRISTATE_FALSE ); + m_xTsbScale->set_state(TRISTATE_FALSE); m_bLogicalSize = true; } else { - m_pTsbScale->SetState( TRISTATE_TRUE ); + m_xTsbScale->set_state(TRISTATE_TRUE); m_bLogicalSize = false; } - ClickScaleHdl( nullptr ); + ClickScaleHdl(*m_xTsbScale); } else - m_pTsbScale->SetState( TRISTATE_INDET ); + m_xTsbScale->set_state(TRISTATE_INDET); TriState eRelative = TRISTATE_FALSE; if(rAttrs->GetItemState(XATTR_FILLBMP_SIZEX) != SfxItemState::DONTCARE) @@ -377,51 +353,51 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) nHeight = std::abs(nHeight); } } - m_pTsbScale->SetState(eRelative); + m_xTsbScale->set_state(eRelative); if(rBitmapSize.Width() > 0 && rBitmapSize.Height() > 0) { - if(eRelative == TRISTATE_TRUE) + if (eRelative == TRISTATE_TRUE) { - m_pBitmapWidth->SetValue(nWidth); - m_pBitmapHeight->SetValue(nHeight); + m_xBitmapWidth->set_value(nWidth, FUNIT_NONE); + m_xBitmapHeight->set_value(nHeight, FUNIT_NONE); } else { - SetMetricValue(*m_pBitmapWidth, nWidth, mePoolUnit); - SetMetricValue(*m_pBitmapHeight, nHeight, mePoolUnit); + SetMetricValue(*m_xBitmapWidth, nWidth, mePoolUnit); + SetMetricValue(*m_xBitmapHeight, nHeight, mePoolUnit); } } if( rAttrs->GetItemState( XATTR_FILLBMP_POS ) != SfxItemState::DONTCARE ) { RectPoint eValue = rAttrs->Get( XATTR_FILLBMP_POS ).GetValue(); - m_pPositionLB->SelectEntryPos( static_cast< sal_Int32 >(eValue) ); + m_xPositionLB->set_active( static_cast< sal_Int32 >(eValue) ); } if( rAttrs->GetItemState( XATTR_FILLBMP_POSOFFSETX ) != SfxItemState::DONTCARE ) { sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_POSOFFSETX ).GetValue(); - m_pPositionOffX->SetValue( nValue ); + m_xPositionOffX->set_value(nValue, FUNIT_PERCENT); } else - m_pPositionOffX->SetText(""); + m_xPositionOffX->set_text(""); if( rAttrs->GetItemState( XATTR_FILLBMP_POSOFFSETY ) != SfxItemState::DONTCARE ) { sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_POSOFFSETY ).GetValue(); - m_pPositionOffY->SetValue( nValue ); + m_xPositionOffY->set_value(nValue, FUNIT_PERCENT); } else - m_pPositionOffY->SetText(""); + m_xPositionOffY->set_text(""); if( rAttrs->GetItemState( XATTR_FILLBMP_TILEOFFSETX ) != SfxItemState::DONTCARE) { sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_TILEOFFSETX ).GetValue(); if(nValue > 0) { - m_pTileOffLB->SelectEntryPos(static_cast<sal_Int32>(ROW)); - m_pTileOffset->SetValue( nValue ); + m_xTileOffLB->set_active(static_cast<sal_Int32>(ROW)); + m_xTileOffset->set_value(nValue, FUNIT_PERCENT); } } @@ -430,28 +406,25 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_TILEOFFSETY ).GetValue(); if(nValue > 0) { - m_pTileOffLB->SelectEntryPos(static_cast<sal_Int32>(COLUMN)); - m_pTileOffset->SetValue( nValue ); + m_xTileOffLB->set_active(static_cast<sal_Int32>(COLUMN)); + m_xTileOffset->set_value(nValue, FUNIT_PERCENT); } } ClickBitmapHdl_Impl(); } - -VclPtr<SfxTabPage> SvxBitmapTabPage::Create( TabPageParent pWindow, - const SfxItemSet* rAttrs ) +VclPtr<SfxTabPage> SvxBitmapTabPage::Create(TabPageParent pWindow, const SfxItemSet* rAttrs) { - return VclPtr<SvxBitmapTabPage>::Create( pWindow.pParent, *rAttrs ); + return VclPtr<SvxBitmapTabPage>::Create(pWindow, *rAttrs); } - void SvxBitmapTabPage::ClickBitmapHdl_Impl() { - m_pBitmapLB->Enable(); - m_pCtlBitmapPreview->Enable(); + m_xBitmapLBWin->set_sensitive(true); + m_xCtlBitmapPreview->set_sensitive(true); - ModifyBitmapHdl( m_pBitmapLB ); + ModifyBitmapHdl(m_xBitmapLB.get()); } void SvxBitmapTabPage::CalculateBitmapPresetSize() @@ -478,10 +451,10 @@ void SvxBitmapTabPage::CalculateBitmapPresetSize() } } -IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void) +IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, SvtValueSet*, void) { std::unique_ptr<GraphicObject> pGraphicObject; - size_t nPos = m_pBitmapLB->GetSelectItemPos(); + size_t nPos = m_xBitmapLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { @@ -503,8 +476,8 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void) if(!pGraphicObject) { - sal_uInt16 nId = m_pBitmapLB->GetItemId(0); - m_pBitmapLB->SelectItem(nId); + sal_uInt16 nId = m_xBitmapLB->GetItemId(0); + m_xBitmapLB->SelectItem(nId); if(0 != nId) { @@ -522,16 +495,16 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void) rBitmapSize.setWidth( (OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale ); rBitmapSize.setHeight( (OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale ); CalculateBitmapPresetSize(); - ModifyBitmapStyleHdl( *m_pBitmapStyleLB ); - ModifyBitmapPositionHdl( *m_pPositionLB ); + ModifyBitmapStyleHdl( *m_xBitmapStyleLB ); + ModifyBitmapPositionHdl( *m_xPositionLB ); m_rXFSet.ClearItem(); m_rXFSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP)); m_rXFSet.Put(XFillBitmapItem(OUString(), *pGraphicObject)); - m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlBitmapPreview->Invalidate(); + m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlBitmapPreview.Invalidate(); } else { @@ -540,10 +513,10 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void) } -IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, SvxPresetListBox*, void) +IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, PresetListBox*, void) { - sal_uInt16 nId = m_pBitmapLB->GetSelectedItemId(); - size_t nPos = m_pBitmapLB->GetSelectItemPos(); + sal_uInt16 nId = m_xBitmapLB->GetSelectedItemId(); + size_t nPos = m_xBitmapLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { @@ -551,7 +524,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, SvxPresetListBox*, void) OUString aName( m_pBitmapList->GetBitmap( nPos )->GetName() ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc)); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc)); bool bLoop = true; while( bLoop && pDlg->Execute() == RET_OK ) @@ -565,14 +538,14 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, SvxPresetListBox*, void) bLoop = false; m_pBitmapList->GetBitmap(nPos)->SetName(aName); - m_pBitmapLB->SetItemText(nId, aName); - m_pBitmapLB->SelectItem( nId ); + m_xBitmapLB->SetItemText(nId, aName); + m_xBitmapLB->SelectItem( nId ); *m_pnBitmapListState |= ChangeType::MODIFIED; } else { - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog")); xBox->run(); } @@ -580,91 +553,86 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, SvxPresetListBox*, void) } } -IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl, SvxPresetListBox*, void) +IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl, PresetListBox*, void) { - sal_uInt16 nId = m_pBitmapLB->GetSelectedItemId(); - size_t nPos = m_pBitmapLB->GetSelectItemPos(); + sal_uInt16 nId = m_xBitmapLB->GetSelectedItemId(); + size_t nPos = m_xBitmapLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletebitmapdialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/querydeletebitmapdialog.ui")); std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelBitmapDialog")); if (xQueryBox->run() == RET_YES) { m_pBitmapList->Remove( static_cast<sal_uInt16>(nPos) ); - m_pBitmapLB->RemoveItem( nId ); - nId = m_pBitmapLB->GetItemId(0); - m_pBitmapLB->SelectItem( nId ); + m_xBitmapLB->RemoveItem( nId ); + nId = m_xBitmapLB->GetItemId(0); + m_xBitmapLB->SelectItem( nId ); - m_pCtlBitmapPreview->Invalidate(); - ModifyBitmapHdl( m_pBitmapLB ); + m_aCtlBitmapPreview.Invalidate(); + ModifyBitmapHdl(m_xBitmapLB.get()); *m_pnBitmapListState |= ChangeType::MODIFIED; } } } -IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapSizeHdl, Edit&, void ) +IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapSizeHdl, weld::MetricSpinButton&, void ) { m_bLogicalSize = false; - if( m_pTsbScale->GetState() != TRISTATE_TRUE && static_cast<BitmapStyle>(m_pBitmapStyleLB->GetSelectedEntryPos()) != TILED ) + if (m_xTsbScale->get_state() != TRISTATE_TRUE && static_cast<BitmapStyle>(m_xBitmapStyleLB->get_active()) != TILED) { - sal_Int64 nWidthPercent = m_pBitmapWidth->Denormalize( m_pBitmapWidth->GetValue() ); - sal_Int64 nHeightPercent = m_pBitmapHeight->Denormalize( m_pBitmapHeight->GetValue() ); - if( nWidthPercent == 100 && nHeightPercent == 100 ) - m_pBitmapStyleLB->SelectEntryPos( static_cast<sal_Int32>(CUSTOM) ); + sal_Int64 nWidthPercent = m_xBitmapWidth->denormalize(m_xBitmapWidth->get_value(FUNIT_NONE)); + sal_Int64 nHeightPercent = m_xBitmapHeight->denormalize(m_xBitmapHeight->get_value(FUNIT_NONE)); + if (nWidthPercent == 100 && nHeightPercent == 100) + m_xBitmapStyleLB->set_active(static_cast<sal_Int32>(CUSTOM)); } - ModifyBitmapStyleHdl(*m_pBitmapStyleLB); + ModifyBitmapStyleHdl(*m_xBitmapStyleLB); - m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlBitmapPreview->Invalidate(); + m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlBitmapPreview.Invalidate(); } -IMPL_LINK_NOARG( SvxBitmapTabPage, ClickScaleHdl, Button*, void ) +IMPL_LINK_NOARG( SvxBitmapTabPage, ClickScaleHdl, weld::Button&, void ) { - if( m_pTsbScale->GetState() == TRISTATE_TRUE ) + if (m_xTsbScale->get_state() == TRISTATE_TRUE) { - m_pBitmapWidth->SetDecimalDigits( 0 ); - m_pBitmapWidth->SetUnit(FUNIT_PERCENT); - m_pBitmapWidth->SetValue( 100 ); - m_pBitmapWidth->SetMax( 100 ); - m_pBitmapWidth->SetLast( 100 ); - - m_pBitmapHeight->SetDecimalDigits( 0 ); - m_pBitmapHeight->SetUnit(FUNIT_PERCENT); - m_pBitmapHeight->SetValue( 100 ); - m_pBitmapHeight->SetMax( 100 ); - m_pBitmapHeight->SetLast( 100 ); + m_xBitmapWidth->set_digits( 0 ); + m_xBitmapWidth->set_unit(FUNIT_PERCENT); + m_xBitmapWidth->set_value(100, FUNIT_NONE); + m_xBitmapWidth->set_range(0, 100, FUNIT_NONE); + + m_xBitmapHeight->set_digits( 0 ); + m_xBitmapHeight->set_unit(FUNIT_PERCENT); + m_xBitmapHeight->set_value(100, FUNIT_NONE); + m_xBitmapHeight->set_range(0, 100, FUNIT_NONE); } else { - m_pBitmapWidth->SetDecimalDigits( 2 ); - m_pBitmapWidth->SetUnit( meFieldUnit ); - m_pBitmapWidth->SetValue( 100 ); - m_pBitmapWidth->SetMax( 999900 ); - m_pBitmapWidth->SetLast( 100000 ); - - m_pBitmapHeight->SetDecimalDigits( 2 ); - m_pBitmapHeight->SetDecimalDigits( 2 ); - m_pBitmapHeight->SetUnit( meFieldUnit ); - m_pBitmapHeight->SetValue( 100 ); - m_pBitmapHeight->SetMax( 999900 ); - m_pBitmapHeight->SetLast( 100000 ); + m_xBitmapWidth->set_digits( 2 ); + m_xBitmapWidth->set_unit(meFieldUnit); + m_xBitmapWidth->set_value(100, FUNIT_NONE); + m_xBitmapWidth->set_range(0, 999900, FUNIT_NONE); + + m_xBitmapHeight->set_digits( 2 ); + m_xBitmapHeight->set_unit(meFieldUnit); + m_xBitmapHeight->set_value(100, FUNIT_NONE); + m_xBitmapHeight->set_range(0, 999900, FUNIT_NONE); } - ModifyBitmapStyleHdl( *m_pBitmapStyleLB ); + ModifyBitmapStyleHdl( *m_xBitmapStyleLB ); } -IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapStyleHdl, ListBox&, void ) +IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapStyleHdl, weld::ComboBoxText&, void ) { - BitmapStyle eStylePos = static_cast<BitmapStyle>(m_pBitmapStyleLB->GetSelectedEntryPos()); + BitmapStyle eStylePos = static_cast<BitmapStyle>(m_xBitmapStyleLB->get_active()); bool bIsStretched( eStylePos == STRETCHED ); bool bIsTiled( eStylePos == TILED ); - m_pSizeBox->Enable( !bIsStretched ); - m_pPositionBox->Enable( !bIsStretched ); - m_pPositionOffBox->Enable( bIsTiled ); - m_pTileOffBox->Enable( bIsTiled ); + m_xSizeBox->set_sensitive( !bIsStretched ); + m_xPositionBox->set_sensitive( !bIsStretched ); + m_xPositionOffBox->set_sensitive( bIsTiled ); + m_xTileOffBox->set_sensitive( bIsTiled ); m_rXFSet.Put( XFillBmpTileItem( bIsTiled ) ); m_rXFSet.Put( XFillBmpStretchItem( bIsStretched ) ); @@ -677,15 +645,15 @@ IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapStyleHdl, ListBox&, void ) case CUSTOM: case TILED: { - if(m_pTsbScale->IsEnabled() && m_pTsbScale->GetState() == TRISTATE_TRUE) + if (m_xTsbScale->get_sensitive() && m_xTsbScale->get_state() == TRISTATE_TRUE) { - aSetBitmapSize.setWidth( -m_pBitmapWidth->GetValue() ); - aSetBitmapSize.setHeight( -m_pBitmapWidth->GetValue() ); + aSetBitmapSize.setWidth(-m_xBitmapWidth->get_value(FUNIT_NONE)); + aSetBitmapSize.setHeight(-m_xBitmapWidth->get_value(FUNIT_NONE)); } else { - aSetBitmapSize.setWidth( GetCoreValue( *m_pBitmapWidth, mePoolUnit ) ); - aSetBitmapSize.setHeight( GetCoreValue( *m_pBitmapHeight, mePoolUnit ) ); + aSetBitmapSize.setWidth( GetCoreValue( *m_xBitmapWidth, mePoolUnit ) ); + aSetBitmapSize.setHeight( GetCoreValue( *m_xBitmapHeight, mePoolUnit ) ); } } break; @@ -697,52 +665,52 @@ IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapStyleHdl, ListBox&, void ) m_rXFSet.Put( XFillBmpSizeYItem( aSetBitmapSize.Height() ) ); } - m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlBitmapPreview->Invalidate(); + m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlBitmapPreview.Invalidate(); } -IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapPositionHdl, ListBox&, void) +IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapPositionHdl, weld::ComboBoxText&, void) { - if(m_pPositionLB->IsEnabled()) - m_rXFSet.Put( XFillBmpPosItem( static_cast< RectPoint >( m_pPositionLB->GetSelectedEntryPos() ) ) ); + if (m_xPositionLB->get_sensitive()) + m_rXFSet.Put( XFillBmpPosItem( static_cast< RectPoint >( m_xPositionLB->get_active() ) ) ); - m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlBitmapPreview->Invalidate(); + m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlBitmapPreview.Invalidate(); } -IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyPositionOffsetHdl, Edit&, void) +IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyPositionOffsetHdl, weld::MetricSpinButton&, void) { - if(m_pPositionOffX->IsEnabled()) - m_rXFSet.Put( XFillBmpPosOffsetXItem( m_pPositionOffX->GetValue() ) ); + if (m_xPositionOffX->get_sensitive()) + m_rXFSet.Put( XFillBmpPosOffsetXItem( m_xPositionOffX->get_value(FUNIT_PERCENT) ) ); - if(m_pPositionOffY->IsEnabled()) - m_rXFSet.Put( XFillBmpPosOffsetYItem( m_pPositionOffY->GetValue() ) ); + if (m_xPositionOffY->get_sensitive()) + m_rXFSet.Put( XFillBmpPosOffsetYItem( m_xPositionOffY->get_value(FUNIT_PERCENT) ) ); - m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlBitmapPreview->Invalidate(); + m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlBitmapPreview.Invalidate(); } -IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyTileOffsetHdl, Edit&, void) +IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyTileOffsetHdl, weld::MetricSpinButton&, void) { sal_uInt16 nTileXOff = 0; sal_uInt16 nTileYOff = 0; - if(m_pTileOffLB->GetSelectedEntryPos() == static_cast<sal_Int32>(ROW)) - nTileXOff = m_pTileOffset->GetValue(); + if(m_xTileOffLB->get_active() == static_cast<sal_Int32>(ROW)) + nTileXOff = m_xTileOffset->get_value(FUNIT_PERCENT); - if(m_pTileOffLB->GetSelectedEntryPos() == static_cast<sal_Int32>(COLUMN)) - nTileYOff = m_pTileOffset->GetValue(); + if(m_xTileOffLB->get_active() == static_cast<sal_Int32>(COLUMN)) + nTileYOff = m_xTileOffset->get_value(FUNIT_PERCENT); m_rXFSet.Put( XFillBmpTileOffsetXItem(nTileXOff) ); m_rXFSet.Put( XFillBmpTileOffsetYItem(nTileYOff) ); - m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlBitmapPreview->Invalidate(); + m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlBitmapPreview.Invalidate(); } -IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void) +IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void) { - SvxOpenGraphicDialog aDlg("Import", GetFrameWeld()); + SvxOpenGraphicDialog aDlg("Import", GetTabDialog()->GetFrameWeld()); aDlg.EnableLink(false); long nCount = m_pBitmapList->Count(); @@ -762,7 +730,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void) OUString aName; INetURLObject aURL( aDlg.GetPath() ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aURL.GetName().getToken(0, '.'), aDesc)); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aURL.GetName().getToken(0, '.'), aDesc)); nError = ErrCode(1); while( pDlg->Execute() == RET_OK ) @@ -780,7 +748,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void) break; } - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog")); if (xBox->run() != RET_OK) break; @@ -792,20 +760,20 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void) { m_pBitmapList->Insert(o3tl::make_unique<XBitmapEntry>(aGraphic, aName), nCount); - sal_Int32 nId = m_pBitmapLB->GetItemId( nCount - 1 ); - BitmapEx aBitmap = m_pBitmapList->GetBitmapForPreview( nCount, m_pBitmapLB->GetIconSize() ); + sal_Int32 nId = m_xBitmapLB->GetItemId( nCount - 1 ); + BitmapEx aBitmap = m_pBitmapList->GetBitmapForPreview( nCount, m_xBitmapLB->GetIconSize() ); - m_pBitmapLB->InsertItem( nId + 1, Image(aBitmap), aName ); - m_pBitmapLB->SelectItem( nId + 1 ); + m_xBitmapLB->InsertItem( nId + 1, Image(aBitmap), aName ); + m_xBitmapLB->SelectItem( nId + 1 ); *m_pnBitmapListState |= ChangeType::MODIFIED; - ModifyBitmapHdl( m_pBitmapLB ); + ModifyBitmapHdl(m_xBitmapLB.get()); } } else { // graphic couldn't be loaded - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querynoloadedfiledialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/querynoloadedfiledialog.ui")); std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("NoLoadedFileDialog")); xBox->run(); } diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index 401c7f3d27d9..857bd6391276 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -341,7 +341,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, weld::Button&, void) } SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc)); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc)); sal_uInt16 nError = 1; while (pDlg->Execute() == RET_OK) @@ -355,7 +355,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, weld::Button&, void) break; } - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog")); if (xWarnBox->run() != RET_OK) break; @@ -395,7 +395,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickWorkOnHdl_Impl, weld::Button&, void) aColorDlg.SetColor (aCurrentColor); aColorDlg.SetMode( svtools::ColorPickerMode::Modify ); - if (aColorDlg.Execute(GetFrameWeld()) == RET_OK) + if (aColorDlg.Execute(GetTabDialog()->GetFrameWeld()) == RET_OK) { Color aPreviewColor = aColorDlg.GetColor(); aCurrentColor = aPreviewColor; diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index 8e3e9d3d579a..9e9c4342561f 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -49,87 +49,76 @@ using namespace com::sun::star; -SvxGradientTabPage::SvxGradientTabPage -( - vcl::Window* pParent, - const SfxItemSet& rInAttrs -) : - SfxTabPage ( pParent, "GradientPage", "cui/ui/gradientpage.ui", &rInAttrs ), - - m_rOutAttrs ( rInAttrs ), - m_pnGradientListState ( nullptr ), - m_pnColorListState ( nullptr ), - m_aXFillAttr ( rInAttrs.GetPool() ), - m_rXFSet ( m_aXFillAttr.GetItemSet() ) +SvxGradientTabPage::SvxGradientTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs) + : SfxTabPage(pParent, "cui/ui/gradientpage.ui", "GradientPage", &rInAttrs) + , m_rOutAttrs(rInAttrs) + , m_pnGradientListState(nullptr) + , m_pnColorListState(nullptr) + , m_aXFillAttr(rInAttrs.GetPool()) + , m_rXFSet(m_aXFillAttr.GetItemSet()) + , m_xLbGradientType(m_xBuilder->weld_combo_box_text("gradienttypelb")) + , m_xFtCenter(m_xBuilder->weld_label("centerft")) + , m_xMtrCenterX(m_xBuilder->weld_metric_spin_button("centerxmtr", FUNIT_PERCENT)) + , m_xMtrCenterY(m_xBuilder->weld_metric_spin_button("centerymtr", FUNIT_PERCENT)) + , m_xFtAngle(m_xBuilder->weld_label("angleft")) + , m_xMtrAngle(m_xBuilder->weld_metric_spin_button("anglemtr", FUNIT_DEGREE)) + , m_xMtrBorder(m_xBuilder->weld_metric_spin_button("bordermtr", FUNIT_PERCENT)) + , m_xSliderBorder(m_xBuilder->weld_scale("borderslider")) + , m_xLbColorFrom(new ColorListBox(m_xBuilder->weld_menu_button("colorfromlb"), GetFrameWeld())) + , m_xMtrColorFrom(m_xBuilder->weld_metric_spin_button("colorfrommtr", FUNIT_PERCENT)) + , m_xLbColorTo(new ColorListBox(m_xBuilder->weld_menu_button("colortolb"), GetFrameWeld())) + , m_xMtrColorTo(m_xBuilder->weld_metric_spin_button("colortomtr", FUNIT_PERCENT)) + , m_xGradientLB(new PresetListBox(m_xBuilder->weld_scrolled_window("gradientpresetlistwin"))) + , m_xMtrIncrement(m_xBuilder->weld_spin_button("incrementmtr")) + , m_xCbIncrement(m_xBuilder->weld_check_button("autoincrement")) + , m_xSliderIncrement(m_xBuilder->weld_scale("incrementslider")) + , m_xBtnAdd(m_xBuilder->weld_button("add")) + , m_xBtnModify(m_xBuilder->weld_button("modify")) + , m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "previewctl", m_aCtlPreview)) + , m_xGradientLBWin(new weld::CustomWeld(*m_xBuilder, "gradientpresetlist", *m_xGradientLB)) { - get(m_pCbIncrement, "autoincrement"); - get(m_pMtrIncrement, "incrementmtr"); - get(m_pSliderIncrement,"incrementslider"); - get(m_pLbGradientType, "gradienttypelb"); - get(m_pFtCenter, "centerft"); - get(m_pMtrCenterX, "centerxmtr"); - get(m_pMtrCenterY, "centerymtr"); - get(m_pFtAngle, "angleft"); - get(m_pMtrAngle, "anglemtr"); - get(m_pMtrBorder, "bordermtr"); - get(m_pSliderBorder, "borderslider"); - get(m_pLbColorFrom, "colorfromlb"); - get(m_pMtrColorFrom, "colorfrommtr"); - get(m_pLbColorTo, "colortolb"); - get(m_pMtrColorTo, "colortomtr"); - get(m_pGradientLB, "gradientpresetlist"); - get(m_pCtlPreview, "previewctl"); Size aSize = getDrawPreviewOptimalSize(this); - m_pGradientLB->set_width_request(aSize.Width()); - m_pGradientLB->set_height_request(aSize.Height()); - m_pCtlPreview->set_width_request(aSize.Width()); - m_pCtlPreview->set_height_request(aSize.Height()); - get(m_pBtnAdd, "add"); - get(m_pBtnModify, "modify"); + m_xGradientLB->set_size_request(aSize.Width(), aSize.Height()); + m_xCtlPreview->set_size_request(aSize.Width(), aSize.Height()); // this page needs ExchangeSupport SetExchangeSupport(); // as long as NOT supported by the item - m_pSliderIncrement->SetRange(Range(3,256)); - m_pMtrColorTo->SetValue( 100 ); - m_pMtrColorFrom->SetValue( 100 ); - m_pSliderBorder->SetRange(Range(0,100)); + m_xMtrColorTo->set_value(100, FUNIT_PERCENT); + m_xMtrColorFrom->set_value(100, FUNIT_PERCENT); // setting the output device m_rXFSet.Put( XFillStyleItem(drawing::FillStyle_GRADIENT) ); m_rXFSet.Put( XFillGradientItem(OUString(), XGradient( COL_BLACK, COL_WHITE )) ); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlPreview.SetAttributes(m_aXFillAttr.GetItemSet()); // set handler - m_pGradientLB->SetSelectHdl( LINK( this, SvxGradientTabPage, ChangeGradientHdl ) ); - m_pGradientLB->SetRenameHdl( LINK( this, SvxGradientTabPage, ClickRenameHdl_Impl ) ); - m_pGradientLB->SetDeleteHdl( LINK( this, SvxGradientTabPage, ClickDeleteHdl_Impl ) ); - m_pBtnAdd->SetClickHdl( LINK( this, SvxGradientTabPage, ClickAddHdl_Impl ) ); - m_pBtnModify->SetClickHdl( - LINK( this, SvxGradientTabPage, ClickModifyHdl_Impl ) ); - - Link<Edit&,void> aLink = LINK( this, SvxGradientTabPage, ModifiedEditHdl_Impl ); - Link<ListBox&,void> aLink2 = LINK( this, SvxGradientTabPage, ModifiedListBoxHdl_Impl ); - m_pLbGradientType->SetSelectHdl( aLink2 ); - m_pCbIncrement->SetToggleHdl( LINK( this, SvxGradientTabPage, ChangeAutoStepHdl_Impl ) ); - m_pMtrIncrement->SetModifyHdl( aLink ); - m_pSliderIncrement->SetSlideHdl( LINK( this, SvxGradientTabPage, ModifiedSliderHdl_Impl ) ); - m_pMtrCenterX->SetModifyHdl( aLink ); - m_pMtrCenterY->SetModifyHdl( aLink ); - m_pMtrAngle->SetModifyHdl( aLink ); - m_pMtrBorder->SetModifyHdl( aLink ); - m_pSliderBorder->SetSlideHdl( LINK( this, SvxGradientTabPage, ModifiedSliderHdl_Impl ) ); - m_pMtrColorFrom->SetModifyHdl( aLink ); - Link<SvxColorListBox&,void> aLink3 = LINK( this, SvxGradientTabPage, ModifiedColorListBoxHdl_Impl ); - m_pLbColorFrom->SetSelectHdl( aLink3 ); - m_pMtrColorTo->SetModifyHdl( aLink ); - m_pLbColorTo->SetSelectHdl( aLink3 ); + m_xGradientLB->SetSelectHdl( LINK( this, SvxGradientTabPage, ChangeGradientHdl ) ); + m_xGradientLB->SetRenameHdl( LINK( this, SvxGradientTabPage, ClickRenameHdl_Impl ) ); + m_xGradientLB->SetDeleteHdl( LINK( this, SvxGradientTabPage, ClickDeleteHdl_Impl ) ); + m_xBtnAdd->connect_clicked(LINK(this, SvxGradientTabPage, ClickAddHdl_Impl)); + m_xBtnModify->connect_clicked(LINK(this, SvxGradientTabPage, ClickModifyHdl_Impl)); + + Link<weld::MetricSpinButton&,void> aLink = LINK( this, SvxGradientTabPage, ModifiedMetricHdl_Impl ); + Link<weld::ComboBoxText&,void> aLink2 = LINK( this, SvxGradientTabPage, ModifiedListBoxHdl_Impl ); + m_xLbGradientType->connect_changed( aLink2 ); + m_xCbIncrement->connect_toggled(LINK(this, SvxGradientTabPage, ChangeAutoStepHdl_Impl)); + m_xMtrIncrement->connect_value_changed(LINK(this, SvxGradientTabPage, ModifiedEditHdl_Impl)); + m_xSliderIncrement->connect_value_changed(LINK(this, SvxGradientTabPage, ModifiedSliderHdl_Impl)); + m_xMtrCenterX->connect_value_changed( aLink ); + m_xMtrCenterY->connect_value_changed( aLink ); + m_xMtrAngle->connect_value_changed( aLink ); + m_xMtrBorder->connect_value_changed( aLink ); + m_xSliderBorder->connect_value_changed(LINK(this, SvxGradientTabPage, ModifiedSliderHdl_Impl)); + m_xMtrColorFrom->connect_value_changed( aLink ); + Link<ColorListBox&,void> aLink3 = LINK( this, SvxGradientTabPage, ModifiedColorListBoxHdl_Impl ); + m_xLbColorFrom->SetSelectHdl( aLink3 ); + m_xMtrColorTo->connect_value_changed( aLink ); + m_xLbColorTo->SetSelectHdl( aLink3 ); // #i76307# always paint the preview in LTR, because this is what the document does - m_pCtlPreview->EnableRTL( false ); - - setPreviewsToSamePlace(pParent, this); + m_aCtlPreview.EnableRTL(false); } SvxGradientTabPage::~SvxGradientTabPage() @@ -139,31 +128,17 @@ SvxGradientTabPage::~SvxGradientTabPage() void SvxGradientTabPage::dispose() { - m_pCbIncrement.clear(); - m_pMtrIncrement.clear(); - m_pSliderIncrement.clear(); - m_pLbGradientType.clear(); - m_pFtCenter.clear(); - m_pMtrCenterX.clear(); - m_pMtrCenterY.clear(); - m_pFtAngle.clear(); - m_pMtrAngle.clear(); - m_pMtrBorder.clear(); - m_pSliderBorder.clear(); - m_pLbColorFrom.clear(); - m_pMtrColorFrom.clear(); - m_pLbColorTo.clear(); - m_pMtrColorTo.clear(); - m_pGradientLB.clear(); - m_pCtlPreview.clear(); - m_pBtnAdd.clear(); - m_pBtnModify.clear(); + m_xCtlPreview.reset(); + m_xGradientLBWin.reset(); + m_xGradientLB.reset(); + m_xLbColorTo.reset(); + m_xLbColorFrom.reset(); SfxTabPage::dispose(); } void SvxGradientTabPage::Construct() { - m_pGradientLB->FillPresetListBox( *m_pGradientList ); + m_xGradientLB->FillPresetListBox( *m_pGradientList ); } void SvxGradientTabPage::ActivatePage( const SfxItemSet& rSet ) @@ -201,8 +176,8 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& rSet ) sal_Int32 nPos = SearchGradientList( rSet.Get(XATTR_FILLGRADIENT).GetName() ); if ( nPos != LISTBOX_ENTRY_NOTFOUND ) { - sal_uInt16 nId = m_pGradientLB->GetItemId( static_cast<size_t>( nPos ) ); - m_pGradientLB->SelectItem( nId ); + sal_uInt16 nId = m_xGradientLB->GetItemId( static_cast<size_t>( nPos ) ); + m_xGradientLB->SelectItem( nId ); } // colors could have been deleted ChangeGradientHdl_Impl(); @@ -222,31 +197,31 @@ bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet ) { std::unique_ptr<XGradient> pXGradient; OUString aString; - size_t nPos = m_pGradientLB->IsNoSelection() ? VALUESET_ITEM_NOTFOUND : m_pGradientLB->GetSelectItemPos(); + size_t nPos = m_xGradientLB->IsNoSelection() ? VALUESET_ITEM_NOTFOUND : m_xGradientLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { pXGradient.reset(new XGradient( m_pGradientList->GetGradient( static_cast<sal_uInt16>(nPos) )->GetGradient() )); - aString = m_pGradientLB->GetItemText( m_pGradientLB->GetSelectedItemId() ); + aString = m_xGradientLB->GetItemText( m_xGradientLB->GetSelectedItemId() ); } else // gradient was passed (unidentified) { aString = "gradient"; - pXGradient.reset(new XGradient( m_pLbColorFrom->GetSelectEntryColor(), - m_pLbColorTo->GetSelectEntryColor(), - static_cast<css::awt::GradientStyle>(m_pLbGradientType->GetSelectedEntryPos()), - static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource - static_cast<sal_uInt16>(m_pMtrCenterX->GetValue()), - static_cast<sal_uInt16>(m_pMtrCenterY->GetValue()), - static_cast<sal_uInt16>(m_pMtrBorder->GetValue()), - static_cast<sal_uInt16>(m_pMtrColorFrom->GetValue()), - static_cast<sal_uInt16>(m_pMtrColorTo->GetValue()), - static_cast<sal_uInt16>(m_pMtrIncrement->GetValue()) )); + pXGradient.reset(new XGradient( m_xLbColorFrom->GetSelectEntryColor(), + m_xLbColorTo->GetSelectEntryColor(), + static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()), + static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10), // should be changed in resource + static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrBorder->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrIncrement->get_value()) )); } sal_uInt16 nValue = 0; - if( !m_pCbIncrement->IsChecked() ) - nValue = m_pMtrIncrement->GetValue(); + if (!m_xCbIncrement->get_active()) + nValue = m_xMtrIncrement->get_value(); assert( pXGradient && "XGradient could not be created" ); rSet->Put( XFillStyleItem( drawing::FillStyle_GRADIENT ) ); @@ -255,109 +230,111 @@ bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet ) return true; } - void SvxGradientTabPage::Reset( const SfxItemSet* ) { - m_pMtrIncrement->SetValue(DEFAULT_GRADIENTSTEP); - m_pSliderIncrement->SetThumbPos(DEFAULT_GRADIENTSTEP); + m_xMtrIncrement->set_value(DEFAULT_GRADIENTSTEP); + m_xSliderIncrement->set_value(DEFAULT_GRADIENTSTEP); ChangeGradientHdl_Impl(); // determine state of the buttons if( m_pGradientList->Count() ) - m_pBtnModify->Enable(); + m_xBtnModify->set_sensitive(true); else - m_pBtnModify->Disable(); + m_xBtnModify->set_sensitive(false); } - VclPtr<SfxTabPage> SvxGradientTabPage::Create( TabPageParent pWindow, const SfxItemSet* rOutAttrs ) { - return VclPtr<SvxGradientTabPage>::Create( pWindow.pParent, *rOutAttrs ); + return VclPtr<SvxGradientTabPage>::Create(pWindow, *rOutAttrs); } -IMPL_LINK( SvxGradientTabPage, ModifiedListBoxHdl_Impl, ListBox&, rListBox, void ) +IMPL_LINK( SvxGradientTabPage, ModifiedListBoxHdl_Impl, weld::ComboBoxText&, rListBox, void ) { ModifiedHdl_Impl(&rListBox); // gradient params changed, it is no longer one of the presets - m_pGradientLB->SetNoSelection(); + m_xGradientLB->SetNoSelection(); } -IMPL_LINK( SvxGradientTabPage, ModifiedColorListBoxHdl_Impl, SvxColorListBox&, rListBox, void ) +IMPL_LINK( SvxGradientTabPage, ModifiedColorListBoxHdl_Impl, ColorListBox&, rListBox, void ) { ModifiedHdl_Impl(&rListBox); - m_pGradientLB->SetNoSelection(); + m_xGradientLB->SetNoSelection(); } -IMPL_LINK( SvxGradientTabPage, ModifiedEditHdl_Impl, Edit&, rBox, void ) +IMPL_LINK( SvxGradientTabPage, ModifiedEditHdl_Impl, weld::SpinButton&, rBox, void ) { ModifiedHdl_Impl(&rBox); - m_pGradientLB->SetNoSelection(); + m_xGradientLB->SetNoSelection(); } -IMPL_LINK( SvxGradientTabPage, ModifiedSliderHdl_Impl, Slider*, rSlider, void ) +IMPL_LINK( SvxGradientTabPage, ModifiedMetricHdl_Impl, weld::MetricSpinButton&, rBox, void ) { - ModifiedHdl_Impl(rSlider); - m_pGradientLB->SetNoSelection(); + ModifiedHdl_Impl(&rBox); + m_xGradientLB->SetNoSelection(); } -IMPL_LINK_NOARG( SvxGradientTabPage, ChangeAutoStepHdl_Impl, CheckBox&, void ) +IMPL_LINK( SvxGradientTabPage, ModifiedSliderHdl_Impl, weld::Scale&, rSlider, void ) { - if(m_pCbIncrement->IsChecked()) + ModifiedHdl_Impl(&rSlider); + m_xGradientLB->SetNoSelection(); +} + +IMPL_LINK_NOARG( SvxGradientTabPage, ChangeAutoStepHdl_Impl, weld::ToggleButton&, void ) +{ + if (m_xCbIncrement->get_active()) { - m_pSliderIncrement->Disable(); - m_pMtrIncrement->Disable(); + m_xSliderIncrement->set_sensitive(false); + m_xMtrIncrement->set_sensitive(false); } else { - m_pSliderIncrement->Enable(); - m_pMtrIncrement->Enable(); + m_xSliderIncrement->set_sensitive(true); + m_xMtrIncrement->set_sensitive(true); } - ModifiedHdl_Impl(m_pMtrIncrement); + ModifiedHdl_Impl(m_xMtrIncrement.get()); } void SvxGradientTabPage::ModifiedHdl_Impl( void const * pControl ) { - if( pControl == m_pMtrBorder ) - m_pSliderBorder->SetThumbPos( m_pMtrBorder->GetValue() ); - if( pControl == m_pSliderBorder ) - m_pMtrBorder->SetValue( m_pSliderBorder->GetThumbPos() ); - if( pControl == m_pMtrIncrement ) - m_pSliderIncrement->SetThumbPos( m_pMtrIncrement->GetValue() ); - if(pControl == m_pSliderIncrement) - m_pMtrIncrement->SetValue( m_pSliderIncrement->GetThumbPos() ); - - css::awt::GradientStyle eXGS = static_cast<css::awt::GradientStyle>(m_pLbGradientType->GetSelectedEntryPos()); - - XGradient aXGradient( m_pLbColorFrom->GetSelectEntryColor(), - m_pLbColorTo->GetSelectEntryColor(), + if (pControl == m_xMtrBorder.get()) + m_xSliderBorder->set_value(m_xMtrBorder->get_value(FUNIT_NONE)); + if (pControl == m_xSliderBorder.get()) + m_xMtrBorder->set_value(m_xSliderBorder->get_value(), FUNIT_NONE); + if (pControl == m_xMtrIncrement.get()) + m_xSliderIncrement->set_value(m_xMtrIncrement->get_value()); + if (pControl == m_xSliderIncrement.get()) + m_xMtrIncrement->set_value(m_xSliderIncrement->get_value()); + + css::awt::GradientStyle eXGS = static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()); + + XGradient aXGradient( m_xLbColorFrom->GetSelectEntryColor(), + m_xLbColorTo->GetSelectEntryColor(), eXGS, - static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource - static_cast<sal_uInt16>(m_pMtrCenterX->GetValue()), - static_cast<sal_uInt16>(m_pMtrCenterY->GetValue()), - static_cast<sal_uInt16>(m_pMtrBorder->GetValue()), - static_cast<sal_uInt16>(m_pMtrColorFrom->GetValue()), - static_cast<sal_uInt16>(m_pMtrColorTo->GetValue()), - static_cast<sal_uInt16>(m_pMtrIncrement->GetValue()) ); + static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10), // should be changed in resource + static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrBorder->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrIncrement->get_value()) ); // enable/disable controls - if( pControl == m_pLbGradientType || pControl == this ) + if (pControl == m_xLbGradientType.get() || pControl == this) SetControlState_Impl( eXGS ); sal_uInt16 nValue = 0; - if(!m_pCbIncrement->IsChecked()) - nValue = static_cast<sal_uInt16>(m_pMtrIncrement->GetValue()); + if (!m_xCbIncrement->get_active()) + nValue = static_cast<sal_uInt16>(m_xMtrIncrement->get_value()); m_rXFSet.Put( XGradientStepCountItem( nValue ) ); // displaying in XOutDev m_rXFSet.Put( XFillGradientItem( OUString(), aXGradient ) ); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - - m_pCtlPreview->Invalidate(); + m_aCtlPreview.SetAttributes(m_aXFillAttr.GetItemSet()); + m_aCtlPreview.Invalidate(); } - -IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, weld::Button&, void) { OUString aNewName( SvxResId( RID_SVXSTR_GRADIENT ) ); OUString aDesc( CuiResId( RID_SVXSTR_DESC_GRADIENT ) ); @@ -374,7 +351,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void) } SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc)); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc)); sal_uInt16 nError = 1; while (pDlg->Execute() == RET_OK) @@ -389,7 +366,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void) break; } - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog")); if (xWarnBox->run() != RET_OK) break; @@ -398,24 +375,24 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void) if( !nError ) { - XGradient aXGradient( m_pLbColorFrom->GetSelectEntryColor(), - m_pLbColorTo->GetSelectEntryColor(), - static_cast<css::awt::GradientStyle>(m_pLbGradientType->GetSelectedEntryPos()), - static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource - static_cast<sal_uInt16>(m_pMtrCenterX->GetValue()), - static_cast<sal_uInt16>(m_pMtrCenterY->GetValue()), - static_cast<sal_uInt16>(m_pMtrBorder->GetValue()), - static_cast<sal_uInt16>(m_pMtrColorFrom->GetValue()), - static_cast<sal_uInt16>(m_pMtrColorTo->GetValue()), - static_cast<sal_uInt16>(m_pMtrIncrement->GetValue()) ); + XGradient aXGradient( m_xLbColorFrom->GetSelectEntryColor(), + m_xLbColorTo->GetSelectEntryColor(), + static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()), + static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10), // should be changed in resource + static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrBorder->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrIncrement->get_value()) ); m_pGradientList->Insert(o3tl::make_unique<XGradientEntry>(aXGradient, aName), nCount); - sal_Int32 nId = m_pGradientLB->GetItemId(nCount - 1); //calculate the last ID - BitmapEx aBitmap = m_pGradientList->GetBitmapForPreview( nCount, m_pGradientLB->GetIconSize() ); - m_pGradientLB->InsertItem( nId + 1, Image(aBitmap), aName ); - m_pGradientLB->SelectItem( nId + 1 ); - m_pGradientLB->Resize(); + sal_Int32 nId = m_xGradientLB->GetItemId(nCount - 1); //calculate the last ID + BitmapEx aBitmap = m_pGradientList->GetBitmapForPreview( nCount, m_xGradientLB->GetIconSize() ); + m_xGradientLB->InsertItem( nId + 1, Image(aBitmap), aName ); + m_xGradientLB->SelectItem( nId + 1 ); + m_xGradientLB->Resize(); *m_pnGradientListState |= ChangeType::MODIFIED; @@ -423,60 +400,60 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void) } // determine button state - if( m_pGradientList->Count() ) - m_pBtnModify->Enable(); + if (m_pGradientList->Count()) + m_xBtnModify->set_sensitive(true); } -IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl, weld::Button&, void) { - sal_uInt16 nId = m_pGradientLB->GetSelectedItemId(); - size_t nPos = m_pGradientLB->GetSelectItemPos(); + sal_uInt16 nId = m_xGradientLB->GetSelectedItemId(); + size_t nPos = m_xGradientLB->GetSelectItemPos(); if ( nPos != VALUESET_ITEM_NOTFOUND ) { OUString aName( m_pGradientList->GetGradient( static_cast<sal_uInt16>(nPos) )->GetName() ); - XGradient aXGradient( m_pLbColorFrom->GetSelectEntryColor(), - m_pLbColorTo->GetSelectEntryColor(), - static_cast<css::awt::GradientStyle>(m_pLbGradientType->GetSelectedEntryPos()), - static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource - static_cast<sal_uInt16>(m_pMtrCenterX->GetValue()), - static_cast<sal_uInt16>(m_pMtrCenterY->GetValue()), - static_cast<sal_uInt16>(m_pMtrBorder->GetValue()), - static_cast<sal_uInt16>(m_pMtrColorFrom->GetValue()), - static_cast<sal_uInt16>(m_pMtrColorTo->GetValue()), - static_cast<sal_uInt16>(m_pMtrIncrement->GetValue()) ); + XGradient aXGradient( m_xLbColorFrom->GetSelectEntryColor(), + m_xLbColorTo->GetSelectEntryColor(), + static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()), + static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10), // should be changed in resource + static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrBorder->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FUNIT_NONE)), + static_cast<sal_uInt16>(m_xMtrIncrement->get_value()) ); m_pGradientList->Replace(o3tl::make_unique<XGradientEntry>(aXGradient, aName), nPos); - BitmapEx aBitmap = m_pGradientList->GetBitmapForPreview( static_cast<sal_uInt16>(nPos), m_pGradientLB->GetIconSize() ); - m_pGradientLB->RemoveItem( nId ); - m_pGradientLB->InsertItem( nId, Image(aBitmap), aName, static_cast<sal_uInt16>(nPos) ); - m_pGradientLB->SelectItem( nId ); + BitmapEx aBitmap = m_pGradientList->GetBitmapForPreview( static_cast<sal_uInt16>(nPos), m_xGradientLB->GetIconSize() ); + m_xGradientLB->RemoveItem( nId ); + m_xGradientLB->InsertItem( nId, Image(aBitmap), aName, static_cast<sal_uInt16>(nPos) ); + m_xGradientLB->SelectItem( nId ); *m_pnGradientListState |= ChangeType::MODIFIED; } } -IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void) +IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl, PresetListBox*, void) { - sal_uInt16 nId = m_pGradientLB->GetSelectedItemId(); - size_t nPos = m_pGradientLB->GetSelectItemPos(); + sal_uInt16 nId = m_xGradientLB->GetSelectedItemId(); + size_t nPos = m_xGradientLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletegradientdialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/querydeletegradientdialog.ui")); std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelGradientDialog")); if (xQueryBox->run() == RET_YES) { m_pGradientList->Remove(nPos); - m_pGradientLB->RemoveItem( nId ); - nId = m_pGradientLB->GetItemId( 0 ); - m_pGradientLB->SelectItem( nId ); - m_pGradientLB->Resize(); + m_xGradientLB->RemoveItem( nId ); + nId = m_xGradientLB->GetItemId( 0 ); + m_xGradientLB->SelectItem( nId ); + m_xGradientLB->Resize(); - m_pCtlPreview->Invalidate(); + m_aCtlPreview.Invalidate(); ChangeGradientHdl_Impl(); @@ -485,13 +462,13 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void } // determine button state if( !m_pGradientList->Count() ) - m_pBtnModify->Disable(); + m_xBtnModify->set_sensitive(false); } -IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void) +IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, PresetListBox*, void) { - sal_uInt16 nId = m_pGradientLB->GetSelectedItemId(); - size_t nPos = m_pGradientLB->GetSelectItemPos(); + sal_uInt16 nId = m_xGradientLB->GetSelectedItemId(); + size_t nPos = m_xGradientLB->GetSelectItemPos(); if ( nPos != VALUESET_ITEM_NOTFOUND ) { @@ -499,7 +476,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void OUString aName( m_pGradientList->GetGradient( nPos )->GetName() ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc)); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc)); bool bLoop = true; while( bLoop && pDlg->Execute() == RET_OK ) @@ -513,14 +490,14 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void bLoop = false; m_pGradientList->GetGradient(nPos)->SetName(aName); - m_pGradientLB->SetItemText( nId, aName ); - m_pGradientLB->SelectItem( nId ); + m_xGradientLB->SetItemText( nId, aName ); + m_xGradientLB->SelectItem( nId ); *m_pnGradientListState |= ChangeType::MODIFIED; } else { - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog")); xBox->run(); } @@ -528,7 +505,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void } } -IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl, ValueSet*, void) +IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl, SvtValueSet*, void) { ChangeGradientHdl_Impl(); } @@ -536,7 +513,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl, ValueSet*, void) void SvxGradientTabPage::ChangeGradientHdl_Impl() { std::unique_ptr<XGradient> pGradient; - size_t nPos = m_pGradientLB->GetSelectItemPos(); + size_t nPos = m_xGradientLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) pGradient.reset(new XGradient( m_pGradientList->GetGradient( static_cast<sal_uInt16>( nPos ) )->GetGradient() )); @@ -553,8 +530,8 @@ void SvxGradientTabPage::ChangeGradientHdl_Impl() } if( !pGradient ) { - sal_uInt16 nPosition = m_pGradientLB->GetItemId(0); - m_pGradientLB->SelectItem( nPosition ); + sal_uInt16 nPosition = m_xGradientLB->GetItemId(0); + m_xGradientLB->SelectItem( nPosition ); if( nPosition != 0 ) pGradient.reset(new XGradient( m_pGradientList->GetGradient( 0 )->GetGradient() )); } @@ -566,35 +543,35 @@ void SvxGradientTabPage::ChangeGradientHdl_Impl() sal_uInt16 nValue = pGradient->GetSteps(); if( nValue == 0 ) { - m_pCbIncrement->SetState(TRISTATE_TRUE); - m_pMtrIncrement->Disable(); - m_pSliderIncrement->Disable(); + m_xCbIncrement->set_state(TRISTATE_TRUE); + m_xMtrIncrement->set_sensitive(false); + m_xSliderIncrement->set_sensitive(false); } else { - m_pCbIncrement->SetState(TRISTATE_FALSE); - m_pMtrIncrement->Enable(); - m_pMtrIncrement->SetValue( nValue ); - m_pSliderIncrement->Enable(); - m_pSliderIncrement->SetThumbPos( nValue ); + m_xCbIncrement->set_state(TRISTATE_FALSE); + m_xMtrIncrement->set_sensitive(true); + m_xMtrIncrement->set_value( nValue ); + m_xSliderIncrement->set_sensitive(true); + m_xSliderIncrement->set_value(nValue); } - m_pLbGradientType->SelectEntryPos( + m_xLbGradientType->set_active( sal::static_int_cast< sal_Int32 >( eXGS ) ); // if the entry is not in the listbox, // colors are added temporarily - m_pLbColorFrom->SetNoSelection(); - m_pLbColorFrom->SelectEntry( pGradient->GetStartColor() ); + m_xLbColorFrom->SetNoSelection(); + m_xLbColorFrom->SelectEntry( pGradient->GetStartColor() ); - m_pLbColorTo->SetNoSelection(); - m_pLbColorTo->SelectEntry( pGradient->GetEndColor() ); + m_xLbColorTo->SetNoSelection(); + m_xLbColorTo->SelectEntry( pGradient->GetEndColor() ); - m_pMtrAngle->SetValue( pGradient->GetAngle() / 10 ); // should be changed in resource - m_pMtrBorder->SetValue( pGradient->GetBorder() ); - m_pSliderBorder->SetThumbPos( pGradient->GetBorder() ); - m_pMtrCenterX->SetValue( pGradient->GetXOffset() ); - m_pMtrCenterY->SetValue( pGradient->GetYOffset() ); - m_pMtrColorFrom->SetValue( pGradient->GetStartIntens() ); - m_pMtrColorTo->SetValue( pGradient->GetEndIntens() ); + m_xMtrAngle->set_value(pGradient->GetAngle() / 10, FUNIT_NONE); // should be changed in resource + m_xMtrBorder->set_value(pGradient->GetBorder(), FUNIT_NONE); + m_xSliderBorder->set_value(pGradient->GetBorder()); + m_xMtrCenterX->set_value(pGradient->GetXOffset(), FUNIT_NONE); + m_xMtrCenterY->set_value(pGradient->GetYOffset(), FUNIT_NONE); + m_xMtrColorFrom->set_value(pGradient->GetStartIntens(), FUNIT_NONE); + m_xMtrColorTo->set_value(pGradient->GetEndIntens(), FUNIT_NONE); // disable/enable controls SetControlState_Impl( eXGS ); @@ -602,49 +579,48 @@ void SvxGradientTabPage::ChangeGradientHdl_Impl() // fill ItemSet and pass it on to aCtlPreview m_rXFSet.Put( XFillGradientItem( OUString(), *pGradient ) ); m_rXFSet.Put( XGradientStepCountItem( nValue ) ); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlPreview.SetAttributes(m_aXFillAttr.GetItemSet()); - m_pCtlPreview->Invalidate(); + m_aCtlPreview.Invalidate(); } } - void SvxGradientTabPage::SetControlState_Impl( css::awt::GradientStyle eXGS ) { switch( eXGS ) { case css::awt::GradientStyle_LINEAR: case css::awt::GradientStyle_AXIAL: - m_pFtCenter->Disable(); - m_pMtrCenterX->Disable(); - m_pMtrCenterY->Disable(); - m_pFtAngle->Enable(); - m_pMtrAngle->Enable(); + m_xFtCenter->set_sensitive(false); + m_xMtrCenterX->set_sensitive(false); + m_xMtrCenterY->set_sensitive(false); + m_xFtAngle->set_sensitive(true); + m_xMtrAngle->set_sensitive(true); break; case css::awt::GradientStyle_RADIAL: - m_pFtCenter->Enable(); - m_pMtrCenterX->Enable(); - m_pMtrCenterY->Enable(); - m_pFtAngle->Disable(); - m_pMtrAngle->Disable(); + m_xFtCenter->set_sensitive(true); + m_xMtrCenterX->set_sensitive(true); + m_xMtrCenterY->set_sensitive(true); + m_xFtAngle->set_sensitive(false); + m_xMtrAngle->set_sensitive(false); break; case css::awt::GradientStyle_ELLIPTICAL: - m_pFtCenter->Enable(); - m_pMtrCenterX->Enable(); - m_pMtrCenterY->Enable(); - m_pFtAngle->Enable(); - m_pMtrAngle->Enable(); + m_xFtCenter->set_sensitive(true); + m_xMtrCenterX->set_sensitive(true); + m_xMtrCenterY->set_sensitive(true); + m_xFtAngle->set_sensitive(true); + m_xMtrAngle->set_sensitive(true); break; case css::awt::GradientStyle_SQUARE: case css::awt::GradientStyle_RECT: - m_pFtCenter->Enable(); - m_pMtrCenterX->Enable(); - m_pMtrCenterY->Enable(); - m_pFtAngle->Enable(); - m_pMtrAngle->Enable(); + m_xFtCenter->set_sensitive(true); + m_xMtrCenterX->set_sensitive(true); + m_xMtrCenterY->set_sensitive(true); + m_xFtAngle->set_sensitive(true); + m_xMtrAngle->set_sensitive(true); break; default: break; diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index a51ceabe8378..110df65ceecd 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -49,36 +49,29 @@ using namespace com::sun::star; -SvxHatchTabPage::SvxHatchTabPage -( - vcl::Window* pParent, - const SfxItemSet& rInAttrs -) : - - SvxTabPage ( pParent, "HatchPage", "cui/ui/hatchpage.ui", rInAttrs ), - - m_rOutAttrs ( rInAttrs ), - m_pnHatchingListState ( nullptr ), - m_pnColorListState ( nullptr ), - m_aXFillAttr ( rInAttrs.GetPool() ), - m_rXFSet ( m_aXFillAttr.GetItemSet() ) +SvxHatchTabPage::SvxHatchTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs) + : SvxTabPage(pParent, "cui/ui/hatchpage.ui", "HatchPage", rInAttrs) + , m_rOutAttrs(rInAttrs) + , m_pnHatchingListState(nullptr) + , m_pnColorListState(nullptr) + , m_aXFillAttr(rInAttrs.GetPool()) + , m_rXFSet(m_aXFillAttr.GetItemSet()) + , m_xMtrDistance(m_xBuilder->weld_metric_spin_button("distancemtr", FUNIT_MM)) + , m_xMtrAngle(m_xBuilder->weld_metric_spin_button("anglemtr", FUNIT_DEGREE)) + , m_xSliderAngle(m_xBuilder->weld_scale("angleslider")) + , m_xLbLineType(m_xBuilder->weld_combo_box_text("linetypelb")) + , m_xLbLineColor(new ColorListBox(m_xBuilder->weld_menu_button("linecolorlb"), GetFrameWeld())) + , m_xCbBackgroundColor(m_xBuilder->weld_check_button("backgroundcolor")) + , m_xLbBackgroundColor(new ColorListBox(m_xBuilder->weld_menu_button("backgroundcolorlb"), GetFrameWeld())) + , m_xHatchLB(new PresetListBox(m_xBuilder->weld_scrolled_window("hatchpresetlistwin"))) + , m_xBtnAdd(m_xBuilder->weld_button("add")) + , m_xBtnModify(m_xBuilder->weld_button("modify")) + , m_xHatchLBWin(new weld::CustomWeld(*m_xBuilder, "hatchpresetlist", *m_xHatchLB)) + , m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "previewctl", m_aCtlPreview)) { - get(m_pMtrDistance, "distancemtr"); - get(m_pMtrAngle, "anglemtr"); - get(m_pSliderAngle, "angleslider"); - get(m_pLbLineType, "linetypelb"); - get(m_pLbLineColor, "linecolorlb"); - get(m_pCbBackgroundColor, "backgroundcolor"); - get(m_pLbBackgroundColor, "backgroundcolorlb"); - get(m_pHatchLB , "hatchpresetlist"); - get(m_pCtlPreview, "previewctl"); Size aSize = getDrawPreviewOptimalSize(this); - m_pHatchLB->set_width_request(aSize.Width()); - m_pHatchLB->set_height_request(aSize.Height()); - m_pCtlPreview->set_width_request(aSize.Width()); - m_pCtlPreview->set_height_request(aSize.Height()); - get(m_pBtnAdd, "add"); - get(m_pBtnModify, "modify"); + m_xHatchLBWin->set_size_request(aSize.Width(), aSize.Height()); + m_xCtlPreview->set_size_request(aSize.Width(), aSize.Height()); // this page needs ExchangeSupport SetExchangeSupport(); @@ -94,7 +87,7 @@ SvxHatchTabPage::SvxHatchTabPage break; default: ;//prevent warning } - SetFieldUnit( *m_pMtrDistance, eFUnit ); + SetFieldUnit( *m_xMtrDistance, eFUnit ); // determine PoolUnit SfxItemPool* pPool = m_rOutAttrs.GetPool(); @@ -104,27 +97,26 @@ SvxHatchTabPage::SvxHatchTabPage // setting the output device m_rXFSet.Put( XFillStyleItem(drawing::FillStyle_HATCH) ); m_rXFSet.Put( XFillHatchItem(OUString(), XHatch()) ); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pHatchLB->SetSelectHdl( LINK( this, SvxHatchTabPage, ChangeHatchHdl ) ); - m_pHatchLB->SetRenameHdl( LINK( this, SvxHatchTabPage, ClickRenameHdl_Impl ) ); - m_pHatchLB->SetDeleteHdl( LINK( this, SvxHatchTabPage, ClickDeleteHdl_Impl ) ); - - Link<Edit&,void> aLink = LINK( this, SvxHatchTabPage, ModifiedEditHdl_Impl ); - Link<ListBox&,void> aLink2 = LINK( this, SvxHatchTabPage, ModifiedListBoxHdl_Impl ); - m_pMtrDistance->SetModifyHdl( aLink ); - m_pMtrAngle->SetModifyHdl( aLink ); - m_pSliderAngle->SetSlideHdl( LINK( this, SvxHatchTabPage, ModifiedSliderHdl_Impl ) ); - m_pLbLineType->SetSelectHdl( aLink2 ); - Link<SvxColorListBox&,void> aLink3 = LINK( this, SvxHatchTabPage, ModifiedColorListBoxHdl_Impl ); - m_pLbLineColor->SetSelectHdl( aLink3 ); - m_pCbBackgroundColor->SetToggleHdl( LINK( this, SvxHatchTabPage, ToggleHatchBackgroundColor_Impl ) ); - m_pLbBackgroundColor->SetSelectHdl( LINK( this, SvxHatchTabPage, ModifiedBackgroundHdl_Impl ) ); - - m_pBtnAdd->SetClickHdl( LINK( this, SvxHatchTabPage, ClickAddHdl_Impl ) ); - m_pBtnModify->SetClickHdl( LINK( this, SvxHatchTabPage, ClickModifyHdl_Impl ) ); - - m_pCtlPreview->SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); - + m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_xHatchLB->SetSelectHdl( LINK( this, SvxHatchTabPage, ChangeHatchHdl ) ); + m_xHatchLB->SetRenameHdl( LINK( this, SvxHatchTabPage, ClickRenameHdl_Impl ) ); + m_xHatchLB->SetDeleteHdl( LINK( this, SvxHatchTabPage, ClickDeleteHdl_Impl ) ); + + Link<weld::MetricSpinButton&,void> aLink = LINK( this, SvxHatchTabPage, ModifiedEditHdl_Impl ); + Link<weld::ComboBoxText&,void> aLink2 = LINK( this, SvxHatchTabPage, ModifiedListBoxHdl_Impl ); + m_xMtrDistance->connect_value_changed( aLink ); + m_xMtrAngle->connect_value_changed( aLink ); + m_xSliderAngle->connect_value_changed(LINK(this, SvxHatchTabPage, ModifiedSliderHdl_Impl)); + m_xLbLineType->connect_changed( aLink2 ); + Link<ColorListBox&,void> aLink3 = LINK( this, SvxHatchTabPage, ModifiedColorListBoxHdl_Impl ); + m_xLbLineColor->SetSelectHdl( aLink3 ); + m_xCbBackgroundColor->connect_toggled( LINK( this, SvxHatchTabPage, ToggleHatchBackgroundColor_Impl ) ); + m_xLbBackgroundColor->SetSelectHdl( LINK( this, SvxHatchTabPage, ModifiedBackgroundHdl_Impl ) ); + + m_xBtnAdd->connect_clicked( LINK( this, SvxHatchTabPage, ClickAddHdl_Impl ) ); + m_xBtnModify->connect_clicked( LINK( this, SvxHatchTabPage, ClickModifyHdl_Impl ) ); + + m_aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); } SvxHatchTabPage::~SvxHatchTabPage() @@ -134,23 +126,17 @@ SvxHatchTabPage::~SvxHatchTabPage() void SvxHatchTabPage::dispose() { - m_pMtrDistance.clear(); - m_pMtrAngle.clear(); - m_pSliderAngle.clear(); - m_pLbLineType.clear(); - m_pLbLineColor.clear(); - m_pCbBackgroundColor.clear(); - m_pLbBackgroundColor.clear(); - m_pHatchLB.clear(); - m_pCtlPreview.clear(); - m_pBtnAdd.clear(); - m_pBtnModify.clear(); + m_xCtlPreview.reset(); + m_xHatchLBWin.reset(); + m_xHatchLB.reset(); + m_xLbBackgroundColor.reset(); + m_xLbLineColor.reset(); SvxTabPage::dispose(); } void SvxHatchTabPage::Construct() { - m_pHatchLB->FillPresetListBox(*m_pHatchingList); + m_xHatchLB->FillPresetListBox(*m_pHatchingList); } void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet ) @@ -188,8 +174,8 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet ) sal_Int32 nPos = SearchHatchList( rSet.Get(XATTR_FILLHATCH).GetName() ); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - sal_uInt16 nId = m_pHatchLB->GetItemId( static_cast<size_t>( nPos ) ); - m_pHatchLB->SelectItem( nId ); + sal_uInt16 nId = m_xHatchLB->GetItemId( static_cast<size_t>( nPos ) ); + m_xHatchLB->SelectItem( nId ); } // colors could have been deleted ChangeHatchHdl_Impl(); @@ -200,24 +186,23 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet ) if(aBckItem.GetValue()) { - m_pCbBackgroundColor->SetState(TRISTATE_TRUE); + m_xCbBackgroundColor->set_state(TRISTATE_TRUE); XFillColorItem aColorItem( rSet.Get(XATTR_FILLCOLOR) ); Color aColor(aColorItem.GetColorValue()); - m_pLbBackgroundColor->Enable(); - m_pLbBackgroundColor->SelectEntry(aColor); + m_xLbBackgroundColor->set_sensitive(true); + m_xLbBackgroundColor->SelectEntry(aColor); m_rXFSet.Put( aColorItem ); } else { - m_pCbBackgroundColor->SetState(TRISTATE_FALSE); - m_pLbBackgroundColor->Disable(); + m_xCbBackgroundColor->set_state(TRISTATE_FALSE); + m_xLbBackgroundColor->set_sensitive(false); } - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); + m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlPreview.Invalidate(); } - DeactivateRC SvxHatchTabPage::DeactivatePage( SfxItemSet* _pSet ) { if( _pSet ) @@ -226,7 +211,6 @@ DeactivateRC SvxHatchTabPage::DeactivatePage( SfxItemSet* _pSet ) return DeactivateRC::LeavePage; } - sal_Int32 SvxHatchTabPage::SearchHatchList(const OUString& rHatchName) { long nCount = m_pHatchingList->Count(); @@ -248,128 +232,127 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet ) { std::unique_ptr<XHatch> pXHatch; OUString aString; - size_t nPos = m_pHatchLB->IsNoSelection() ? VALUESET_ITEM_NOTFOUND : m_pHatchLB->GetSelectItemPos(); + size_t nPos = m_xHatchLB->IsNoSelection() ? VALUESET_ITEM_NOTFOUND : m_xHatchLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { pXHatch.reset(new XHatch( m_pHatchingList->GetHatch( static_cast<sal_uInt16>(nPos) )->GetHatch() )); - aString = m_pHatchLB->GetItemText( m_pHatchLB->GetSelectedItemId() ); + aString = m_xHatchLB->GetItemText( m_xHatchLB->GetSelectedItemId() ); } // unidentified hatch has been passed else { - pXHatch.reset(new XHatch( m_pLbLineColor->GetSelectEntryColor(), - static_cast<css::drawing::HatchStyle>(m_pLbLineType->GetSelectedEntryPos()), - GetCoreValue( *m_pMtrDistance, m_ePoolUnit ), - static_cast<long>(m_pMtrAngle->GetValue() * 10) )); + pXHatch.reset(new XHatch( m_xLbLineColor->GetSelectEntryColor(), + static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()), + GetCoreValue( *m_xMtrDistance, m_ePoolUnit ), + static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10) )); } assert( pXHatch && "XHatch couldn't be created" ); rSet->Put( XFillStyleItem( drawing::FillStyle_HATCH ) ); rSet->Put( XFillHatchItem( aString, *pXHatch ) ); - rSet->Put( XFillBackgroundItem( m_pCbBackgroundColor->IsChecked() ) ); - if (m_pCbBackgroundColor->IsChecked()) + rSet->Put( XFillBackgroundItem( m_xCbBackgroundColor->get_active() ) ); + if (m_xCbBackgroundColor->get_active()) { - NamedColor aColor = m_pLbBackgroundColor->GetSelectedEntry(); + NamedColor aColor = m_xLbBackgroundColor->GetSelectedEntry(); rSet->Put(XFillColorItem(aColor.second, aColor.first)); } return true; } - void SvxHatchTabPage::Reset( const SfxItemSet* rSet ) { ChangeHatchHdl_Impl(); XFillBackgroundItem aBckItem( rSet->Get(XATTR_FILLBACKGROUND) ); if(aBckItem.GetValue()) - m_pCbBackgroundColor->SetState(TRISTATE_TRUE); + m_xCbBackgroundColor->set_state(TRISTATE_TRUE); else - m_pCbBackgroundColor->SetState(TRISTATE_FALSE); + m_xCbBackgroundColor->set_state(TRISTATE_FALSE); m_rXFSet.Put( aBckItem ); XFillColorItem aColItem( rSet->Get(XATTR_FILLCOLOR) ); - m_pLbBackgroundColor->SelectEntry(aColItem.GetColorValue()); + m_xLbBackgroundColor->SelectEntry(aColItem.GetColorValue()); m_rXFSet.Put( aColItem ); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); + m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlPreview.Invalidate(); } - VclPtr<SfxTabPage> SvxHatchTabPage::Create( TabPageParent pWindow, const SfxItemSet* rSet ) { - return VclPtr<SvxHatchTabPage>::Create( pWindow.pParent, *rSet ); + return VclPtr<SvxHatchTabPage>::Create(pWindow, *rSet); } -IMPL_LINK( SvxHatchTabPage, ModifiedListBoxHdl_Impl, ListBox&, rListBox, void ) +IMPL_LINK( SvxHatchTabPage, ModifiedListBoxHdl_Impl, weld::ComboBoxText&, rListBox, void ) { ModifiedHdl_Impl(&rListBox); // hatch params have changed, it is no longer one of the presets - m_pHatchLB->SetNoSelection(); + m_xHatchLB->SetNoSelection(); } -IMPL_LINK( SvxHatchTabPage, ModifiedColorListBoxHdl_Impl, SvxColorListBox&, rListBox, void ) +IMPL_LINK( SvxHatchTabPage, ModifiedColorListBoxHdl_Impl, ColorListBox&, rListBox, void ) { ModifiedHdl_Impl(&rListBox); - m_pHatchLB->SetNoSelection(); + m_xHatchLB->SetNoSelection(); } -IMPL_LINK_NOARG( SvxHatchTabPage, ToggleHatchBackgroundColor_Impl, CheckBox&, void ) +IMPL_LINK_NOARG( SvxHatchTabPage, ToggleHatchBackgroundColor_Impl, weld::ToggleButton&, void ) { - if(m_pCbBackgroundColor->IsChecked()) - m_pLbBackgroundColor->Enable(); + if (m_xCbBackgroundColor->get_active()) + m_xLbBackgroundColor->set_sensitive(true); else - m_pLbBackgroundColor->Disable(); - m_rXFSet.Put( XFillBackgroundItem( m_pCbBackgroundColor->IsChecked() ) ); - ModifiedBackgroundHdl_Impl(*m_pLbBackgroundColor); + m_xLbBackgroundColor->set_sensitive(false); + m_rXFSet.Put( XFillBackgroundItem( m_xCbBackgroundColor->get_active() ) ); + ModifiedBackgroundHdl_Impl(*m_xLbBackgroundColor); } -IMPL_LINK_NOARG( SvxHatchTabPage, ModifiedBackgroundHdl_Impl, SvxColorListBox&, void ) +IMPL_LINK_NOARG( SvxHatchTabPage, ModifiedBackgroundHdl_Impl, ColorListBox&, void ) { Color aColor(COL_TRANSPARENT); - if(m_pCbBackgroundColor->IsChecked()) + if (m_xCbBackgroundColor->get_active()) { - aColor = m_pLbBackgroundColor->GetSelectEntryColor(); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); + aColor = m_xLbBackgroundColor->GetSelectEntryColor(); + m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlPreview.Invalidate(); } m_rXFSet.Put(XFillColorItem( OUString(), aColor )); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); + m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlPreview.Invalidate(); } -IMPL_LINK( SvxHatchTabPage, ModifiedEditHdl_Impl, Edit&, rEdit, void ) +IMPL_LINK( SvxHatchTabPage, ModifiedEditHdl_Impl, weld::MetricSpinButton&, rEdit, void ) { ModifiedHdl_Impl(&rEdit); - m_pHatchLB->SetNoSelection(); + m_xHatchLB->SetNoSelection(); } -IMPL_LINK( SvxHatchTabPage, ModifiedSliderHdl_Impl, Slider*, rSlider, void ) +IMPL_LINK( SvxHatchTabPage, ModifiedSliderHdl_Impl, weld::Scale&, rSlider, void ) { - ModifiedHdl_Impl(rSlider); - m_pHatchLB->SetNoSelection(); + ModifiedHdl_Impl(&rSlider); + m_xHatchLB->SetNoSelection(); } + void SvxHatchTabPage::ModifiedHdl_Impl( void const * p ) { - if( p == m_pMtrAngle ) - m_pSliderAngle->SetThumbPos( m_pMtrAngle->GetValue() ); + if (p == m_xMtrAngle.get()) + m_xSliderAngle->set_value(m_xMtrAngle->get_value(FUNIT_NONE)); - if( p == m_pSliderAngle ) - m_pMtrAngle->SetValue( m_pSliderAngle->GetThumbPos() ); + if (p == m_xSliderAngle.get()) + m_xMtrAngle->set_value(m_xSliderAngle->get_value(), FUNIT_NONE); - XHatch aXHatch( m_pLbLineColor->GetSelectEntryColor(), - static_cast<css::drawing::HatchStyle>(m_pLbLineType->GetSelectedEntryPos()), - GetCoreValue( *m_pMtrDistance, m_ePoolUnit ), - static_cast<long>(m_pMtrAngle->GetValue() * 10) ); + XHatch aXHatch( m_xLbLineColor->GetSelectEntryColor(), + static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()), + GetCoreValue( *m_xMtrDistance, m_ePoolUnit ), + static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10) ); m_rXFSet.Put( XFillHatchItem( OUString(), aXHatch ) ); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); + m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlPreview.Invalidate(); } -IMPL_LINK_NOARG(SvxHatchTabPage, ChangeHatchHdl, ValueSet*, void) +IMPL_LINK_NOARG(SvxHatchTabPage, ChangeHatchHdl, SvtValueSet*, void) { ChangeHatchHdl_Impl(); } @@ -377,7 +360,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ChangeHatchHdl, ValueSet*, void) void SvxHatchTabPage::ChangeHatchHdl_Impl() { std::unique_ptr<XHatch> pHatch; - size_t nPos = m_pHatchLB->GetSelectItemPos(); + size_t nPos = m_xHatchLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) pHatch.reset(new XHatch( m_pHatchingList->GetHatch( static_cast<sal_uInt16>(nPos) )->GetHatch() )); @@ -394,38 +377,38 @@ void SvxHatchTabPage::ChangeHatchHdl_Impl() } if( !pHatch ) { - sal_uInt16 nPosition = m_pHatchLB->GetItemId( 0 ); - m_pHatchLB->SelectItem( nPosition ); + sal_uInt16 nPosition = m_xHatchLB->GetItemId( 0 ); + m_xHatchLB->SelectItem( nPosition ); if( nPosition != 0 ) pHatch.reset( new XHatch( m_pHatchingList->GetHatch( 0 )->GetHatch() ) ); } } if( pHatch ) { - m_pLbLineType->SelectEntryPos( + m_xLbLineType->set_active( sal::static_int_cast< sal_Int32 >( pHatch->GetHatchStyle() ) ); - m_pLbLineColor->SetNoSelection(); - m_pLbLineColor->SelectEntry( pHatch->GetColor() ); - SetMetricValue( *m_pMtrDistance, pHatch->GetDistance(), m_ePoolUnit ); + m_xLbLineColor->SetNoSelection(); + m_xLbLineColor->SelectEntry( pHatch->GetColor() ); + SetMetricValue( *m_xMtrDistance, pHatch->GetDistance(), m_ePoolUnit ); long mHatchAngle = pHatch->GetAngle() / 10; - m_pMtrAngle->SetValue( mHatchAngle ); - m_pSliderAngle->SetThumbPos( mHatchAngle ); + m_xMtrAngle->set_value(mHatchAngle, FUNIT_NONE); + m_xSliderAngle->set_value(mHatchAngle); - // fill ItemSet and pass it on to m_pCtlPreview + // fill ItemSet and pass it on to m_aCtlPreview m_rXFSet.Put( XFillHatchItem( OUString(), *pHatch ) ); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); + m_aCtlPreview.Invalidate(); pHatch.reset(); } - m_pMtrDistance->SaveValue(); - m_pMtrAngle->SaveValue(); - m_pLbLineType->SaveValue(); - m_pLbLineColor->SaveValue(); - m_pLbBackgroundColor->SaveValue(); + m_xMtrDistance->save_value(); + m_xMtrAngle->save_value(); + m_xLbLineType->save_value(); + m_xLbLineColor->SaveValue(); + m_xLbBackgroundColor->SaveValue(); } -IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, weld::Button&, void) { OUString aNewName( SvxResId( RID_SVXSTR_HATCH ) ); OUString aDesc( CuiResId( RID_SVXSTR_DESC_HATCH ) ); @@ -442,7 +425,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void) } SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc)); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc)); sal_uInt16 nError = 1; while( pDlg->Execute() == RET_OK ) @@ -456,7 +439,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void) break; } - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog")); if (xWarnBox->run() != RET_OK) break; @@ -465,19 +448,19 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void) if( !nError ) { - XHatch aXHatch( m_pLbLineColor->GetSelectEntryColor(), - static_cast<css::drawing::HatchStyle>(m_pLbLineType->GetSelectedEntryPos()), - GetCoreValue( *m_pMtrDistance, m_ePoolUnit ), - static_cast<long>(m_pMtrAngle->GetValue() * 10) ); + XHatch aXHatch( m_xLbLineColor->GetSelectEntryColor(), + static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()), + GetCoreValue( *m_xMtrDistance, m_ePoolUnit ), + static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10) ); m_pHatchingList->Insert(o3tl::make_unique<XHatchEntry>(aXHatch, aName), nCount); - sal_Int32 nId = m_pHatchLB->GetItemId(nCount - 1); // calculate the last ID - BitmapEx aBitmap = m_pHatchingList->GetBitmapForPreview( nCount, m_pHatchLB->GetIconSize() ); + sal_Int32 nId = m_xHatchLB->GetItemId(nCount - 1); // calculate the last ID + BitmapEx aBitmap = m_pHatchingList->GetBitmapForPreview( nCount, m_xHatchLB->GetIconSize() ); // Insert the new entry at the next ID - m_pHatchLB->InsertItem( nId + 1, Image(aBitmap), aName ); - m_pHatchLB->SelectItem( nId + 1 ); - m_pHatchLB->Resize(); + m_xHatchLB->InsertItem( nId + 1, Image(aBitmap), aName ); + m_xHatchLB->SelectItem( nId + 1 ); + m_xHatchLB->Resize(); *m_pnHatchingListState |= ChangeType::MODIFIED; @@ -485,56 +468,56 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void) } } -IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl, weld::Button&, void) { - sal_uInt16 nId = m_pHatchLB->GetSelectedItemId(); - size_t nPos = m_pHatchLB->GetSelectItemPos(); + sal_uInt16 nId = m_xHatchLB->GetSelectedItemId(); + size_t nPos = m_xHatchLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { OUString aName( m_pHatchingList->GetHatch( static_cast<sal_uInt16>(nPos) )->GetName() ); - XHatch aXHatch( m_pLbLineColor->GetSelectEntryColor(), - static_cast<css::drawing::HatchStyle>(m_pLbLineType->GetSelectedEntryPos()), - GetCoreValue( *m_pMtrDistance, m_ePoolUnit ), - static_cast<long>(m_pMtrAngle->GetValue() * 10) ); + XHatch aXHatch( m_xLbLineColor->GetSelectEntryColor(), + static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()), + GetCoreValue( *m_xMtrDistance, m_ePoolUnit ), + static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10) ); m_pHatchingList->Replace(o3tl::make_unique<XHatchEntry>(aXHatch, aName), nPos); - BitmapEx aBitmap = m_pHatchingList->GetBitmapForPreview( static_cast<sal_uInt16>(nPos), m_pHatchLB->GetIconSize() ); - m_pHatchLB->RemoveItem( nId ); - m_pHatchLB->InsertItem( nId, Image(aBitmap), aName, static_cast<sal_uInt16>(nPos) ); - m_pHatchLB->SelectItem( nId ); + BitmapEx aBitmap = m_pHatchingList->GetBitmapForPreview( static_cast<sal_uInt16>(nPos), m_xHatchLB->GetIconSize() ); + m_xHatchLB->RemoveItem( nId ); + m_xHatchLB->InsertItem( nId, Image(aBitmap), aName, static_cast<sal_uInt16>(nPos) ); + m_xHatchLB->SelectItem( nId ); // save values for changes recognition (-> method) - m_pMtrDistance->SaveValue(); - m_pMtrAngle->SaveValue(); - m_pLbLineType->SaveValue(); - m_pLbLineColor->SaveValue(); - m_pLbBackgroundColor->SaveValue(); + m_xMtrDistance->save_value(); + m_xMtrAngle->save_value(); + m_xLbLineType->save_value(); + m_xLbLineColor->SaveValue(); + m_xLbBackgroundColor->SaveValue(); *m_pnHatchingListState |= ChangeType::MODIFIED; } } -IMPL_LINK_NOARG(SvxHatchTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void) +IMPL_LINK_NOARG(SvxHatchTabPage, ClickDeleteHdl_Impl, PresetListBox*, void) { - sal_uInt16 nId = m_pHatchLB->GetSelectedItemId(); - size_t nPos = m_pHatchLB->GetSelectItemPos(); + sal_uInt16 nId = m_xHatchLB->GetSelectedItemId(); + size_t nPos = m_xHatchLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletehatchdialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/querydeletehatchdialog.ui")); std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelHatchDialog")); if (xQueryBox->run() == RET_YES) { m_pHatchingList->Remove(nPos); - m_pHatchLB->RemoveItem( nId ); - nId = m_pHatchLB->GetItemId(0); - m_pHatchLB->SelectItem( nId ); - m_pHatchLB->Resize(); + m_xHatchLB->RemoveItem( nId ); + nId = m_xHatchLB->GetItemId(0); + m_xHatchLB->SelectItem( nId ); + m_xHatchLB->Resize(); - m_pCtlPreview->Invalidate(); + m_aCtlPreview.Invalidate(); ChangeHatchHdl_Impl(); @@ -543,10 +526,10 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void) } } -IMPL_LINK_NOARG(SvxHatchTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void ) +IMPL_LINK_NOARG(SvxHatchTabPage, ClickRenameHdl_Impl, PresetListBox*, void ) { - sal_uInt16 nId = m_pHatchLB->GetSelectedItemId(); - size_t nPos = m_pHatchLB->GetSelectItemPos(); + sal_uInt16 nId = m_xHatchLB->GetSelectedItemId(); + size_t nPos = m_xHatchLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { @@ -554,7 +537,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void ) OUString aName( m_pHatchingList->GetHatch( nPos )->GetName() ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc)); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc)); bool bLoop = true; while( bLoop && pDlg->Execute() == RET_OK ) @@ -568,14 +551,14 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void ) bLoop = false; m_pHatchingList->GetHatch(nPos)->SetName(aName); - m_pHatchLB->SetItemText(nId, aName); - m_pHatchLB->SelectItem( nId ); + m_xHatchLB->SetItemText(nId, aName); + m_xHatchLB->SelectItem( nId ); *m_pnHatchingListState |= ChangeType::MODIFIED; } else { - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog")); xBox->run(); } @@ -595,7 +578,7 @@ void SvxHatchTabPage::PointChanged( weld::DrawingArea*, RectPoint ) void SvxHatchTabPage::DataChanged( const DataChangedEvent& rDCEvt ) { if ( ( rDCEvt.GetType() == DataChangedEventType::SETTINGS ) && ( rDCEvt.GetFlags() & AllSettingsFlags::STYLE ) ) - m_pCtlPreview->SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + m_aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); SvxTabPage::DataChanged( rDCEvt ); } diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx index a696204da30e..b7f72a6cbe01 100644 --- a/cui/source/tabpages/tppattern.cxx +++ b/cui/source/tabpages/tppattern.cxx @@ -83,35 +83,29 @@ public: void SetBackgroundColor( Color aColor ) { aBackgroundColor = aColor; } }; -SvxPatternTabPage::SvxPatternTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs) : - - SvxTabPage ( pParent, - "PatternTabPage", - "cui/ui/patterntabpage.ui", - rInAttrs ), - m_rOutAttrs ( rInAttrs ), - - m_pnPatternListState ( nullptr ), - m_pnColorListState ( nullptr ), - m_aXFillAttr ( rInAttrs.GetPool() ), - m_rXFSet ( m_aXFillAttr.GetItemSet() ) +SvxPatternTabPage::SvxPatternTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs) + : SvxTabPage(pParent, "cui/ui/patterntabpage.ui", "PatternTabPage", rInAttrs) + , m_rOutAttrs(rInAttrs) + , m_pnPatternListState(nullptr) + , m_pnColorListState(nullptr) + , m_aXFillAttr(rInAttrs.GetPool()) + , m_rXFSet(m_aXFillAttr.GetItemSet()) + , m_aCtlPixel(this) + , m_xLbColor(new ColorListBox(m_xBuilder->weld_menu_button("LB_COLOR"), GetFrameWeld())) + , m_xLbBackgroundColor(new ColorListBox(m_xBuilder->weld_menu_button("LB_BACKGROUND_COLOR"), GetFrameWeld())) + , m_xPatternLB(new PresetListBox(m_xBuilder->weld_scrolled_window("patternpresetlistwin"))) + , m_xBtnAdd(m_xBuilder->weld_button("BTN_ADD")) + , m_xBtnModify(m_xBuilder->weld_button("BTN_MODIFY")) + , m_xCtlPixel(new weld::CustomWeld(*m_xBuilder, "CTL_PIXEL", m_aCtlPixel)) + , m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "CTL_PREVIEW", m_aCtlPreview)) + , m_xPatternLBWin(new weld::CustomWeld(*m_xBuilder, "patternpresetlist", *m_xPatternLB)) { - get(m_pCtlPixel,"CTL_PIXEL"); - get(m_pLbColor,"LB_COLOR"); - get(m_pLbBackgroundColor,"LB_BACKGROUND_COLOR"); - get(m_pCtlPreview,"CTL_PREVIEW"); - get(m_pPatternLB, "patternpresetlist"); - get(m_pBtnAdd,"BTN_ADD"); - get(m_pBtnModify,"BTN_MODIFY"); - // size of the bitmap display Size aSize = getDrawPreviewOptimalSize(this); - m_pPatternLB->set_width_request(aSize.Width()); - m_pPatternLB->set_height_request(aSize.Height()); - m_pCtlPreview->set_width_request(aSize.Width()); - m_pCtlPreview->set_height_request(aSize.Height()); + m_xPatternLB->set_size_request(aSize.Width(), aSize.Height()); + m_xCtlPreview->set_size_request(aSize.Width(), aSize.Height()); - m_pBitmapCtl.reset(new SvxBitmapCtl); + m_xBitmapCtl.reset(new SvxBitmapCtl); // this page needs ExchangeSupport SetExchangeSupport(); @@ -120,16 +114,14 @@ SvxPatternTabPage::SvxPatternTabPage( vcl::Window* pParent, const SfxItemSet& r m_rXFSet.Put( XFillStyleItem(drawing::FillStyle_BITMAP) ); m_rXFSet.Put( XFillBitmapItem(OUString(), Graphic()) ); - m_pBtnAdd->SetClickHdl( LINK( this, SvxPatternTabPage, ClickAddHdl_Impl ) ); - m_pBtnModify->SetClickHdl( LINK( this, SvxPatternTabPage, ClickModifyHdl_Impl ) ); - - m_pPatternLB->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangePatternHdl_Impl ) ); - m_pPatternLB->SetRenameHdl( LINK( this, SvxPatternTabPage, ClickRenameHdl_Impl ) ); - m_pPatternLB->SetDeleteHdl( LINK( this, SvxPatternTabPage, ClickDeleteHdl_Impl ) ); - m_pLbColor->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangeColorHdl_Impl ) ); - m_pLbBackgroundColor->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangeColorHdl_Impl ) ); + m_xBtnAdd->connect_clicked( LINK( this, SvxPatternTabPage, ClickAddHdl_Impl ) ); + m_xBtnModify->connect_clicked( LINK( this, SvxPatternTabPage, ClickModifyHdl_Impl ) ); - setPreviewsToSamePlace(pParent, this); + m_xPatternLB->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangePatternHdl_Impl ) ); + m_xPatternLB->SetRenameHdl( LINK( this, SvxPatternTabPage, ClickRenameHdl_Impl ) ); + m_xPatternLB->SetDeleteHdl( LINK( this, SvxPatternTabPage, ClickDeleteHdl_Impl ) ); + m_xLbColor->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangeColorHdl_Impl ) ); + m_xLbBackgroundColor->SetSelectHdl( LINK( this, SvxPatternTabPage, ChangeColorHdl_Impl ) ); } SvxPatternTabPage::~SvxPatternTabPage() @@ -139,20 +131,18 @@ SvxPatternTabPage::~SvxPatternTabPage() void SvxPatternTabPage::dispose() { - m_pBitmapCtl.reset(); - m_pCtlPixel.clear(); - m_pLbColor.clear(); - m_pLbBackgroundColor.clear(); - m_pCtlPreview.clear(); - m_pBtnAdd.clear(); - m_pBtnModify.clear(); - m_pPatternLB.clear(); + m_xPatternLBWin.reset(); + m_xCtlPreview.reset(); + m_xCtlPixel.reset(); + m_xPatternLB.reset(); + m_xLbBackgroundColor.reset(); + m_xLbColor.reset(); SvxTabPage::dispose(); } void SvxPatternTabPage::Construct() { - m_pPatternLB->FillPresetListBox( *m_pPatternList ); + m_xPatternLB->FillPresetListBox( *m_pPatternList ); } void SvxPatternTabPage::ActivatePage( const SfxItemSet& rSet ) @@ -188,8 +178,8 @@ void SvxPatternTabPage::ActivatePage( const SfxItemSet& rSet ) sal_Int32 nPos = SearchPatternList( rSet.Get(XATTR_FILLBITMAP).GetName() ); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - sal_uInt16 nId = m_pPatternLB->GetItemId( static_cast<size_t>( nPos ) ); - m_pPatternLB->SelectItem( nId ); + sal_uInt16 nId = m_xPatternLB->GetItemId( static_cast<size_t>( nPos ) ); + m_xPatternLB->SelectItem( nId ); } } } @@ -207,17 +197,17 @@ DeactivateRC SvxPatternTabPage::DeactivatePage( SfxItemSet* _pSet) bool SvxPatternTabPage::FillItemSet( SfxItemSet* _rOutAttrs ) { _rOutAttrs->Put(XFillStyleItem(drawing::FillStyle_BITMAP)); - size_t nPos = m_pPatternLB->IsNoSelection() ? VALUESET_ITEM_NOTFOUND : m_pPatternLB->GetSelectItemPos(); + size_t nPos = m_xPatternLB->IsNoSelection() ? VALUESET_ITEM_NOTFOUND : m_xPatternLB->GetSelectItemPos(); if(VALUESET_ITEM_NOTFOUND != nPos) { const XBitmapEntry* pXBitmapEntry = m_pPatternList->GetBitmap( static_cast<sal_uInt16>(nPos) ); - const OUString aString( m_pPatternLB->GetItemText( m_pPatternLB->GetSelectedItemId() ) ); + const OUString aString( m_xPatternLB->GetItemText( m_xPatternLB->GetSelectedItemId() ) ); _rOutAttrs->Put(XFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject())); } else { - const BitmapEx aBitmapEx(m_pBitmapCtl->GetBitmapEx()); + const BitmapEx aBitmapEx(m_xBitmapCtl->GetBitmapEx()); _rOutAttrs->Put(XFillBitmapItem(OUString(), Graphic(aBitmapEx))); } @@ -227,27 +217,27 @@ bool SvxPatternTabPage::FillItemSet( SfxItemSet* _rOutAttrs ) void SvxPatternTabPage::Reset( const SfxItemSet* ) { - m_pBitmapCtl->SetPixelColor( m_pLbColor->GetSelectEntryColor() ); - m_pBitmapCtl->SetBackgroundColor( m_pLbBackgroundColor->GetSelectEntryColor() ); - m_pBitmapCtl->SetBmpArray( m_pCtlPixel->GetBitmapPixelPtr() ); + m_xBitmapCtl->SetPixelColor( m_xLbColor->GetSelectEntryColor() ); + m_xBitmapCtl->SetBackgroundColor( m_xLbBackgroundColor->GetSelectEntryColor() ); + m_xBitmapCtl->SetBmpArray( m_aCtlPixel.GetBitmapPixelPtr() ); // get bitmap and display it - const XFillBitmapItem aBmpItem(OUString(), Graphic(m_pBitmapCtl->GetBitmapEx())); + const XFillBitmapItem aBmpItem(OUString(), Graphic(m_xBitmapCtl->GetBitmapEx())); m_rXFSet.Put( aBmpItem ); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); + m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlPreview.Invalidate(); - ChangePatternHdl_Impl( m_pPatternLB ); + ChangePatternHdl_Impl(m_xPatternLB.get()); // determine button state if( m_pPatternList.is() && m_pPatternList->Count() ) { - m_pBtnAdd->Enable(); - m_pBtnModify->Enable(); + m_xBtnAdd->set_sensitive(true); + m_xBtnModify->set_sensitive(true); } else { - m_pBtnModify->Disable(); + m_xBtnModify->set_sensitive(false);; } } @@ -255,14 +245,14 @@ void SvxPatternTabPage::Reset( const SfxItemSet* ) VclPtr<SfxTabPage> SvxPatternTabPage::Create( TabPageParent pWindow, const SfxItemSet* rSet ) { - return VclPtr<SvxPatternTabPage>::Create( pWindow.pParent, *rSet ); + return VclPtr<SvxPatternTabPage>::Create(pWindow, *rSet); } -IMPL_LINK_NOARG(SvxPatternTabPage, ChangePatternHdl_Impl, ValueSet*, void) +IMPL_LINK_NOARG(SvxPatternTabPage, ChangePatternHdl_Impl, SvtValueSet*, void) { std::unique_ptr<GraphicObject> pGraphicObject; - size_t nPos = m_pPatternLB->GetSelectItemPos(); + size_t nPos = m_xPatternLB->GetSelectItemPos(); if(VALUESET_ITEM_NOTFOUND != nPos) { @@ -284,8 +274,8 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ChangePatternHdl_Impl, ValueSet*, void) if(!pGraphicObject) { - sal_uInt16 nPosition = m_pPatternLB->GetItemId( 0 ); - m_pPatternLB->SelectItem( nPosition ); + sal_uInt16 nPosition = m_xPatternLB->GetItemId( 0 ); + m_xPatternLB->SelectItem( nPosition ); if( nPosition != 0 ) { pGraphicObject.reset(new GraphicObject(m_pPatternList->GetBitmap(0)->GetGraphicObject())); @@ -299,48 +289,47 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ChangePatternHdl_Impl, ValueSet*, void) BitmapColor aFront; bool bIs8x8(vcl::bitmap::isHistorical8x8(pGraphicObject->GetGraphic().GetBitmapEx(), aBack, aFront)); - m_pLbColor->SetNoSelection(); - m_pLbBackgroundColor->SetNoSelection(); + m_xLbColor->SetNoSelection(); + m_xLbBackgroundColor->SetNoSelection(); if(bIs8x8) { - m_pCtlPixel->SetPaintable( true ); - m_pBtnModify->Enable(); - m_pBtnAdd->Enable(); + m_aCtlPixel.SetPaintable( true ); + m_xBtnModify->set_sensitive(true); + m_xBtnAdd->set_sensitive(true); // setting the pixel control - m_pCtlPixel->SetXBitmap(pGraphicObject->GetGraphic().GetBitmapEx()); + m_aCtlPixel.SetXBitmap(pGraphicObject->GetGraphic().GetBitmapEx()); Color aPixelColor = aFront.GetColor(); Color aBackColor = aBack.GetColor(); - m_pLbColor->SelectEntry( aPixelColor ); - m_pLbBackgroundColor->SelectEntry( aBackColor ); + m_xLbColor->SelectEntry( aPixelColor ); + m_xLbBackgroundColor->SelectEntry( aBackColor ); - // update m_pBitmapCtl, rXFSet and m_pCtlPreview - m_pBitmapCtl->SetPixelColor( aPixelColor ); - m_pBitmapCtl->SetBackgroundColor( aBackColor ); + // update m_xBitmapCtl, rXFSet and m_aCtlPreview + m_xBitmapCtl->SetPixelColor( aPixelColor ); + m_xBitmapCtl->SetBackgroundColor( aBackColor ); m_rXFSet.ClearItem(); m_rXFSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP)); - m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_pBitmapCtl->GetBitmapEx()))); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); + m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_xBitmapCtl->GetBitmapEx()))); + m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlPreview.Invalidate(); } else { - m_pCtlPixel->Reset(); - m_pCtlPixel->SetPaintable( false ); - m_pBtnModify->Disable(); - m_pBtnAdd->Disable(); + m_aCtlPixel.Reset(); + m_aCtlPixel.SetPaintable( false ); + m_xBtnModify->set_sensitive(false); + m_xBtnAdd->set_sensitive(false); } - m_pCtlPixel->Invalidate(); + m_aCtlPixel.Invalidate(); } } - -IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, weld::Button&, void) { OUString aNewName( SvxResId( RID_SVXSTR_PATTERN_UNTITLED ) ); @@ -358,7 +347,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void) } SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc)); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc)); sal_uInt16 nError(1); while( pDlg->Execute() == RET_OK ) @@ -372,7 +361,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void) break; } - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog")); if (xWarnBox->run() != RET_OK) break; @@ -383,9 +372,9 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void) if( !nError ) { std::unique_ptr<XBitmapEntry> pEntry; - if( m_pCtlPixel->IsEnabled() ) + if( m_aCtlPixel.IsEnabled() ) { - const BitmapEx aBitmapEx(m_pBitmapCtl->GetBitmapEx()); + const BitmapEx aBitmapEx(m_xBitmapCtl->GetBitmapEx()); pEntry.reset(new XBitmapEntry(Graphic(aBitmapEx), aName)); } @@ -404,58 +393,53 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, Button*, void) if( pEntry ) { m_pPatternList->Insert(std::move(pEntry), nCount); - sal_Int32 nId = m_pPatternLB->GetItemId( nCount - 1 ); - BitmapEx aBitmap = m_pPatternList->GetBitmapForPreview( nCount, m_pPatternLB->GetIconSize() ); - m_pPatternLB->InsertItem( nId + 1, Image(aBitmap), aName ); - m_pPatternLB->SelectItem( nId + 1 ); - m_pPatternLB->Resize(); + sal_Int32 nId = m_xPatternLB->GetItemId( nCount - 1 ); + BitmapEx aBitmap = m_pPatternList->GetBitmapForPreview( nCount, m_xPatternLB->GetIconSize() ); + m_xPatternLB->InsertItem( nId + 1, Image(aBitmap), aName ); + m_xPatternLB->SelectItem( nId + 1 ); + m_xPatternLB->Resize(); *m_pnPatternListState |= ChangeType::MODIFIED; - ChangePatternHdl_Impl( m_pPatternLB ); + ChangePatternHdl_Impl(m_xPatternLB.get()); } } // determine button state if( m_pPatternList->Count() ) { - m_pBtnModify->Enable(); + m_xBtnModify->set_sensitive(true); } } - -/******************************************************************************/ -/******************************************************************************/ - - -IMPL_LINK_NOARG(SvxPatternTabPage, ClickModifyHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SvxPatternTabPage, ClickModifyHdl_Impl, weld::Button&, void) { - sal_uInt16 nId = m_pPatternLB->GetSelectedItemId(); - size_t nPos = m_pPatternLB->GetSelectItemPos(); + sal_uInt16 nId = m_xPatternLB->GetSelectedItemId(); + size_t nPos = m_xPatternLB->GetSelectItemPos(); if ( nPos != VALUESET_ITEM_NOTFOUND ) { OUString aName( m_pPatternList->GetBitmap( static_cast<sal_uInt16>(nPos) )->GetName() ); - const BitmapEx aBitmapEx(m_pBitmapCtl->GetBitmapEx()); + const BitmapEx aBitmapEx(m_xBitmapCtl->GetBitmapEx()); // #i123497# Need to replace the existing entry with a new one (old returned needs to be deleted) m_pPatternList->Replace(o3tl::make_unique<XBitmapEntry>(Graphic(aBitmapEx), aName), nPos); - BitmapEx aBitmap = m_pPatternList->GetBitmapForPreview( static_cast<sal_uInt16>( nPos ), m_pPatternLB->GetIconSize() ); - m_pPatternLB->RemoveItem(nId); - m_pPatternLB->InsertItem( nId, Image(aBitmap), aName, static_cast<sal_uInt16>(nPos) ); - m_pPatternLB->SelectItem( nId ); + BitmapEx aBitmap = m_pPatternList->GetBitmapForPreview( static_cast<sal_uInt16>( nPos ), m_xPatternLB->GetIconSize() ); + m_xPatternLB->RemoveItem(nId); + m_xPatternLB->InsertItem( nId, Image(aBitmap), aName, static_cast<sal_uInt16>(nPos) ); + m_xPatternLB->SelectItem( nId ); *m_pnPatternListState |= ChangeType::MODIFIED; } } -IMPL_LINK_NOARG(SvxPatternTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void) +IMPL_LINK_NOARG(SvxPatternTabPage, ClickRenameHdl_Impl, PresetListBox*, void) { - size_t nPos = m_pPatternLB->GetSelectItemPos(); - sal_Int32 nId = m_pPatternLB->GetSelectedItemId(); + size_t nPos = m_xPatternLB->GetSelectItemPos(); + sal_Int32 nId = m_xPatternLB->GetSelectedItemId(); if ( nPos != VALUESET_ITEM_NOTFOUND ) { @@ -463,7 +447,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void) OUString aName(m_pPatternList->GetBitmap(nPos)->GetName()); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc)); + ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc)); bool bLoop = true; @@ -479,14 +463,14 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void) m_pPatternList->GetBitmap(nPos)->SetName(aName); - m_pPatternLB->SetItemText( nId, aName ); - m_pPatternLB->SelectItem( nId ); + m_xPatternLB->SetItemText( nId, aName ); + m_xPatternLB->SelectItem( nId ); *m_pnPatternListState |= ChangeType::MODIFIED; } else { - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog")); xWarnBox->run(); } @@ -494,27 +478,27 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void) } } -IMPL_LINK_NOARG(SvxPatternTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void) +IMPL_LINK_NOARG(SvxPatternTabPage, ClickDeleteHdl_Impl, PresetListBox*, void) { - sal_uInt16 nId = m_pPatternLB->GetSelectedItemId(); - size_t nPos = m_pPatternLB->GetSelectItemPos(); + sal_uInt16 nId = m_xPatternLB->GetSelectedItemId(); + size_t nPos = m_xPatternLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletebitmapdialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/querydeletebitmapdialog.ui")); std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelBitmapDialog")); if (xQueryBox->run() == RET_YES) { m_pPatternList->Remove(nPos); - m_pPatternLB->RemoveItem( nId ); - nId = m_pPatternLB->GetItemId(0); - m_pPatternLB->SelectItem( nId ); - m_pPatternLB->Resize(); + m_xPatternLB->RemoveItem( nId ); + nId = m_xPatternLB->GetItemId(0); + m_xPatternLB->SelectItem( nId ); + m_xPatternLB->Resize(); - m_pCtlPreview->Invalidate(); - m_pCtlPixel->Invalidate(); + m_aCtlPreview.Invalidate(); + m_aCtlPixel.Invalidate(); - ChangePatternHdl_Impl( m_pPatternLB ); + ChangePatternHdl_Impl(m_xPatternLB.get()); *m_pnPatternListState |= ChangeType::MODIFIED; } @@ -522,56 +506,49 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void) // determine button state if( !m_pPatternList->Count() ) { - m_pBtnModify->Disable(); + m_xBtnModify->set_sensitive(false); } } -IMPL_LINK_NOARG(SvxPatternTabPage, ChangeColorHdl_Impl, SvxColorListBox&, void) +IMPL_LINK_NOARG(SvxPatternTabPage, ChangeColorHdl_Impl, ColorListBox&, void) { ChangeColor_Impl(); - m_pPatternLB->SetNoSelection(); + m_xPatternLB->SetNoSelection(); } void SvxPatternTabPage::ChangeColor_Impl() { - m_pCtlPixel->SetPixelColor( m_pLbColor->GetSelectEntryColor() ); - m_pCtlPixel->SetBackgroundColor( m_pLbBackgroundColor->GetSelectEntryColor() ); - m_pCtlPixel->Invalidate(); + m_aCtlPixel.SetPixelColor( m_xLbColor->GetSelectEntryColor() ); + m_aCtlPixel.SetBackgroundColor( m_xLbBackgroundColor->GetSelectEntryColor() ); + m_aCtlPixel.Invalidate(); - m_pBitmapCtl->SetPixelColor( m_pLbColor->GetSelectEntryColor() ); - m_pBitmapCtl->SetBackgroundColor( m_pLbBackgroundColor->GetSelectEntryColor() ); + m_xBitmapCtl->SetPixelColor( m_xLbColor->GetSelectEntryColor() ); + m_xBitmapCtl->SetBackgroundColor( m_xLbBackgroundColor->GetSelectEntryColor() ); // get bitmap and display it - m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_pBitmapCtl->GetBitmapEx()))); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); + m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_xBitmapCtl->GetBitmapEx()))); + m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlPreview.Invalidate(); } -void SvxPatternTabPage::PointChanged( vcl::Window* pWindow, RectPoint ) +void SvxPatternTabPage::PointChanged( vcl::Window*, RectPoint ) { - if( pWindow == m_pCtlPixel ) - { - m_pBitmapCtl->SetBmpArray( m_pCtlPixel->GetBitmapPixelPtr() ); - - // get bitmap and display it - m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_pBitmapCtl->GetBitmapEx()))); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); - } - - m_pPatternLB->SetNoSelection(); + assert(false); } -void SvxPatternTabPage::PointChanged( weld::DrawingArea*, RectPoint ) +void SvxPatternTabPage::PointChanged(weld::DrawingArea* pDrawingArea, RectPoint) { - m_pBitmapCtl->SetBmpArray( m_pCtlPixel->GetBitmapPixelPtr() ); + if (pDrawingArea == m_aCtlPixel.GetDrawingArea()) + { + m_xBitmapCtl->SetBmpArray(m_aCtlPixel.GetBitmapPixelPtr()); - // get bitmap and display it - m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_pBitmapCtl->GetBitmapEx()))); - m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); - m_pCtlPreview->Invalidate(); + // get bitmap and display it + m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_xBitmapCtl->GetBitmapEx()))); + m_aCtlPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); + m_aCtlPreview.Invalidate(); + } - m_pPatternLB->SetNoSelection(); + m_xPatternLB->SetNoSelection(); } sal_Int32 SvxPatternTabPage::SearchPatternList(const OUString& rPatternName) diff --git a/cui/uiconfig/ui/areatabpage.ui b/cui/uiconfig/ui/areatabpage.ui index f1165815fe4c..6f21498a0467 100644 --- a/cui/uiconfig/ui/areatabpage.ui +++ b/cui/uiconfig/ui/areatabpage.ui @@ -41,7 +41,7 @@ </packing> </child> <child> - <object class="GtkButton" id="btnnone"> + <object class="GtkToggleButton" id="btnnone"> <property name="label" translatable="yes" context="areatabpage|btnnone">None</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -54,7 +54,7 @@ </packing> </child> <child> - <object class="GtkButton" id="btncolor"> + <object class="GtkToggleButton" id="btncolor"> <property name="label" translatable="yes" context="areatabpage|btncolor">Color</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -67,7 +67,7 @@ </packing> </child> <child> - <object class="GtkButton" id="btngradient"> + <object class="GtkToggleButton" id="btngradient"> <property name="label" translatable="yes" context="areatabpage|btngradient">Gradient</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -80,7 +80,7 @@ </packing> </child> <child> - <object class="GtkButton" id="btnbitmap"> + <object class="GtkToggleButton" id="btnbitmap"> <property name="label" translatable="yes" context="areatabpage|btnbitmap">Bitmap</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -93,7 +93,7 @@ </packing> </child> <child> - <object class="GtkButton" id="btnpattern"> + <object class="GtkToggleButton" id="btnpattern"> <property name="label" translatable="yes" context="areatabpage|btnpattern">Pattern</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -106,7 +106,7 @@ </packing> </child> <child> - <object class="GtkButton" id="btnhatch"> + <object class="GtkToggleButton" id="btnhatch"> <property name="label" translatable="yes" context="areatabpage|btnhatch">Hatch</property> <property name="visible">True</property> <property name="can_focus">True</property> diff --git a/cui/uiconfig/ui/bitmaptabpage.ui b/cui/uiconfig/ui/bitmaptabpage.ui index 69ebb75224ad..78792593c776 100644 --- a/cui/uiconfig/ui/bitmaptabpage.ui +++ b/cui/uiconfig/ui/bitmaptabpage.ui @@ -1,11 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.22.1 --> <interface domain="cui"> <requires lib="gtk+" version="3.18"/> - <requires lib="LibreOffice" version="1.0"/> + <object class="GtkAdjustment" id="adjustment1"> + <property name="upper">100</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> <object class="GtkBox" id="BitmapTabPage"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> <property name="border_width">6</property> <property name="spacing">6</property> <child> @@ -23,17 +29,35 @@ <property name="top_padding">6</property> <property name="left_padding">12</property> <child> - <object class="GtkVBox" id="box1"> + <object class="GtkBox" id="box1"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> + <property name="orientation">vertical</property> <property name="spacing">6</property> <child> - <object class="svxcorelo-SvxPresetListBox" id="BITMAP"> + <object class="GtkScrolledWindow" id="bitmapwin"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkDrawingArea" id="BITMAP"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + </object> + </child> + </object> + </child> </object> <packing> <property name="expand">False</property> @@ -171,7 +195,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="bitmaptabpage|label5">Width:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">width:0%</property> + <property name="mnemonic_widget">width</property> </object> <packing> <property name="expand">False</property> @@ -180,7 +204,7 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="width:0%"> + <object class="GtkSpinButton" id="width"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> @@ -197,7 +221,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="bitmaptabpage|label6">Height:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">height:0%</property> + <property name="mnemonic_widget">height</property> </object> <packing> <property name="expand">False</property> @@ -206,7 +230,7 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="height:0%"> + <object class="GtkSpinButton" id="height"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> @@ -328,7 +352,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="bitmaptabpage|label10">X-Offset:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">posoffx:0%</property> + <property name="mnemonic_widget">posoffx</property> </object> <packing> <property name="expand">False</property> @@ -337,7 +361,7 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="posoffx:0%"> + <object class="GtkSpinButton" id="posoffx"> <property name="visible">True</property> <property name="can_focus">True</property> </object> @@ -353,7 +377,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="bitmaptabpage|label11">Y-Offset:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">posoffy:0%</property> + <property name="mnemonic_widget">posoffy</property> </object> <packing> <property name="expand">False</property> @@ -362,7 +386,7 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="posoffy:0%"> + <object class="GtkSpinButton" id="posoffy"> <property name="visible">True</property> <property name="can_focus">True</property> </object> @@ -429,10 +453,11 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="tileoffmtr:0%"> + <object class="GtkSpinButton" id="tileoffmtr"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="adjustment">adjustment1</property> </object> <packing> <property name="expand">False</property> @@ -498,14 +523,31 @@ <property name="valign">start</property> <property name="orientation">vertical</property> <child> - <object class="svxlo-SvxXRectPreview" id="CTL_BITMAP_PREVIEW"> + <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="CTL_BITMAP_PREVIEW-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="bitmaptabpage|CTL_BITMAP_PREVIEW-atkobject">Example</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkDrawingArea" id="CTL_BITMAP_PREVIEW"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="CTL_BITMAP_PREVIEW-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="bitmaptabpage|CTL_BITMAP_PREVIEW-atkobject">Example</property> + </object> + </child> + </object> + </child> </object> </child> </object> diff --git a/cui/uiconfig/ui/colorpage.ui b/cui/uiconfig/ui/colorpage.ui index a629ee08c03a..431f0a7511c3 100644 --- a/cui/uiconfig/ui/colorpage.ui +++ b/cui/uiconfig/ui/colorpage.ui @@ -319,14 +319,31 @@ <property name="can_focus">False</property> <property name="orientation">vertical</property> <child> - <object class="GtkDrawingArea" id="oldpreview"> + <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="oldpreview-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="colorpage|oldpreview-atkobject">Old Color</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkDrawingArea" id="oldpreview"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="oldpreview-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="colorpage|oldpreview-atkobject">Old Color</property> + </object> + </child> + </object> + </child> </object> </child> </object> @@ -621,14 +638,31 @@ <property name="can_focus">False</property> <property name="orientation">vertical</property> <child> - <object class="GtkDrawingArea" id="newpreview"> + <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="newpreview-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="colorpage|newpreview-atkobject">New Color</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkDrawingArea" id="newpreview"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="newpreview-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="colorpage|newpreview-atkobject">New Color</property> + </object> + </child> + </object> + </child> </object> </child> </object> diff --git a/cui/uiconfig/ui/gradientpage.ui b/cui/uiconfig/ui/gradientpage.ui index f275b931cbd5..2021908ed03d 100644 --- a/cui/uiconfig/ui/gradientpage.ui +++ b/cui/uiconfig/ui/gradientpage.ui @@ -1,14 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.22.1 --> <interface domain="cui"> <requires lib="gtk+" version="3.18"/> - <requires lib="LibreOffice" version="1.0"/> <object class="GtkAdjustment" id="adjustment1"> <property name="lower">3</property> <property name="upper">256</property> <property name="step_increment">1</property> <property name="page_increment">10</property> </object> + <object class="GtkAdjustment" id="adjustment2"> + <property name="lower">3</property> + <property name="upper">256</property> + <property name="value">3</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkAdjustment" id="adjustment3"> + <property name="upper">100</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> <object class="GtkAdjustment" id="angleadjustment"> <property name="upper">359</property> <property name="step_increment">15</property> @@ -17,6 +28,22 @@ <property name="upper">100</property> <property name="step_increment">5</property> </object> + <object class="GtkAdjustment" id="percentadjustment1"> + <property name="upper">100</property> + <property name="step_increment">5</property> + </object> + <object class="GtkAdjustment" id="percentadjustment2"> + <property name="upper">100</property> + <property name="step_increment">5</property> + </object> + <object class="GtkAdjustment" id="percentadjustment3"> + <property name="upper">100</property> + <property name="step_increment">5</property> + </object> + <object class="GtkAdjustment" id="percentadjustment4"> + <property name="upper">100</property> + <property name="step_increment">5</property> + </object> <object class="GtkBox" id="GradientPage"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -41,11 +68,28 @@ <property name="orientation">vertical</property> <property name="spacing">6</property> <child> - <object class="svxcorelo-SvxPresetListBox" id="gradientpresetlist"> + <object class="GtkScrolledWindow" id="gradientpresetlistwin"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkDrawingArea" id="gradientpresetlist"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + </object> + </child> + </object> + </child> </object> <packing> <property name="expand">False</property> @@ -210,6 +254,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="adjustment">adjustment2</property> <property name="round_digits">1</property> <property name="draw_value">False</property> </object> @@ -271,7 +316,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="gradientpage|angleft">A_ngle:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">anglemtr:0degrees</property> + <property name="mnemonic_widget">anglemtr</property> <property name="xalign">0</property> <property name="yalign">0.43999999761581421</property> </object> @@ -281,7 +326,7 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="anglemtr:0degrees"> + <object class="GtkSpinButton" id="anglemtr"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="adjustment">angleadjustment</property> @@ -312,11 +357,11 @@ <property name="hexpand">True</property> <property name="spacing">6</property> <child> - <object class="GtkSpinButton" id="centerxmtr:%"> + <object class="GtkSpinButton" id="centerxmtr"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> - <property name="adjustment">percentadjustment</property> + <property name="adjustment">percentadjustment3</property> </object> <packing> <property name="expand">True</property> @@ -325,11 +370,11 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="centerymtr:%"> + <object class="GtkSpinButton" id="centerymtr"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> - <property name="adjustment">percentadjustment</property> + <property name="adjustment">percentadjustment4</property> </object> <packing> <property name="expand">True</property> @@ -363,7 +408,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="gradientpage|borderft">_Border:</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">bordermtr:%</property> + <property name="mnemonic_widget">bordermtr</property> <property name="xalign">0</property> <property name="yalign">0.43999999761581421</property> </object> @@ -377,6 +422,8 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="adjustment">adjustment3</property> + <property name="fill_level">0</property> <property name="round_digits">1</property> <property name="draw_value">False</property> </object> @@ -386,7 +433,7 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="bordermtr:%"> + <object class="GtkSpinButton" id="bordermtr"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="halign">end</property> @@ -429,11 +476,14 @@ </packing> </child> <child> - <object class="svxcorelo-SvxColorListBox" id="colorfromlb"> + <object class="GtkMenuButton" id="colorfromlb"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="entry_text_column">0</property> - <property name="id_column">1</property> + <property name="receives_default">False</property> + <property name="xalign">0</property> + <child> + <placeholder/> + </child> </object> <packing> <property name="left_attach">0</property> @@ -441,11 +491,11 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="colorfrommtr:%"> + <object class="GtkSpinButton" id="colorfrommtr"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="margin_left">6</property> - <property name="adjustment">percentadjustment</property> + <property name="adjustment">percentadjustment1</property> </object> <packing> <property name="left_attach">1</property> @@ -470,11 +520,14 @@ <property name="row_spacing">3</property> <property name="column_spacing">6</property> <child> - <object class="svxcorelo-SvxColorListBox" id="colortolb"> + <object class="GtkMenuButton" id="colortolb"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="entry_text_column">0</property> - <property name="id_column">1</property> + <property name="receives_default">False</property> + <property name="xalign">0</property> + <child> + <placeholder/> + </child> </object> <packing> <property name="left_attach">0</property> @@ -482,11 +535,11 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="colortomtr:%"> + <object class="GtkSpinButton" id="colortomtr"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="margin_left">6</property> - <property name="adjustment">percentadjustment</property> + <property name="adjustment">percentadjustment2</property> </object> <packing> <property name="left_attach">1</property> @@ -526,7 +579,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="gradientpage|a11y_center_x">Center X</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">centerxmtr:%</property> + <property name="mnemonic_widget">centerxmtr</property> </object> <packing> <property name="expand">False</property> @@ -540,7 +593,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="gradientpage|a11y_center_y">Center Y</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">centerymtr:%</property> + <property name="mnemonic_widget">centerymtr</property> </object> <packing> <property name="expand">False</property> @@ -554,7 +607,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="gradientpage|a11y_percentage_from">From color percentage</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">colorfrommtr:%</property> + <property name="mnemonic_widget">colorfrommtr</property> </object> <packing> <property name="expand">False</property> @@ -568,7 +621,7 @@ <property name="can_focus">False</property> <property name="label" translatable="yes" context="gradientpage|a11y_percentage_to">To color percentage</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">colortomtr:%</property> + <property name="mnemonic_widget">colortomtr</property> </object> <packing> <property name="expand">False</property> @@ -628,14 +681,31 @@ <property name="valign">start</property> <property name="orientation">vertical</property> <child> - <object class="svxlo-SvxXRectPreview" id="previewctl"> + <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="previewctl-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="gradientpage|previewctl-atkobject">Example</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkDrawingArea" id="previewctl"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="previewctl-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="gradientpage|previewctl-atkobject">Example</property> + </object> + </child> + </object> + </child> </object> </child> </object> diff --git a/cui/uiconfig/ui/hatchpage.ui b/cui/uiconfig/ui/hatchpage.ui index 4fcf069914ba..e55dc25ea25e 100644 --- a/cui/uiconfig/ui/hatchpage.ui +++ b/cui/uiconfig/ui/hatchpage.ui @@ -1,8 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.1 --> +<!-- Generated with glade 3.22.1 --> <interface domain="cui"> <requires lib="gtk+" version="3.18"/> - <!-- interface-requires LibreOffice 1.0 --> <object class="GtkAdjustment" id="adjustment1"> <property name="upper">359</property> <property name="step_increment">15</property> @@ -43,12 +42,29 @@ <property name="orientation">vertical</property> <property name="spacing">6</property> <child> - <object class="svxcorelo-SvxPresetListBox" id="hatchpresetlist"> + <object class="GtkScrolledWindow" id="hatchpresetlistwin"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> + <child> + <object class="GtkDrawingArea" id="hatchpresetlist"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + </object> + </child> </object> + </child> + </object> <packing> <property name="expand">True</property> <property name="fill">True</property> @@ -144,9 +160,10 @@ <object class="GtkLabel" id="distanceft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="hatchpage|distanceft">_Spacing:</property> <property name="use_underline">True</property> + <property name="mnemonic_widget">distancemtr</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -155,7 +172,7 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="distancemtr:0mm"> + <object class="GtkSpinButton" id="distancemtr"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="adjustment">distanceadjustment</property> @@ -170,9 +187,9 @@ <object class="GtkLabel" id="angleft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="hatchpage|angleft">A_ngle:</property> <property name="use_underline">True</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -201,7 +218,7 @@ </packing> </child> <child> - <object class="GtkSpinButton" id="anglemtr:0degrees"> + <object class="GtkSpinButton" id="anglemtr"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="adjustment">angleadjustment</property> @@ -223,9 +240,10 @@ <object class="GtkLabel" id="linetypeft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="hatchpage|linetypeft">_Line type:</property> <property name="use_underline">True</property> + <property name="mnemonic_widget">linetypelb</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -253,9 +271,10 @@ <object class="GtkLabel" id="linecolorft"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="hatchpage|linecolorft">Line _color:</property> <property name="use_underline">True</property> + <property name="mnemonic_widget">linecolorlb</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -264,10 +283,17 @@ </packing> </child> <child> - <object class="svxcorelo-SvxColorListBox" id="linecolorlb"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> + <object class="GtkMenuButton" id="linecolorlb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">False</property> + <property name="halign">start</property> + <property name="valign">center</property> + <property name="xalign">0</property> + <child> + <placeholder/> + </child> + </object> <packing> <property name="expand">False</property> <property name="fill">True</property> @@ -283,6 +309,9 @@ <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> + <accessibility> + <relation type="label-for" target="backgroundcolorlb"/> + </accessibility> </object> <packing> <property name="expand">False</property> @@ -291,10 +320,20 @@ </packing> </child> <child> - <object class="svxcorelo-SvxColorListBox" id="backgroundcolorlb"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> + <object class="GtkMenuButton" id="backgroundcolorlb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">False</property> + <property name="halign">start</property> + <property name="valign">center</property> + <property name="xalign">0</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="backgroundcolor"/> + </accessibility> + </object> <packing> <property name="expand">False</property> <property name="fill">True</property> @@ -346,17 +385,34 @@ <property name="valign">start</property> <property name="orientation">vertical</property> <child> - <object class="svxlo-SvxXRectPreview" id="previewctl"> + <object class="GtkScrolledWindow"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="previewctl-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="hatchpage|previewctl-atkobject">Example</property> + <child> + <object class="GtkDrawingArea" id="previewctl"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="previewctl-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="hatchpage|previewctl-atkobject">Example</property> + </object> + </child> </object> </child> </object> + </child> + </object> <packing> <property name="expand">False</property> <property name="fill">False</property> diff --git a/cui/uiconfig/ui/patterntabpage.ui b/cui/uiconfig/ui/patterntabpage.ui index 142eea461e33..57bf90ca763f 100644 --- a/cui/uiconfig/ui/patterntabpage.ui +++ b/cui/uiconfig/ui/patterntabpage.ui @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.1 --> +<!-- Generated with glade 3.22.1 --> <interface domain="cui"> <requires lib="gtk+" version="3.18"/> - <!-- interface-requires LibreOffice 1.0 --> <object class="GtkBox" id="PatternTabPage"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> <property name="border_width">6</property> <property name="spacing">6</property> <child> @@ -27,11 +28,28 @@ <property name="orientation">vertical</property> <property name="spacing">6</property> <child> - <object class="svxcorelo-SvxPresetListBox" id="patternpresetlist"> + <object class="GtkScrolledWindow" id="patternpresetlistwin"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkDrawingArea" id="patternpresetlist"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + </object> + </child> + </object> + </child> </object> <packing> <property name="expand">True</property> @@ -131,8 +149,8 @@ <object class="GtkLabel" id="label4"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="patterntabpage|label4">Pattern Editor:</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -141,14 +159,31 @@ </packing> </child> <child> - <object class="svxlo-SvxPixelCtl" id="CTL_PIXEL"> + <object class="GtkScrolledWindow"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="halign">start</property> <property name="valign">start</property> - <child internal-child="accessible"> - <object class="AtkObject" id="CTL_PIXEL-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="patterntabpage|CTL_PIXEL-atkobject">Pattern Editor</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkDrawingArea" id="CTL_PIXEL"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="valign">start</property> + <child internal-child="accessible"> + <object class="AtkObject" id="CTL_PIXEL-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="patterntabpage|CTL_PIXEL-atkobject">Pattern Editor</property> + </object> + </child> + </object> + </child> </object> </child> </object> @@ -175,8 +210,10 @@ <object class="GtkLabel" id="label5"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="patterntabpage|label5">Foreground Color:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">LB_COLOR</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -185,10 +222,14 @@ </packing> </child> <child> - <object class="svxcorelo-SvxColorListBox" id="LB_COLOR"> + <object class="GtkMenuButton" id="LB_COLOR"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="halign">start</property> + <property name="receives_default">False</property> + <property name="xalign">0</property> + <child> + <placeholder/> + </child> </object> <packing> <property name="expand">False</property> @@ -213,8 +254,10 @@ <object class="GtkLabel" id="label6"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="patterntabpage|label6">Background Color:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">LB_BACKGROUND_COLOR</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -223,10 +266,14 @@ </packing> </child> <child> - <object class="svxcorelo-SvxColorListBox" id="LB_BACKGROUND_COLOR"> + <object class="GtkMenuButton" id="LB_BACKGROUND_COLOR"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="halign">start</property> + <property name="receives_default">False</property> + <property name="xalign">0</property> + <child> + <placeholder/> + </child> </object> <packing> <property name="expand">False</property> @@ -285,17 +332,34 @@ <property name="valign">start</property> <property name="orientation">vertical</property> <child> - <object class="svxlo-SvxXRectPreview" id="CTL_PREVIEW"> + <object class="GtkScrolledWindow"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="hscrollbar_policy">never</property> + <property name="vscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="vexpand">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="CTL_PREVIEW-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes" context="patterntabpage|CTL_PREVIEW-atkobject">Example</property> + <child> + <object class="GtkDrawingArea" id="CTL_PREVIEW"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="CTL_PREVIEW-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes" context="patterntabpage|CTL_PREVIEW-atkobject">Example</property> + </object> + </child> </object> </child> </object> + </child> + </object> <packing> <property name="expand">False</property> <property name="fill">False</property> |