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