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