]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/menuitem.h
Checking for wxUSE_SOCKETS and __GSOCKET_STANDALONE__ should be right, now
[wxWidgets.git] / include / wx / gtk / menuitem.h
CommitLineData
23d1d521
JS
1///////////////////////////////////////////////////////////////////////////////
2// Name: menuitem.h
3// Purpose: wxMenuItem class
6ca41e57 4// Author: Robert Roebling
23d1d521 5// RCS-ID: $Id$
6ca41e57 6// Copyright: (c) 1998 Robert Roebling
23d1d521
JS
7// Licence: wxWindows license
8///////////////////////////////////////////////////////////////////////////////
9
6ca41e57
RR
10#ifndef __GTKMENUITEMH__
11#define __GTKMENUITEMH__
23d1d521
JS
12
13#ifdef __GNUG__
6ca41e57 14#pragma interface
23d1d521
JS
15#endif
16
6ca41e57
RR
17#include "wx/defs.h"
18#include "wx/string.h"
23d1d521
JS
19
20// ----------------------------------------------------------------------------
21// constants
22// ----------------------------------------------------------------------------
23
23d1d521
JS
24#define ID_SEPARATOR (-1)
25
6ca41e57
RR
26//-----------------------------------------------------------------------------
27// classes
28//-----------------------------------------------------------------------------
23d1d521 29
6ca41e57 30class wxMenuItem;
6ca41e57 31class wxMenu;
23d1d521 32
6ca41e57
RR
33//-----------------------------------------------------------------------------
34// wxMenuItem
35//-----------------------------------------------------------------------------
23d1d521 36
c626a8b7 37class wxMenuItem : public wxObject
6ca41e57
RR
38{
39DECLARE_DYNAMIC_CLASS(wxMenuItem)
23d1d521 40
6ca41e57 41public:
c626a8b7
VZ
42 wxMenuItem();
43
44 // accessors
45 // id
46 void SetId(int id) { m_id = id; }
47 int GetId() const { return m_id; }
48 bool IsSeparator() const { return m_id == ID_SEPARATOR; }
49
50 // the item's text = name
51 void SetName(const wxString& str);
52 void SetText(const wxString& str) { SetName(str); } // compatibility
53 const wxString& GetName() const { return m_text; }
54 const wxString& GetText() const { return GetName(); }
55
56 // what kind of menu item we are
57 void SetCheckable(bool checkable) { m_isCheckMenu = checkable; }
58 bool IsCheckable() const { return m_isCheckMenu; }
59 void SetSubMenu(wxMenu *menu) { m_subMenu = menu; }
60 wxMenu *GetSubMenu() const { return m_subMenu; }
61 bool IsSubMenu() const { return m_subMenu != NULL; }
62
63 // state
64 void Enable( bool enable = TRUE );
65 bool IsEnabled() const { return m_isEnabled; }
66 void Check( bool check = TRUE );
67 bool IsChecked() const;
68
69 // help string (displayed in the status bar by default)
70 void SetHelp(const wxString& str) { m_helpStr = str; }
71 const wxString& GetHelp() const { return m_helpStr; }
72
73 // implementation
74 void SetMenuItem(GtkWidget *menuItem) { m_menuItem = menuItem; }
75 GtkWidget *GetMenuItem() const { return m_menuItem; }
ab46dc18
RR
76
77 wxString GetHotKey() const { return m_hotKey; }
c626a8b7
VZ
78
79 void SetCheckedFlag(bool checked) { m_isChecked = checked; }
80 bool GetCheckedFlag() const { return m_isChecked; }
81
82private:
83 int m_id;
84 wxString m_text;
ab46dc18 85 wxString m_hotKey;
c626a8b7
VZ
86 bool m_isCheckMenu;
87 bool m_isChecked;
88 bool m_isEnabled;
89 wxMenu *m_subMenu;
90 wxString m_helpStr;
91
92 GtkWidget *m_menuItem; // GtkMenuItem
23d1d521
JS
93};
94
6ca41e57 95
8bbe427f 96#endif
6ca41e57 97 //__GTKMENUITEMH__