summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-10-04 11:19:15 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-10-04 12:49:27 +0100
commitc5850f4b25d2b735ea59bb0ac8c2bc58527ac17e (patch)
tree8cce2ea35512412d95c38e1cba931bce00dfb505 /vcl/inc
parentd3b7a3acb481ef530094296eb4461dd343270879 (diff)
Use MenuButton for non-editable GtkComboBoxText instead of ComboBox
its more similar for the non-editable list. Requires some love to MenuButton to reflect the selected entry and resize appropiately Change-Id: I4b37931e35a5f326d6fd4e445eb741bece6b55a6
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/vcl/menu.hxx1
-rw-r--r--vcl/inc/vcl/menubtn.hxx17
2 files changed, 16 insertions, 2 deletions
diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx
index cd931c74fa61..e908119a96ae 100644
--- a/vcl/inc/vcl/menu.hxx
+++ b/vcl/inc/vcl/menu.hxx
@@ -126,6 +126,7 @@ class VCL_DLLPUBLIC Menu : public Resource
{
friend class MenuBar;
friend class MenuBarWindow;
+ friend class MenuButton;
friend class MenuFloatingWindow;
friend class PopupMenu;
friend class SystemWindow;
diff --git a/vcl/inc/vcl/menubtn.hxx b/vcl/inc/vcl/menubtn.hxx
index c9906c9dd162..02e2f5dd7edd 100644
--- a/vcl/inc/vcl/menubtn.hxx
+++ b/vcl/inc/vcl/menubtn.hxx
@@ -35,6 +35,8 @@
class Timer;
class PopupMenu;
+class VclBuilder;
+class VclSimpleEvent;
// --------------------
// - MenuButton-Types -
@@ -49,12 +51,15 @@ class PopupMenu;
class VCL_DLLPUBLIC MenuButton : public PushButton
{
private:
+ friend class VclBuilder;
+
Rectangle maFocusRect;
Timer* mpMenuTimer;
PopupMenu* mpOwnMenu;
PopupMenu* mpMenu;
- sal_uInt16 mnCurItemId;
- sal_uInt16 mnMenuMode;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnMenuMode;
+ bool mbDisplaySelectedItem;
Link maActivateHdl;
Link maSelectHdl;
@@ -62,10 +67,14 @@ private:
SAL_DLLPRIVATE void ImplExecuteMenu();
DECL_DLLPRIVATE_LINK( ImplMenuTimeoutHdl, void* );
+ SAL_DLLPRIVATE void updateText();
+
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE MenuButton( const MenuButton & );
SAL_DLLPRIVATE MenuButton& operator=( const MenuButton & );
+ DECL_LINK(MenuEventListener, VclSimpleEvent*);
+
protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
@@ -95,6 +104,10 @@ public:
const Link& GetActivateHdl() const { return maActivateHdl; }
void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
const Link& GetSelectHdl() const { return maSelectHdl; }
+
+ void SetShowDisplaySelectedItem(bool bShow);
+
+ virtual Size GetOptimalSize(WindowSizeType eType) const;
};
#endif // _SV_MENUBTN_HXX