diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-01-28 20:40:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-01-29 12:56:49 +0100 |
commit | 644ebf7823c85973e2724cbfcf403cb63b054bfe (patch) | |
tree | 01320bd836d0e05d7964aaf0277ddd08e8e3f1c6 /starmath/inc | |
parent | f51c36c107b3474ab99db76497b1f9c9c510248d (diff) |
weld SmElementsDockingWindow
Change-Id: Ieeaa1f1e0deb708ec6d3daf261384c61d2ade22b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87659
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath/inc')
-rw-r--r-- | starmath/inc/AccessibleSmElement.hxx | 2 | ||||
-rw-r--r-- | starmath/inc/AccessibleSmElementsControl.hxx | 6 | ||||
-rw-r--r-- | starmath/inc/ElementsDockingWindow.hxx | 42 |
3 files changed, 23 insertions, 27 deletions
diff --git a/starmath/inc/AccessibleSmElement.hxx b/starmath/inc/AccessibleSmElement.hxx index 9f63d1607ef7..202de6690899 100644 --- a/starmath/inc/AccessibleSmElement.hxx +++ b/starmath/inc/AccessibleSmElement.hxx @@ -40,7 +40,7 @@ typedef ::cppu::ImplHelper3<css::lang::XServiceInfo, css::accessibility::XAccess class AccessibleSmElement final : public comphelper::OAccessibleComponentHelper, public AccessibleSmElement_BASE { - VclPtr<SmElementsControl> m_pSmElementsControl; + SmElementsControl* m_pSmElementsControl; const sal_Int32 m_nIndexInParent; ///< index in the parent XAccessible const sal_uInt16 m_nItemId; ///< index in the SmElementsControl bool m_bHasFocus; diff --git a/starmath/inc/AccessibleSmElementsControl.hxx b/starmath/inc/AccessibleSmElementsControl.hxx index ac0b68afa892..66cbd80bcef4 100644 --- a/starmath/inc/AccessibleSmElementsControl.hxx +++ b/starmath/inc/AccessibleSmElementsControl.hxx @@ -38,7 +38,7 @@ class AccessibleSmElementsControl final : public comphelper::OAccessibleComponen public AccessibleSmElementsControl_BASE { std::vector<rtl::Reference<AccessibleSmElement>> m_aAccessibleChildren; - VclPtr<SmElementsControl> m_pControl; + SmElementsControl* m_pControl; void UpdateFocus(sal_uInt16); inline void TestControl(); @@ -71,10 +71,6 @@ public: sal_Bool SAL_CALL containsPoint(const css::awt::Point& aPoint) override; css::uno::Reference<css::accessibility::XAccessible> SAL_CALL getAccessibleAtPoint(const css::awt::Point& aPoint) override; - css::awt::Rectangle SAL_CALL getBounds() override; - css::awt::Point SAL_CALL getLocation() override; - css::awt::Point SAL_CALL getLocationOnScreen() override; - css::awt::Size SAL_CALL getSize() override; void SAL_CALL grabFocus() override; sal_Int32 SAL_CALL getForeground() override; sal_Int32 SAL_CALL getBackground() override; diff --git a/starmath/inc/ElementsDockingWindow.hxx b/starmath/inc/ElementsDockingWindow.hxx index c5645b70894a..5a5a46836658 100644 --- a/starmath/inc/ElementsDockingWindow.hxx +++ b/starmath/inc/ElementsDockingWindow.hxx @@ -21,7 +21,8 @@ #define INCLUDED_STARMATH_INC_ELEMENTSDOCKINGWINDOW_HXX #include <sfx2/dockwin.hxx> -#include <vcl/scrbar.hxx> +#include <vcl/customweld.hxx> +#include <vcl/weld.hxx> #include "format.hxx" #include <memory> @@ -63,7 +64,7 @@ public: typedef std::pair<const char*, const char*> SmElementDescr; -class SmElementsControl : public Control +class SmElementsControl : public weld::CustomWidgetController { friend class ElementSelectorUIObject; friend class ElementUIObject; @@ -81,16 +82,14 @@ class SmElementsControl : public Control static const std::tuple<const char*, const SmElementDescr*, size_t> m_aCategories[]; static const size_t m_aCategoriesSize; - virtual void ApplySettings(vcl::RenderContext&) override; - virtual void DataChanged(const DataChangedEvent&) override; virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override; - virtual void MouseButtonDown(const MouseEvent& rMEvt) override; - virtual void MouseMove(const MouseEvent& rMEvt) override; - virtual void RequestHelp(const HelpEvent& rHEvt) override; + virtual bool MouseButtonDown(const MouseEvent& rMEvt) override; + virtual bool MouseMove(const MouseEvent& rMEvt) override; + virtual OUString RequestHelp(tools::Rectangle& rRect) override; virtual void Resize() override; virtual void GetFocus() override; virtual void LoseFocus() override; - virtual void KeyInput(const KeyEvent& rKEvt) override; + virtual bool KeyInput(const KeyEvent& rKEvt) override; css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override; SmDocShell* mpDocShell; @@ -104,7 +103,7 @@ class SmElementsControl : public Control std::vector< std::unique_ptr<SmElement> > maElementList; Size maMaxElementDimensions; bool mbVerticalMode; - VclPtr< ScrollBar > mxScroll; + std::unique_ptr<weld::ScrolledWindow> mxScroll; bool m_bFirstPaintAfterLayout; rtl::Reference<AccessibleSmElementsControl> m_xAccessible; @@ -122,14 +121,12 @@ class SmElementsControl : public Control void build(); - //if pContext is not NULL, then draw, otherwise - //just layout - void LayoutOrPaintContents(vcl::RenderContext *pContext = nullptr); + //if bDraw is true, then draw, otherwise just layout + void LayoutOrPaintContents(vcl::RenderContext& rContext, bool bDraw); public: - explicit SmElementsControl(vcl::Window *pParent); + explicit SmElementsControl(std::unique_ptr<weld::ScrolledWindow> xScrolledWindow); virtual ~SmElementsControl() override; - virtual void dispose() override; static const auto& categories() { return m_aCategories; } static size_t categoriesSize() { return m_aCategoriesSize; } @@ -148,28 +145,31 @@ public: bool itemTrigger(sal_uInt16); void setItemHighlighted(sal_uInt16); sal_uInt16 itemOffset() const { return m_nCurrentOffset; } - css::uno::Reference<css::accessibility::XAccessible> scrollbarAccessible() const; - Size GetOptimalSize() const override; + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; - DECL_LINK( ScrollHdl, ScrollBar*, void ); - void DoScroll(long nDelta); + DECL_LINK( ScrollHdl, weld::ScrolledWindow&, void ); void SetSelectHdl(const Link<SmElement&,void>& rLink) { maSelectHdlLink = rLink; } + rtl::Reference<AccessibleSmElementsControl> GetAccessible() const { return m_xAccessible; } + static Color GetTextColor(); + static Color GetControlBackground(); + virtual FactoryFunction GetUITestFactory() const override; }; class SmElementsDockingWindow final : public SfxDockingWindow { - VclPtr<SmElementsControl> mpElementsControl; - VclPtr<ListBox> mpElementListBox; + std::unique_ptr<SmElementsControl> mxElementsControl; + std::unique_ptr<weld::CustomWeld> mxElementsControlWin; + std::unique_ptr<weld::ComboBox> mxElementListBox; virtual void Resize() override; SmViewShell* GetView(); DECL_LINK(SelectClickHandler, SmElement&, void); - DECL_LINK(ElementSelectedHandle, ListBox&, void); + DECL_LINK(ElementSelectedHandle, weld::ComboBox&, void); public: |