diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-02-09 00:31:24 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-02-09 22:49:51 +0000 |
commit | 54d5b1828ec73d0475e0ddb6e31394a7e1904a1b (patch) | |
tree | 95ea5cb85d31f4cd9d79d0fedb600c5a556ba361 /include | |
parent | 8dc38dd9b132805191e0d20d00fb7559121fda15 (diff) |
tdf#105672 framework managed menu button
This adds a menu button that can use a popup menu controller
to manage its menu. It supports 2 cases:
- Use any controller that is registered in Controller.xcu,
by specifing its .uno command.
- Manage an arbitrary popup menu with MenuBarManager
(assuming its items have proper .uno commands in their
MenuItemData::aCommandStr). It means that a menu that
was defined in a .ui file, can be used inside that .ui
file without any additional code.
This commit uses the new control to fix some currently
non-working buttons in Calc's Notebookbar (but there are
more that can be fixed the same way). It's not clear how
long we will continue to use buttons (instead of
toolboxes) for the Notebookbar, but hopefully this control
will be useful in other places too.
Change-Id: Ie00cde7cd7e39948948960ca2eff76e9db837109
Reviewed-on: https://gerrit.libreoffice.org/34103
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/toolkit/awt/vclxmenu.hxx | 1 | ||||
-rw-r--r-- | include/vcl/button.hxx | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/include/toolkit/awt/vclxmenu.hxx b/include/toolkit/awt/vclxmenu.hxx index afdd52b94333..e678d8b5d945 100644 --- a/include/toolkit/awt/vclxmenu.hxx +++ b/include/toolkit/awt/vclxmenu.hxx @@ -71,6 +71,7 @@ protected: DECL_LINK( MenuEventListener, VclMenuEvent&, void ); void ImplCreateMenu( bool bPopup ); + void ImplAddListener(); public: VCLXMenu(); diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx index d8588dca30f5..b511db38f67c 100644 --- a/include/vcl/button.hxx +++ b/include/vcl/button.hxx @@ -76,6 +76,7 @@ public: /// Setup handler for UNO commands so that commands like .uno:Something are handled automagically by this button. void SetCommandHandler(const OUString& aCommand); + const OUString GetCommand() const { return maCommand; } static OUString GetStandardText( StandardButtonType eButton ); |