1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/menuitem.h
3 // Purpose: wxMenuItem class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MOTIF_MENUITEM_H
13 #define _WX_MOTIF_MENUITEM_H
15 #include "wx/bitmap.h"
17 class WXDLLIMPEXP_FWD_CORE wxMenuBar
;
19 // ----------------------------------------------------------------------------
20 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
21 // ----------------------------------------------------------------------------
23 class WXDLLIMPEXP_CORE wxMenuItem
: public wxMenuItemBase
27 wxMenuItem(wxMenu
*parentMenu
= NULL
,
28 int id
= wxID_SEPARATOR
,
29 const wxString
& text
= wxEmptyString
,
30 const wxString
& help
= wxEmptyString
,
31 wxItemKind kind
= wxITEM_NORMAL
,
32 wxMenu
*subMenu
= NULL
);
33 virtual ~wxMenuItem();
35 // accessors (some more are inherited from wxOwnerDrawn or are below)
36 virtual void SetItemLabel(const wxString
& label
);
37 virtual void Enable(bool enable
= true);
38 virtual void Check(bool check
= true);
39 // included SetBitmap and GetBitmap as copied from the GTK include file
40 // I'm not sure if this works but it silences the linker in the
43 virtual void SetBitmap(const wxBitmap
& bitmap
) { m_bitmap
= bitmap
; }
44 virtual const wxBitmap
& GetBitmap() const { return m_bitmap
; }
46 // implementation from now on
47 void CreateItem (WXWidget menu
, wxMenuBar
* menuBar
, wxMenu
* topMenu
,
49 void DestroyItem(bool full
);
51 WXWidget
GetButtonWidget() const { return m_buttonWidget
; }
53 wxMenuBar
* GetMenuBar() const { return m_menuBar
; }
54 void SetMenuBar(wxMenuBar
* menuBar
) { m_menuBar
= menuBar
; }
56 wxMenu
* GetTopMenu() const { return m_topMenu
; }
57 void SetTopMenu(wxMenu
* menu
) { m_topMenu
= menu
; }
60 WXWidget m_buttonWidget
;
62 wxMenu
* m_topMenu
; // Top-level menu e.g. popup-menu
63 wxBitmap m_bitmap
; // Bitmap for menuitem, if any
65 DECLARE_DYNAMIC_CLASS(wxMenuItem
)
68 #endif // _WX_MOTIF_MENUITEM_H