1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk1/menuitem.h
3 // Purpose: wxMenuItem class
4 // Author: Robert Roebling
5 // Copyright: (c) 1998 Robert Roebling
6 // Licence: wxWindows licence
7 ///////////////////////////////////////////////////////////////////////////////
9 #ifndef __GTKMENUITEMH__
10 #define __GTKMENUITEMH__
12 #include "wx/bitmap.h"
14 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
18 class WXDLLIMPEXP_CORE wxMenuItem
: public wxMenuItemBase
21 wxMenuItem(wxMenu
*parentMenu
= NULL
,
22 int id
= wxID_SEPARATOR
,
23 const wxString
& text
= wxEmptyString
,
24 const wxString
& help
= wxEmptyString
,
25 wxItemKind kind
= wxITEM_NORMAL
,
26 wxMenu
*subMenu
= NULL
);
27 virtual ~wxMenuItem();
29 // implement base class virtuals
30 virtual void SetItemLabel( const wxString
& str
);
31 virtual wxString
GetItemLabel() const;
32 virtual void Enable( bool enable
= TRUE
);
33 virtual void Check( bool check
= TRUE
);
34 virtual bool IsChecked() const;
35 virtual void SetBitmap(const wxBitmap
& bitmap
) { m_bitmap
= bitmap
; }
36 virtual const wxBitmap
& GetBitmap() const { return m_bitmap
; }
39 virtual wxAcceleratorEntry
*GetAccel() const;
43 void SetMenuItem(GtkWidget
*menuItem
) { m_menuItem
= menuItem
; }
44 GtkWidget
*GetMenuItem() const { return m_menuItem
; }
45 GtkWidget
*GetLabelWidget() const { return m_labelWidget
; }
46 void SetLabelWidget(GtkWidget
*labelWidget
) { m_labelWidget
= labelWidget
; }
47 wxString
GetFactoryPath() const;
49 wxString
GetHotKey() const { return m_hotKey
; }
51 // compatibility only, don't use in new code
52 wxMenuItem(wxMenu
*parentMenu
,
57 wxMenu
*subMenu
= NULL
);
60 // common part of all ctors
63 // DoSetText() transforms the accel mnemonics in our label from MSW/wxWin
64 // style to GTK+ and is called from ctor and SetText()
65 void DoSetText(const wxString
& text
);
68 wxBitmap m_bitmap
; // Bitmap for menuitem, if any
70 GtkWidget
*m_menuItem
; // GtkMenuItem
71 GtkWidget
* m_labelWidget
; // Label widget
73 DECLARE_DYNAMIC_CLASS(wxMenuItem
)