]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/menuitem.h
Better name for wxXmlResource::GetDirection() argument.
[wxWidgets.git] / include / wx / motif / menuitem.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/menuitem.h
3 // Purpose: wxMenuItem class
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 11.11.97
7 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_MOTIF_MENUITEM_H
12 #define _WX_MOTIF_MENUITEM_H
13
14 #include "wx/bitmap.h"
15
16 class WXDLLIMPEXP_FWD_CORE wxMenuBar;
17
18 // ----------------------------------------------------------------------------
19 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
20 // ----------------------------------------------------------------------------
21
22 class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase
23 {
24 public:
25 // ctor & dtor
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();
33
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
40 // menu sample.
41 // JJ
42 virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
43 virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
44
45 // implementation from now on
46 void CreateItem (WXWidget menu, wxMenuBar * menuBar, wxMenu * topMenu,
47 size_t index);
48 void DestroyItem(bool full);
49
50 WXWidget GetButtonWidget() const { return m_buttonWidget; }
51
52 wxMenuBar* GetMenuBar() const { return m_menuBar; }
53 void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; }
54
55 wxMenu* GetTopMenu() const { return m_topMenu; }
56 void SetTopMenu(wxMenu* menu) { m_topMenu = menu; }
57
58 private:
59 WXWidget m_buttonWidget;
60 wxMenuBar* m_menuBar;
61 wxMenu* m_topMenu; // Top-level menu e.g. popup-menu
62 wxBitmap m_bitmap; // Bitmap for menuitem, if any
63
64 DECLARE_DYNAMIC_CLASS(wxMenuItem)
65 };
66
67 #endif // _WX_MOTIF_MENUITEM_H