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