]>
Commit | Line | Data |
---|---|---|
23d1d521 JS |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: menuitem.h | |
3 | // Purpose: wxMenuItem class | |
4 | // Author: Vadim Zeitlin | |
3b59cdbf | 5 | // Modified by: |
23d1d521 JS |
6 | // Created: 11.11.97 |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> | |
65571936 | 9 | // Licence: wxWindows licence |
23d1d521 JS |
10 | /////////////////////////////////////////////////////////////////////////////// |
11 | ||
9874b4ee VZ |
12 | #ifndef _WX_MOTIF_MENUITEM_H |
13 | #define _WX_MOTIF_MENUITEM_H | |
23d1d521 | 14 | |
5fdff4a5 JJ |
15 | #include "wx/bitmap.h" |
16 | ||
c71830c3 VZ |
17 | class WXDLLEXPORT wxMenuBar; |
18 | ||
23d1d521 JS |
19 | // ---------------------------------------------------------------------------- |
20 | // wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour | |
21 | // ---------------------------------------------------------------------------- | |
23d1d521 | 22 | |
94c7b088 | 23 | class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase |
9874b4ee | 24 | { |
23d1d521 | 25 | public: |
9874b4ee VZ |
26 | // ctor & dtor |
27 | wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL, | |
d65c269b VZ |
28 | int id = wxID_SEPARATOR, |
29 | const wxString& text = wxEmptyString, | |
30 | const wxString& help = wxEmptyString, | |
546bfbea | 31 | wxItemKind kind = wxITEM_NORMAL, |
d65c269b | 32 | wxMenu *subMenu = (wxMenu *)NULL); |
9874b4ee | 33 | ~wxMenuItem(); |
83df96d6 | 34 | |
9874b4ee VZ |
35 | // accessors (some more are inherited from wxOwnerDrawn or are below) |
36 | virtual void SetText(const wxString& label); | |
96be256b MB |
37 | virtual void Enable(bool enable = true); |
38 | virtual void Check(bool check = true); | |
83df96d6 JS |
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 | |
5fdff4a5 JJ |
43 | virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; } |
44 | virtual const wxBitmap& GetBitmap() const { return m_bitmap; } | |
83df96d6 | 45 | |
9874b4ee VZ |
46 | // implementation from now on |
47 | void CreateItem (WXWidget menu, wxMenuBar * menuBar, wxMenu * topMenu); | |
48 | void DestroyItem(bool full); | |
83df96d6 | 49 | |
9874b4ee | 50 | WXWidget GetButtonWidget() const { return m_buttonWidget; } |
83df96d6 | 51 | |
9874b4ee VZ |
52 | wxMenuBar* GetMenuBar() const { return m_menuBar; } |
53 | void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; } | |
83df96d6 | 54 | |
9874b4ee VZ |
55 | wxMenu* GetTopMenu() const { return m_topMenu; } |
56 | void SetTopMenu(wxMenu* menu) { m_topMenu = menu; } | |
83df96d6 | 57 | |
23d1d521 | 58 | private: |
9874b4ee VZ |
59 | WXWidget m_buttonWidget; |
60 | wxMenuBar* m_menuBar; | |
61 | wxMenu* m_topMenu; // Top-level menu e.g. popup-menu | |
5fdff4a5 | 62 | wxBitmap m_bitmap; // Bitmap for menuitem, if any |
83df96d6 | 63 | |
9874b4ee | 64 | DECLARE_DYNAMIC_CLASS(wxMenuItem) |
23d1d521 JS |
65 | }; |
66 | ||
9874b4ee | 67 | #endif // _WX_MOTIF_MENUITEM_H |