]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/menuitem.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMenuItem class
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows license
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef __GTKMENUITEMH__
11 #define __GTKMENUITEMH__
17 #include "wx/bitmap.h"
19 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
23 class wxMenuItem
: public wxMenuItemBase
26 wxMenuItem(wxMenu
*parentMenu
= (wxMenu
*)NULL
,
27 int id
= wxID_SEPARATOR
,
28 const wxString
& text
= wxEmptyString
,
29 const wxString
& help
= wxEmptyString
,
30 wxItemKind kind
= wxITEM_NORMAL
,
31 wxMenu
*subMenu
= (wxMenu
*)NULL
);
34 // implement base class virtuals
35 virtual void SetText( const wxString
& str
);
36 virtual void Enable( bool enable
= TRUE
);
37 virtual void Check( bool check
= TRUE
);
38 virtual bool IsChecked() const;
39 virtual void SetBitmap(const wxBitmap
& bitmap
) { m_bitmap
= bitmap
; }
40 virtual const wxBitmap
& GetBitmap() const { return m_bitmap
; }
43 virtual wxAcceleratorEntry
*GetAccel() const;
47 void SetMenuItem(GtkWidget
*menuItem
) { m_menuItem
= menuItem
; }
48 GtkWidget
*GetMenuItem() const { return m_menuItem
; }
49 GtkWidget
*GetLabelWidget() const { return m_labelWidget
; }
50 void SetLabelWidget(GtkWidget
*labelWidget
) { m_labelWidget
= labelWidget
; }
51 wxString
GetFactoryPath() const;
53 wxString
GetHotKey() const { return m_hotKey
; }
55 // compatibility only, don't use in new code
56 wxMenuItem(wxMenu
*parentMenu
,
61 wxMenu
*subMenu
= (wxMenu
*)NULL
);
64 // common part of all ctors
65 void Init(const wxString
& text
);
67 // DoSetText() transforms the accel mnemonics in our label from MSW/wxWin
68 // style to GTK+ and is called from ctor and SetText()
69 void DoSetText(const wxString
& text
);
72 wxBitmap m_bitmap
; // Bitmap for menuitem, if any
74 GtkWidget
*m_menuItem
; // GtkMenuItem
75 GtkWidget
* m_labelWidget
; // Label widget
77 DECLARE_DYNAMIC_CLASS(wxMenuItem
)