]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/menuitem.h
xti streaming
[wxWidgets.git] / include / wx / motif / menuitem.h
CommitLineData
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>
371a5b4e 9// Licence: wxWindows licence
23d1d521
JS
10///////////////////////////////////////////////////////////////////////////////
11
9874b4ee
VZ
12#ifndef _WX_MOTIF_MENUITEM_H
13#define _WX_MOTIF_MENUITEM_H
23d1d521 14
3399051e 15#if defined(__GNUG__) && !defined(__APPLE__)
83df96d6 16#pragma interface "menuitem.h"
23d1d521
JS
17#endif
18
5fdff4a5
JJ
19#include "wx/bitmap.h"
20
c71830c3
VZ
21class WXDLLEXPORT wxMenuBar;
22
23d1d521
JS
23// ----------------------------------------------------------------------------
24// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
25// ----------------------------------------------------------------------------
23d1d521 26
c71830c3 27class wxMenuItem : public wxMenuItemBase
9874b4ee 28{
23d1d521 29public:
9874b4ee
VZ
30 // ctor & dtor
31 wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL,
d65c269b
VZ
32 int id = wxID_SEPARATOR,
33 const wxString& text = wxEmptyString,
34 const wxString& help = wxEmptyString,
546bfbea 35 wxItemKind kind = wxITEM_NORMAL,
d65c269b 36 wxMenu *subMenu = (wxMenu *)NULL);
9874b4ee 37 ~wxMenuItem();
83df96d6 38
9874b4ee
VZ
39 // accessors (some more are inherited from wxOwnerDrawn or are below)
40 virtual void SetText(const wxString& label);
41 virtual void Enable(bool enable = TRUE);
42 virtual void Check(bool check = TRUE);
83df96d6
JS
43 // included SetBitmap and GetBitmap as copied from the GTK include file
44 // I'm not sure if this works but it silences the linker in the
45 // menu sample.
46 // JJ
5fdff4a5
JJ
47 virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
48 virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
83df96d6 49
9874b4ee 50 void DeleteSubMenu();
83df96d6 51
9874b4ee
VZ
52 // implementation from now on
53 void CreateItem (WXWidget menu, wxMenuBar * menuBar, wxMenu * topMenu);
54 void DestroyItem(bool full);
83df96d6 55
9874b4ee 56 WXWidget GetButtonWidget() const { return m_buttonWidget; }
83df96d6 57
9874b4ee
VZ
58 wxMenuBar* GetMenuBar() const { return m_menuBar; }
59 void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; }
83df96d6 60
9874b4ee
VZ
61 wxMenu* GetTopMenu() const { return m_topMenu; }
62 void SetTopMenu(wxMenu* menu) { m_topMenu = menu; }
83df96d6 63
23d1d521 64private:
9874b4ee
VZ
65 WXWidget m_buttonWidget;
66 wxMenuBar* m_menuBar;
67 wxMenu* m_topMenu; // Top-level menu e.g. popup-menu
5fdff4a5 68 wxBitmap m_bitmap; // Bitmap for menuitem, if any
83df96d6 69
9874b4ee 70 DECLARE_DYNAMIC_CLASS(wxMenuItem)
23d1d521
JS
71};
72
9874b4ee 73#endif // _WX_MOTIF_MENUITEM_H