summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-02-10 11:36:53 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-02-11 12:28:19 +0100
commit6c01bbab45eb16356d345ae2f6bfd6a864dd59e1 (patch)
tree5c3d0d273c3a6a70e804b474f6f9a9c0a5e19ebb /include
parent1783d7b1f522810dec3cdd02e8ac8bf688c734cf (diff)
weld FillControl item window
Change-Id: I5f943a9cf881494fe8a9fecea6a957a7085a5582 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88378 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/svx/fillctrl.hxx43
-rw-r--r--include/svx/itemwin.hxx54
2 files changed, 36 insertions, 61 deletions
diff --git a/include/svx/fillctrl.hxx b/include/svx/fillctrl.hxx
index 5278fc31e718..e7a77692b129 100644
--- a/include/svx/fillctrl.hxx
+++ b/include/svx/fillctrl.hxx
@@ -21,7 +21,9 @@
#define INCLUDED_SVX_FILLCTRL_HXX
#include <memory>
+#include <sfx2/InterimItemWindow.hxx>
#include <sfx2/tbxctrl.hxx>
+#include <sfx2/weldutils.hxx>
#include <svx/svxdllapi.h>
#include <com/sun/star/drawing/FillStyle.hpp>
@@ -31,9 +33,6 @@ class XFillGradientItem;
class XFillHatchItem;
class XFillBitmapItem;
class FillControl;
-class SvxFillTypeBox;
-class SvxFillAttrBox;
-class ListBox;
/*************************************************************************
|*
@@ -50,18 +49,18 @@ private:
std::unique_ptr< XFillHatchItem > mpHatchItem;
std::unique_ptr< XFillBitmapItem > mpBitmapItem;
- VclPtr<FillControl> mpFillControl;
- VclPtr<SvxFillTypeBox> mpLbFillType;
- VclPtr<ToolBox> mpToolBoxColor;
- VclPtr<SvxFillAttrBox> mpLbFillAttr;
+ VclPtr<FillControl> mxFillControl;
+ weld::ComboBox* mpLbFillType;
+ weld::Toolbar* mpToolBoxColor;
+ weld::ComboBox* mpLbFillAttr;
css::drawing::FillStyle meLastXFS;
sal_Int32 mnLastPosGradient;
sal_Int32 mnLastPosHatch;
sal_Int32 mnLastPosBitmap;
- DECL_LINK(SelectFillTypeHdl, ListBox&, void);
- DECL_LINK(SelectFillAttrHdl, ListBox&, void);
+ DECL_LINK(SelectFillTypeHdl, weld::ComboBox&, void);
+ DECL_LINK(SelectFillAttrHdl, weld::ComboBox&, void);
public:
SFX_DECL_TOOLBOX_CONTROL();
@@ -74,25 +73,37 @@ public:
virtual VclPtr<vcl::Window> CreateItemWindow(vcl::Window* pParent) override;
};
-class SAL_WARN_UNUSED FillControl : public vcl::Window
+class SAL_WARN_UNUSED FillControl final : public InterimItemWindow
{
private:
friend class SvxFillToolBoxControl;
- VclPtr<SvxFillTypeBox> mpLbFillType;
- VclPtr<ToolBox> mpToolBoxColor;
- VclPtr<SvxFillAttrBox> mpLbFillAttr;
+ std::unique_ptr<weld::ComboBox> mxLbFillType;
+ std::unique_ptr<weld::Toolbar> mxToolBoxColor;
+ std::unique_ptr<ToolbarUnoDispatcher> mxColorDispatch;
+ std::unique_ptr<weld::ComboBox> mxLbFillAttr;
+ int mnTypeCurPos;
+ int mnAttrCurPos;
+
+ DECL_LINK(AttrKeyInputHdl, const KeyEvent&, bool);
+ DECL_LINK(TypeKeyInputHdl, const KeyEvent&, bool);
+ DECL_LINK(ColorKeyInputHdl, const KeyEvent&, bool);
+ DECL_STATIC_LINK(FillControl, DumpAsPropertyTreeHdl, boost::property_tree::ptree&, void);
+ DECL_LINK(AttrFocusHdl, weld::Widget&, void);
+ DECL_LINK(TypeFocusHdl, weld::Widget&, void);
void SetOptimalSize();
virtual void DataChanged(const DataChangedEvent& rDCEvt) override;
+ static void ReleaseFocus_Impl();
+
public:
- FillControl(vcl::Window* pParent);
- virtual ~FillControl() override;
+ FillControl(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rFrame);
virtual void dispose() override;
+ virtual ~FillControl() override;
- virtual void Resize() override;
+ virtual void GetFocus() override;
};
#endif // INCLUDED_SVX_FILLCTRL_HXX
diff --git a/include/svx/itemwin.hxx b/include/svx/itemwin.hxx
index 964d80f1a2e2..570a6cdbb4bd 100644
--- a/include/svx/itemwin.hxx
+++ b/include/svx/itemwin.hxx
@@ -19,8 +19,6 @@
#ifndef INCLUDED_SVX_ITEMWIN_HXX
#define INCLUDED_SVX_ITEMWIN_HXX
-#include <vcl/field.hxx>
-#include <vcl/lstbox.hxx>
#include <sfx2/InterimItemWindow.hxx>
#include <svtools/toolbarmenu.hxx>
#include <svx/dlgctrl.hxx>
@@ -81,52 +79,18 @@ public:
void set_sensitive(bool bSensitive);
};
-class SVX_DLLPUBLIC SvxFillTypeBox final : public ListBox
+namespace SvxFillTypeBox
{
-public:
- SvxFillTypeBox( vcl::Window* pParent );
-
- void Fill();
-
- static void Fill(weld::ComboBox& rListBox);
-
- void Selected() { bSelect = true; }
- virtual boost::property_tree::ptree DumpAsPropertyTree() override;
-
-private:
- virtual bool PreNotify( NotifyEvent& rNEvt ) override;
- virtual bool EventNotify( NotifyEvent& rNEvt ) override;
-
- sal_uInt16 nCurPos;
- bool bSelect;
-
- static void ReleaseFocus_Impl();
-};
+ SVX_DLLPUBLIC void Fill(weld::ComboBox& rListBox);
+}
-class SVX_DLLPUBLIC SvxFillAttrBox final : public ListBox
+namespace SvxFillAttrBox
{
-public:
- SvxFillAttrBox( vcl::Window* pParent );
-
- void Fill( const XHatchListRef &pList );
- void Fill( const XGradientListRef &pList );
- void Fill( const XBitmapListRef &pList );
- void Fill( const XPatternListRef &pList );
-
- static void Fill(weld::ComboBox&, const XHatchListRef &pList);
- static void Fill(weld::ComboBox&, const XGradientListRef &pList);
- static void Fill(weld::ComboBox&, const XBitmapListRef &pList);
- static void Fill(weld::ComboBox&, const XPatternListRef &pList);
-
-private:
- virtual bool PreNotify( NotifyEvent& rNEvt ) override;
- virtual bool EventNotify( NotifyEvent& rNEvt ) override;
-
- sal_uInt16 nCurPos;
- BitmapEx maBitmapEx;
-
- static void ReleaseFocus_Impl();
-};
+ SVX_DLLPUBLIC void Fill(weld::ComboBox&, const XHatchListRef &pList);
+ SVX_DLLPUBLIC void Fill(weld::ComboBox&, const XGradientListRef &pList);
+ SVX_DLLPUBLIC void Fill(weld::ComboBox&, const XBitmapListRef &pList);
+ SVX_DLLPUBLIC void Fill(weld::ComboBox&, const XPatternListRef &pList);
+}
#endif // INCLUDED_SVX_ITEMWIN_HXX