]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/menuitem.h
1. wxMenu{Item|Bar} modifications for wxMotif
[wxWidgets.git] / include / wx / motif / menuitem.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: menuitem.h
3 // Purpose: wxMenuItem class
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 11.11.97
7 // RCS-ID: $Id$
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_MOTIF_MENUITEM_H
13 #define _WX_MOTIF_MENUITEM_H
14
15 #ifdef __GNUG__
16 #pragma interface "menuitem.h"
17 #endif
18
19 // ----------------------------------------------------------------------------
20 // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
21 // ----------------------------------------------------------------------------
22
23 class WXDLLEXPORT wxMenuItem: public wxMenuItemBase
24 {
25 public:
26 // ctor & dtor
27 wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL,
28 int id = wxID_SEPARATOR,
29 const wxString& text = wxEmptyString,
30 const wxString& help = wxEmptyString,
31 bool isCheckable = FALSE,
32 wxMenu *subMenu = (wxMenu *)NULL);
33 ~wxMenuItem();
34
35 // accessors (some more are inherited from wxOwnerDrawn or are below)
36 virtual void SetText(const wxString& label);
37 virtual void Enable(bool enable = TRUE);
38 virtual void Check(bool check = TRUE);
39
40 void DeleteSubMenu();
41
42 // implementation from now on
43 void CreateItem (WXWidget menu, wxMenuBar * menuBar, wxMenu * topMenu);
44 void DestroyItem(bool full);
45
46 WXWidget GetButtonWidget() const { return m_buttonWidget; }
47
48 wxMenuBar* GetMenuBar() const { return m_menuBar; }
49 void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; }
50
51 wxMenu* GetTopMenu() const { return m_topMenu; }
52 void SetTopMenu(wxMenu* menu) { m_topMenu = menu; }
53
54 private:
55 WXWidget m_buttonWidget;
56 wxMenuBar* m_menuBar;
57 wxMenu* m_topMenu; // Top-level menu e.g. popup-menu
58
59 DECLARE_DYNAMIC_CLASS(wxMenuItem)
60 };
61
62 #endif // _WX_MOTIF_MENUITEM_H