]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/menuitem.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMenuItem class
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows license
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef __GTKMENUITEMH__
11 #define __GTKMENUITEMH__
18 #include "wx/string.h"
20 // ----------------------------------------------------------------------------
22 // ----------------------------------------------------------------------------
24 #define ID_SEPARATOR (-1)
26 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
33 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
37 class wxMenuItem
: public wxObject
39 DECLARE_DYNAMIC_CLASS(wxMenuItem
)
46 void SetId(int id
) { m_id
= id
; }
47 int GetId() const { return m_id
; }
48 bool IsSeparator() const { return m_id
== ID_SEPARATOR
; }
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(); }
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
; }
64 void Enable( bool enable
= TRUE
);
65 bool IsEnabled() const { return m_isEnabled
; }
66 void Check( bool check
= TRUE
);
67 bool IsChecked() const;
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
; }
74 void SetMenuItem(GtkWidget
*menuItem
) { m_menuItem
= menuItem
; }
75 GtkWidget
*GetMenuItem() const { return m_menuItem
; }
77 wxString
GetHotKey() const { return m_hotKey
; }
79 void SetCheckedFlag(bool checked
) { m_isChecked
= checked
; }
80 bool GetCheckedFlag() const { return m_isChecked
; }
92 GtkWidget
*m_menuItem
; // GtkMenuItem