diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-10-02 09:16:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-10-02 14:20:57 +0200 |
commit | 947150821e985c255f6c802322e696eff4257a5d (patch) | |
tree | a15b4716a91e9f5306fb02cea3c661cb91852619 /include | |
parent | d50eea97b3d2e1e1e47f7cdad4cb0c24fb0ed26d (diff) |
extend popup handler to cover all CommandEvents
Change-Id: I26360ce5c696d0e571385d83a15876eb2286e12f
Reviewed-on: https://gerrit.libreoffice.org/80021
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/templatelocalview.hxx | 2 | ||||
-rw-r--r-- | include/svx/SvxPresetListBox.hxx | 2 | ||||
-rw-r--r-- | include/vcl/customweld.hxx | 4 | ||||
-rw-r--r-- | include/vcl/layout.hxx | 8 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 7 |
5 files changed, 10 insertions, 13 deletions
diff --git a/include/sfx2/templatelocalview.hxx b/include/sfx2/templatelocalview.hxx index 1ecd60926839..51ef5032a7da 100644 --- a/include/sfx2/templatelocalview.hxx +++ b/include/sfx2/templatelocalview.hxx @@ -201,7 +201,7 @@ public: virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override; - virtual bool ContextMenu(const CommandEvent& rPos) override; + virtual bool Command(const CommandEvent& rPos) override; virtual bool KeyInput( const KeyEvent& rKEvt ) override; diff --git a/include/svx/SvxPresetListBox.hxx b/include/svx/SvxPresetListBox.hxx index 4f6f251f48df..9ba47b655853 100644 --- a/include/svx/SvxPresetListBox.hxx +++ b/include/svx/SvxPresetListBox.hxx @@ -41,7 +41,7 @@ public: SvxPresetListBox(std::unique_ptr<weld::ScrolledWindow> pWindow); virtual void Resize() override; - virtual bool ContextMenu(const CommandEvent& rEvent) override; + virtual bool Command(const CommandEvent& rEvent) override; static sal_uInt32 getColumnCount() { return nColCount; } Size const & GetIconSize() const { return aIconSize; } diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx index 47fdc99164f5..dc8fd57afd41 100644 --- a/include/vcl/customweld.hxx +++ b/include/vcl/customweld.hxx @@ -33,7 +33,7 @@ public: virtual void GetFocus() {} virtual void LoseFocus() {} virtual void StyleUpdated() { Invalidate(); } - virtual bool ContextMenu(const CommandEvent&) { return false; } + virtual bool Command(const CommandEvent&) { return false; } virtual bool KeyInput(const KeyEvent&) { return false; } virtual tools::Rectangle GetFocusRect() { return tools::Rectangle(); } virtual FactoryFunction GetUITestFactory() const { return nullptr; } @@ -104,7 +104,7 @@ private: DECL_LINK(DoLoseFocus, weld::Widget&, void); DECL_LINK(DoKeyPress, const KeyEvent&, bool); DECL_LINK(DoFocusRect, weld::Widget&, tools::Rectangle); - DECL_LINK(DoPopupMenu, const CommandEvent&, bool); + DECL_LINK(DoCommand, const CommandEvent&, bool); DECL_LINK(DoStyleUpdated, weld::Widget&, void); DECL_LINK(DoRequestHelp, tools::Rectangle&, OUString); diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx index ec40707c6306..0164b2b09df0 100644 --- a/include/vcl/layout.hxx +++ b/include/vcl/layout.hxx @@ -623,7 +623,7 @@ private: Link<const KeyEvent&, bool> m_aKeyPressHdl; Link<const KeyEvent&, bool> m_aKeyReleaseHdl; Link<VclDrawingArea&, void> m_aStyleUpdatedHdl; - Link<const CommandEvent&, bool> m_aPopupMenuHdl; + Link<const CommandEvent&, bool> m_aCommandHdl; Link<tools::Rectangle&, OUString> m_aQueryTooltipHdl; virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override @@ -680,7 +680,7 @@ private: } virtual void Command(const CommandEvent& rEvent) override { - if (rEvent.GetCommand() == CommandEventId::ContextMenu && m_aPopupMenuHdl.Call(rEvent)) + if (m_aCommandHdl.Call(rEvent)) return; Control::Command(rEvent); } @@ -760,9 +760,9 @@ public: { m_aStyleUpdatedHdl = rLink; } - void SetPopupMenuHdl(const Link<const CommandEvent&, bool>& rLink) + void SetCommandHdl(const Link<const CommandEvent&, bool>& rLink) { - m_aPopupMenuHdl = rLink; + m_aCommandHdl = rLink; } void SetQueryTooltipHdl(const Link<tools::Rectangle&, OUString>& rLink) { diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 5338ce410a62..afd6266c377e 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1708,7 +1708,7 @@ public: protected: Link<draw_args, void> m_aDrawHdl; Link<Widget&, void> m_aStyleUpdatedHdl; - Link<const CommandEvent&, bool> m_aPopupMenuHdl; + Link<const CommandEvent&, bool> m_aCommandHdl; Link<Widget&, tools::Rectangle> m_aGetFocusRectHdl; Link<tools::Rectangle&, OUString> m_aQueryTooltipHdl; @@ -1720,10 +1720,7 @@ protected: public: void connect_draw(const Link<draw_args, void>& rLink) { m_aDrawHdl = rLink; } void connect_style_updated(const Link<Widget&, void>& rLink) { m_aStyleUpdatedHdl = rLink; } - void connect_popup_menu(const Link<const CommandEvent&, bool>& rLink) - { - m_aPopupMenuHdl = rLink; - } + void connect_command(const Link<const CommandEvent&, bool>& rLink) { m_aCommandHdl = rLink; } void connect_focus_rect(const Link<Widget&, tools::Rectangle>& rLink) { m_aGetFocusRectHdl = rLink; |