1 ///////////////////////////////////////////////////////////////////////////////
2 // Name:        wx/gtk/menuitem.h
3 // Purpose:     wxMenuItem class
4 // Author:      Robert Roebling
5 // Copyright:   (c) 1998 Robert Roebling
6 // Licence:     wxWindows licence
7 ///////////////////////////////////////////////////////////////////////////////
8 
9 #ifndef _WX_GTKMENUITEM_H_
10 #define _WX_GTKMENUITEM_H_
11 
12 #include "wx/bitmap.h"
13 
14 //-----------------------------------------------------------------------------
15 // wxMenuItem
16 //-----------------------------------------------------------------------------
17 
18 class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase
19 {
20 public:
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();
28 
29     // implement base class virtuals
30     virtual void SetItemLabel( const wxString& str ) wxOVERRIDE;
31     virtual void Enable( bool enable = true ) wxOVERRIDE;
32     virtual void Check( bool check = true ) wxOVERRIDE;
33     virtual bool IsChecked() const wxOVERRIDE;
34     virtual void SetBitmap(const wxBitmap& bitmap);
GetBitmap()35     virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
36 
37     // implementation
38     void SetMenuItem(GtkWidget *menuItem);
GetMenuItem()39     GtkWidget *GetMenuItem() const { return m_menuItem; }
40     void SetGtkLabel();
41 
42 #if WXWIN_COMPATIBILITY_2_8
43     // compatibility only, don't use in new code
44     wxDEPRECATED_CONSTRUCTOR(
45     wxMenuItem(wxMenu *parentMenu,
46                int id,
47                const wxString& text,
48                const wxString& help,
49                bool isCheckable,
50                wxMenu *subMenu = NULL)
51     );
52 #endif
53 
54 private:
55     wxBitmap  m_bitmap; // Bitmap for menuitem, if any
56     GtkWidget *m_menuItem;  // GtkMenuItem
57 
58     wxDECLARE_DYNAMIC_CLASS(wxMenuItem);
59 };
60 
61 #endif // _WX_GTKMENUITEM_H_
62