]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/menuitem.h
1. wxMenu changes: wxMenuBase appears, several new functions for dynamic menu
[wxWidgets.git] / include / wx / gtk / menuitem.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: menuitem.h
3 // Purpose: wxMenuItem class
4 // Author: Robert Roebling
5 // RCS-ID: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows license
8 ///////////////////////////////////////////////////////////////////////////////
9
10 #ifndef __GTKMENUITEMH__
11 #define __GTKMENUITEMH__
12
13 #ifdef __GNUG__
14 #pragma interface
15 #endif
16
17 //-----------------------------------------------------------------------------
18 // wxMenuItem
19 //-----------------------------------------------------------------------------
20
21 class wxMenuItem : public wxMenuItemBase
22 {
23 public:
24 wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL,
25 int id = wxID_SEPARATOR,
26 const wxString& text = wxEmptyString,
27 const wxString& help = wxEmptyString,
28 bool isCheckable = FALSE,
29 wxMenu *subMenu = (wxMenu *)NULL);
30 ~wxMenuItem();
31
32 // implement base class virtuals
33 virtual void SetText( const wxString& str );
34 virtual wxString GetLabel() const;
35 virtual void Enable( bool enable = TRUE );
36 virtual void Check( bool check = TRUE );
37 virtual bool IsChecked() const;
38
39 #if wxUSE_ACCEL
40 virtual wxAcceleratorEntry *GetAccel() const;
41 #endif // wxUSE_ACCEL
42
43 // implementation
44 void SetMenuItem(GtkWidget *menuItem) { m_menuItem = menuItem; }
45 GtkWidget *GetMenuItem() const { return m_menuItem; }
46 wxString GetFactoryPath() const;
47
48 wxString GetHotKey() const { return m_hotKey; }
49
50 private:
51 // DoSetText() transforms the accel mnemonics in our label from MSW/wxWin
52 // style to GTK+ and is called from ctor and SetText()
53 void DoSetText(const wxString& text);
54
55 wxString m_hotKey;
56
57 GtkWidget *m_menuItem; // GtkMenuItem
58
59 DECLARE_DYNAMIC_CLASS(wxMenuItem)
60 };
61
62
63 #endif
64 //__GTKMENUITEMH__