diff options
Diffstat (limited to 'sc/source/ui/inc')
-rw-r--r-- | sc/source/ui/inc/condformatdlg.hxx | 86 | ||||
-rw-r--r-- | sc/source/ui/inc/condformatdlgentry.hxx | 189 | ||||
-rw-r--r-- | sc/source/ui/inc/tabvwsh.hxx | 3 |
3 files changed, 140 insertions, 138 deletions
diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index ed1ef668c171..a2f9bae21864 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -31,83 +31,82 @@ class ScViewData; class ScCondFormatDlg; -class ScCondFormatList : public Control +class ScCondFormatList { private: - typedef std::vector<VclPtr<ScCondFrmtEntry>> EntryContainer; + std::unique_ptr<weld::ScrolledWindow> mxScrollWindow; + std::unique_ptr<weld::Container> mxGrid; + + typedef std::vector<std::unique_ptr<ScCondFrmtEntry>> EntryContainer; EntryContainer maEntries; - bool mbHasScrollBar; bool mbFrozen; bool mbNewEntry; - VclPtr<ScrollBar> mpScrollBar; ScDocument* mpDoc; ScAddress maPos; ScRangeList maRanges; - VclPtr<ScCondFormatDlg> mpDialogParent; - - void DoScroll(long nDiff); + ScCondFormatDlg* mpDialogParent; public: - ScCondFormatList(vcl::Window* pParent, WinBits nStyle); - virtual ~ScCondFormatList() override; - virtual void dispose() override; - - void init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent, const ScConditionalFormat* pFormat, + ScCondFormatList(ScCondFormatDlg* pParent, + std::unique_ptr<weld::ScrolledWindow> xWindow, + std::unique_ptr<weld::Container> xGrid); + weld::ScrolledWindow* GetWidget() { return mxScrollWindow.get(); } + weld::Container* GetContainer() { return mxGrid.get(); } + ~ScCondFormatList(); + + void init(ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRanges, const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType); void SetRange(const ScRangeList& rRange); - virtual Size GetOptimalSize() const override; - virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override; - virtual void Resize() override; - std::unique_ptr<ScConditionalFormat> GetConditionalFormat() const; + weld::Window* GetFrameWeld(); void Freeze() { mbFrozen = true; } void Thaw() { mbFrozen = false; } void RecalcAll(); - DECL_LINK( AddBtnHdl, Button*, void ); - DECL_LINK( RemoveBtnHdl, Button*, void ); - DECL_LINK( UpBtnHdl, Button*, void ); - DECL_LINK( DownBtnHdl, Button*, void ); - DECL_LINK( ScrollHdl, ScrollBar*, void ); + DECL_LINK( AddBtnHdl, weld::Button&, void ); + DECL_LINK( RemoveBtnHdl, weld::Button&, void ); + DECL_LINK( UpBtnHdl, weld::Button&, void ); + DECL_LINK( DownBtnHdl, weld::Button&, void ); + DECL_LINK( ScrollHdl, weld::ScrolledWindow&, void ); DECL_LINK( EntrySelectHdl, ScCondFrmtEntry&, void ); - DECL_LINK( TypeListHdl, ListBox&, void ); + DECL_LINK( TypeListHdl, weld::ComboBox&, void ); DECL_LINK( AfterTypeListHdl, void*, void ); - DECL_LINK( ColFormatTypeHdl, ListBox&, void ); + DECL_LINK( ColFormatTypeHdl, weld::ComboBox&, void ); + DECL_LINK( AfterColFormatTypeHdl, void*, void ); }; -class ScCondFormatDlg : public ScAnyRefDlg +class ScCondFormatDlg : public ScAnyRefDlgController { private: - VclPtr<PushButton> mpBtnOk; - VclPtr<PushButton> mpBtnAdd; - VclPtr<PushButton> mpBtnRemove; - VclPtr<PushButton> mpBtnUp; - VclPtr<PushButton> mpBtnDown; - VclPtr<PushButton> mpBtnCancel; - VclPtr<FixedText> mpFtRange; - VclPtr<formula::RefEdit> mpEdRange; - VclPtr<formula::RefButton> mpRbRange; - - VclPtr<ScCondFormatList> mpCondFormList; sal_Int32 mnKey; ScAddress maPos; ScViewData* mpViewData; - VclPtr<formula::RefEdit> mpLastEdit; - std::shared_ptr<ScCondFormatDlgItem> mpDlgItem; OUString msBaseTitle; - void updateTitle(); - DECL_LINK( EdRangeModifyHdl, Edit&, void ); + formula::WeldRefEdit* mpLastEdit; + std::unique_ptr<weld::Button> mxBtnOk; + std::unique_ptr<weld::Button> mxBtnAdd; + std::unique_ptr<weld::Button> mxBtnRemove; + std::unique_ptr<weld::Button> mxBtnUp; + std::unique_ptr<weld::Button> mxBtnDown; + std::unique_ptr<weld::Button> mxBtnCancel; + std::unique_ptr<weld::Label> mxFtRange; + std::unique_ptr<formula::WeldRefEdit> mxEdRange; + std::unique_ptr<formula::WeldRefButton> mxRbRange; + std::unique_ptr<ScCondFormatList> mxCondFormList; + + void updateTitle(); + DECL_LINK( EdRangeModifyHdl, formula::WeldRefEdit&, void ); protected: virtual void RefInputDone( bool bForced = false ) override; @@ -115,10 +114,9 @@ protected: void CancelPressed(); public: - SC_DLLPUBLIC ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pWindow, + SC_DLLPUBLIC ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pWindow, ScViewData* pViewData, const ScCondFormatDlgItem* pDlgItem); virtual ~ScCondFormatDlg() override; - virtual void dispose() override; SC_DLLPUBLIC std::unique_ptr<ScConditionalFormat> GetConditionalFormat() const; @@ -126,13 +124,13 @@ public: virtual bool IsRefInputMode() const override; virtual void SetActive() override; virtual bool IsTableLocked() const override; - virtual bool Close() override; + virtual void Close() override; void InvalidateRefData(); void OnSelectionChange(size_t nIndex, size_t nSize, bool bSelected = true); - DECL_LINK( BtnPressedHdl, Button*, void ); - DECL_LINK( RangeGetFocusHdl, Control&, void ); + DECL_LINK( BtnPressedHdl, weld::Button&, void ); + DECL_LINK( RangeGetFocusHdl, formula::WeldRefEdit&, void ); }; #endif diff --git a/sc/source/ui/inc/condformatdlgentry.hxx b/sc/source/ui/inc/condformatdlgentry.hxx index a46360555d7c..83ba66460ec4 100644 --- a/sc/source/ui/inc/condformatdlgentry.hxx +++ b/sc/source/ui/inc/condformatdlgentry.hxx @@ -15,12 +15,14 @@ #include <vcl/vclptr.hxx> #include <vcl/builder.hxx> #include <vcl/layout.hxx> +#include <vcl/weld.hxx> #include <svl/lstner.hxx> #include <svx/fntctrl.hxx> class ScIconSetFrmtDataEntry; class ScCondFormatDlg; -class SvxColorListBox; +class ScCondFormatList; +class ColorListBox; class ScColorScaleFormat; class ScDataBarFormat; class ScIconSetFormat; @@ -45,22 +47,27 @@ enum ScCondFrmtEntryType } -class ScCondFrmtEntry : public VclContainer - , public VclBuilderContainer +class ScCondFrmtEntry { +protected: + ScCondFormatList* mpParent; + std::unique_ptr<weld::Builder> mxBuilder; + private: - bool mbActive; + //general ui elements + std::unique_ptr<weld::Widget> mxBorder; + std::unique_ptr<weld::Container> mxGrid; + std::unique_ptr<weld::Label> mxFtCondNr; + std::unique_ptr<weld::Label> mxFtCondition; + bool mbActive; + OUString const maStrCondition; Link<ScCondFrmtEntry&,void> maClickHdl; - //general ui elements - VclPtr<VclContainer> maGrid; - VclPtr<FixedText> maFtCondNr; - VclPtr<FixedText> maFtCondition; + DECL_LINK( EntrySelectHdl, const MouseEvent&, bool ); - OUString const maStrCondition; protected: - VclPtr<ListBox> maLbType; + std::unique_ptr<weld::ComboBox> mxLbType; ScDocument* mpDoc; ScAddress maPos; @@ -71,18 +78,20 @@ protected: virtual OUString GetExpressionString() = 0; public: - ScCondFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos ); - virtual ~ScCondFrmtEntry() override; - virtual Size calculateRequisition() const override; - virtual void setAllocation(const Size &rAllocation) override; - virtual void dispose() override; + ScCondFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, const ScAddress& rPos); + virtual ~ScCondFrmtEntry(); + + void Show() { mxGrid->show(); } + void Hide() { mxGrid->hide(); } - virtual bool EventNotify( NotifyEvent& rNEvt ) override; + void set_grid_top_attach(int nAttach) { mxBorder->set_grid_top_attach(nAttach); } + int get_grid_top_attach() const { return mxBorder->get_grid_top_attach(); } + + Size get_preferred_size() const { return mxBorder->get_preferred_size(); } void SetPos(const ScAddress& rPos) { maPos = rPos; }; bool IsSelected() const { return mbActive;} void SetIndex(sal_Int32 nIndex); - void SetHeight(); virtual ScFormatEntry* GetEntry() const = 0; virtual void SetActive() = 0; @@ -94,13 +103,15 @@ public: class ScConditionFrmtEntry : public ScCondFrmtEntry, public SfxListener { //cond format ui elements - VclPtr<ListBox> maLbCondType; - VclPtr<formula::RefEdit> maEdVal1; - VclPtr<formula::RefEdit> maEdVal2; - VclPtr<FixedText> maFtVal; - VclPtr<FixedText> maFtStyle; - VclPtr<ListBox> maLbStyle; - VclPtr<SvxFontPrevWindow> maWdPreview; + FontPrevWindow maWdPreview; + std::unique_ptr<weld::ComboBox> mxLbCondType; + std::unique_ptr<formula::WeldRefEdit> mxEdVal1; + std::unique_ptr<formula::WeldRefEdit> mxEdVal2; + std::unique_ptr<weld::Label> mxFtVal; + std::unique_ptr<weld::Label> mxFtStyle; + std::unique_ptr<weld::ComboBox> mxLbStyle; + std::unique_ptr<weld::Widget> mxWdPreviewWin; + std::unique_ptr<weld::CustomWeld> mxWdPreview; bool mbIsInStyleCreate; static const sal_Int32 NUM_COND_ENTRIES = 24; @@ -111,9 +122,9 @@ class ScConditionFrmtEntry : public ScCondFrmtEntry, public SfxListener virtual OUString GetExpressionString() override; void Init(ScCondFormatDlg* pDialogParent); - DECL_LINK( StyleSelectHdl, ListBox&, void ); - DECL_LINK( ConditionTypeSelectHdl, ListBox&, void ); - DECL_LINK( OnEdChanged, Edit&, void ); + DECL_LINK( StyleSelectHdl, weld::ComboBox&, void ); + DECL_LINK( ConditionTypeSelectHdl, weld::ComboBox&, void ); + DECL_LINK( OnEdChanged, formula::WeldRefEdit&, void ); // Searches the lookup table for the entry position, given condition mode static sal_Int32 ConditionModeToEntryPos( ScConditionMode eMode ); @@ -127,10 +138,9 @@ protected: virtual void Deselect() override; public: - ScConditionFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent, - const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = nullptr ); + ScConditionFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent, + const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = nullptr); virtual ~ScConditionFrmtEntry() override; - virtual void dispose() override; virtual ScFormatEntry* GetEntry() const override; virtual void SetActive() override; @@ -143,21 +153,22 @@ public: class ScFormulaFrmtEntry : public ScCondFrmtEntry { - VclPtr<FixedText> maFtStyle; - VclPtr<ListBox> maLbStyle; - VclPtr<SvxFontPrevWindow> maWdPreview; - VclPtr<formula::RefEdit> maEdFormula; + FontPrevWindow maWdPreview; + std::unique_ptr<weld::Label> mxFtStyle; + std::unique_ptr<weld::ComboBox> mxLbStyle; + std::unique_ptr<weld::Widget> mxWdPreviewWin; + std::unique_ptr<weld::CustomWeld> mxWdPreview; + std::unique_ptr<formula::WeldRefEdit> mxEdFormula; ScFormatEntry* createFormulaEntry() const; virtual OUString GetExpressionString() override; void Init(ScCondFormatDlg* pDialogParent); - DECL_LINK( StyleSelectHdl, ListBox&, void ); + DECL_LINK(StyleSelectHdl, weld::ComboBox&, void); public: - ScFormulaFrmtEntry( vcl::Window* pParent, ScDocument* PDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = nullptr ); + ScFormulaFrmtEntry(ScCondFormatList* pParent, ScDocument* PDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = nullptr); virtual ~ScFormulaFrmtEntry() override; - virtual void dispose() override; virtual ScFormatEntry* GetEntry() const override; virtual void SetActive() override; @@ -169,31 +180,30 @@ class ScColorScale2FrmtEntry : public ScCondFrmtEntry { //color format ui elements - VclPtr<ListBox> maLbColorFormat; + std::unique_ptr<weld::ComboBox> mxLbColorFormat; //color scale ui elements - VclPtr<ListBox> maLbEntryTypeMin; - VclPtr<ListBox> maLbEntryTypeMax; + std::unique_ptr<weld::ComboBox> mxLbEntryTypeMin; + std::unique_ptr<weld::ComboBox> mxLbEntryTypeMax; - VclPtr<Edit> maEdMin; - VclPtr<Edit> maEdMax; + std::unique_ptr<weld::Entry> mxEdMin; + std::unique_ptr<weld::Entry> mxEdMax; - VclPtr<SvxColorListBox> maLbColMin; - VclPtr<SvxColorListBox> maLbColMax; + std::unique_ptr<ColorListBox> mxLbColMin; + std::unique_ptr<ColorListBox> mxLbColMax; - VclPtr<FixedText> maFtMin; - VclPtr<FixedText> maFtMax; + std::unique_ptr<weld::Label> mxFtMin; + std::unique_ptr<weld::Label> mxFtMax; ScFormatEntry* createColorscaleEntry() const; virtual OUString GetExpressionString() override; void Init(); - DECL_LINK( EntryTypeHdl, ListBox&, void ); + DECL_LINK( EntryTypeHdl, weld::ComboBox&, void ); public: - ScColorScale2FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = nullptr ); + ScColorScale2FrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = nullptr); virtual ~ScColorScale2FrmtEntry() override; - virtual void dispose() override; virtual ScFormatEntry* GetEntry() const override; virtual void SetActive() override; virtual void SetInactive() override; @@ -204,34 +214,33 @@ class ScColorScale3FrmtEntry : public ScCondFrmtEntry { //color format ui elements - VclPtr<ListBox> maLbColorFormat; + std::unique_ptr<weld::ComboBox> mxLbColorFormat; //color scale ui elements - VclPtr<ListBox> maLbEntryTypeMin; - VclPtr<ListBox> maLbEntryTypeMiddle; - VclPtr<ListBox> maLbEntryTypeMax; + std::unique_ptr<weld::ComboBox> mxLbEntryTypeMin; + std::unique_ptr<weld::ComboBox> mxLbEntryTypeMiddle; + std::unique_ptr<weld::ComboBox> mxLbEntryTypeMax; - VclPtr<Edit> maEdMin; - VclPtr<Edit> maEdMiddle; - VclPtr<Edit> maEdMax; + std::unique_ptr<weld::Entry> mxEdMin; + std::unique_ptr<weld::Entry> mxEdMiddle; + std::unique_ptr<weld::Entry> mxEdMax; - VclPtr<SvxColorListBox> maLbColMin; - VclPtr<SvxColorListBox> maLbColMiddle; - VclPtr<SvxColorListBox> maLbColMax; + std::unique_ptr<ColorListBox> mxLbColMin; + std::unique_ptr<ColorListBox> mxLbColMiddle; + std::unique_ptr<ColorListBox> mxLbColMax; - VclPtr<FixedText> maFtMin; - VclPtr<FixedText> maFtMax; + std::unique_ptr<weld::Label> mxFtMin; + std::unique_ptr<weld::Label> mxFtMax; ScFormatEntry* createColorscaleEntry() const; virtual OUString GetExpressionString() override; void Init(); - DECL_LINK( EntryTypeHdl, ListBox&, void ); + DECL_LINK( EntryTypeHdl, weld::ComboBox&, void ); public: - ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = nullptr ); + ScColorScale3FrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = nullptr); virtual ~ScColorScale3FrmtEntry() override; - virtual void dispose() override; virtual ScFormatEntry* GetEntry() const override; virtual void SetActive() override; virtual void SetInactive() override; @@ -241,18 +250,17 @@ public: class ScDataBarFrmtEntry : public ScCondFrmtEntry { //color format ui elements - VclPtr<ListBox> maLbColorFormat; + std::unique_ptr<weld::ComboBox> mxLbColorFormat; //data bar ui elements - VclPtr<ListBox> maLbDataBarMinType; - VclPtr<ListBox> maLbDataBarMaxType; - VclPtr<Edit> maEdDataBarMin; - VclPtr<Edit> maEdDataBarMax; - - VclPtr<PushButton> maBtOptions; + std::unique_ptr<weld::ComboBox> mxLbDataBarMinType; + std::unique_ptr<weld::ComboBox> mxLbDataBarMaxType; + std::unique_ptr<weld::Entry> mxEdDataBarMin; + std::unique_ptr<weld::Entry> mxEdDataBarMax; + std::unique_ptr<weld::Button> mxBtOptions; - VclPtr<FixedText> maFtMin; - VclPtr<FixedText> maFtMax; + std::unique_ptr<weld::Label> mxFtMin; + std::unique_ptr<weld::Label> mxFtMax; std::unique_ptr<ScDataBarFormatData> mpDataBarData; @@ -261,12 +269,11 @@ class ScDataBarFrmtEntry : public ScCondFrmtEntry virtual OUString GetExpressionString() override; void Init(); - DECL_LINK( OptionBtnHdl, Button*, void ); - DECL_LINK( DataBarTypeSelectHdl, ListBox&, void ); + DECL_LINK( OptionBtnHdl, weld::Button&, void ); + DECL_LINK( DataBarTypeSelectHdl, weld::ComboBox&, void ); public: - ScDataBarFrmtEntry( vcl::Window* pParemt, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat = nullptr ); + ScDataBarFrmtEntry(ScCondFormatList* pParemt, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat = nullptr); virtual ~ScDataBarFrmtEntry() override; - virtual void dispose() override; virtual ScFormatEntry* GetEntry() const override; virtual void SetActive() override; virtual void SetInactive() override; @@ -277,9 +284,8 @@ public: class ScDateFrmtEntry : public ScCondFrmtEntry, public SfxListener { public: - ScDateFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScCondDateFormatEntry* pFormat = nullptr ); + ScDateFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, const ScCondDateFormatEntry* pFormat = nullptr); virtual ~ScDateFrmtEntry() override; - virtual void dispose() override; virtual ScFormatEntry* GetEntry() const override; virtual void SetActive() override; virtual void SetInactive() override; @@ -293,12 +299,14 @@ protected: private: void Init(); - DECL_LINK( StyleSelectHdl, ListBox&, void ); + DECL_LINK( StyleSelectHdl, weld::ComboBox&, void ); - VclPtr<ListBox> maLbDateEntry; - VclPtr<FixedText> maFtStyle; - VclPtr<ListBox> maLbStyle; - VclPtr<SvxFontPrevWindow> maWdPreview; + FontPrevWindow maWdPreview; + std::unique_ptr<weld::ComboBox> mxLbDateEntry; + std::unique_ptr<weld::Label> mxFtStyle; + std::unique_ptr<weld::ComboBox> mxLbStyle; + std::unique_ptr<weld::Widget> mxWdPreviewWin; + std::unique_ptr<weld::CustomWeld> mxWdPreview; bool mbIsInStyleCreate; }; @@ -306,26 +314,25 @@ private: class ScIconSetFrmtEntry : public ScCondFrmtEntry { //color format ui elements - VclPtr<ListBox> maLbColorFormat; + std::unique_ptr<weld::ComboBox> mxLbColorFormat; // icon set ui elements - VclPtr<ListBox> maLbIconSetType; + std::unique_ptr<weld::ComboBox> mxLbIconSetType; - VclPtr<VclContainer> maIconParent; + std::unique_ptr<weld::Container> mxIconParent; - typedef std::vector<VclPtr<ScIconSetFrmtDataEntry>> ScIconSetFrmtDataEntriesType; + typedef std::vector<std::unique_ptr<ScIconSetFrmtDataEntry>> ScIconSetFrmtDataEntriesType; ScIconSetFrmtDataEntriesType maEntries; virtual OUString GetExpressionString() override; void Init(); - DECL_LINK( IconSetTypeHdl, ListBox&, void ); + DECL_LINK(IconSetTypeHdl, weld::ComboBox&, void); public: - ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat = nullptr ); + ScIconSetFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat = nullptr); virtual ~ScIconSetFrmtEntry() override; - virtual void dispose() override; virtual ScFormatEntry* GetEntry() const override; virtual void SetActive() override; virtual void SetInactive() override; diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index a572751e8192..1d5ab9612d0a 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -325,9 +325,6 @@ public: void DeactivateOle(); static ScTabViewShell* GetActiveViewShell(); - VclPtr<SfxModelessDialog> CreateRefDialog( SfxBindings* pB, SfxChildWindow* pCW, - const SfxChildWinInfo* pInfo, - vcl::Window* pParent, sal_uInt16 nSlotId ); std::unique_ptr<SfxModelessDialogController> CreateRefDialogController(SfxBindings* pB, SfxChildWindow* pCW, const SfxChildWinInfo* pInfo, |