]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/menu.h
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
20 #include "wx/object.h"
22 #include "wx/window.h"
24 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
36 #define ID_SEPARATOR (-1)
38 //-----------------------------------------------------------------------------
40 //-----------------------------------------------------------------------------
42 class wxMenuBar
: public wxWindow
44 DECLARE_DYNAMIC_CLASS(wxMenuBar
)
49 void Append( wxMenu
*menu
, const wxString
&title
);
50 int FindMenuItem( const wxString
&menuString
, const wxString
&itemString
) const;
51 wxMenuItem
* FindMenuItemById( int id
) const;
52 bool IsChecked( int id
) const;
53 bool IsEnabled( int id
) const;
59 //-----------------------------------------------------------------------------
61 //-----------------------------------------------------------------------------
63 class wxMenuItem
: public wxObject
65 DECLARE_DYNAMIC_CLASS(wxMenuItem
)
80 GtkWidget
*m_menuItem
; // GtkMenuItem
82 bool IsCheckable() const { return m_isCheckMenu
; }
83 bool IsSeparator() const { return m_id
== ID_SEPARATOR
; }
84 bool IsEnabled() const { return m_isEnabled
; }
85 int GetId() const { return m_id
; }
86 const wxString
& GetHelp() const { return m_helpStr
; }
87 wxMenu
*GetSubMenu() const { return m_subMenu
; }
89 void Check( bool check
);
90 bool IsChecked() const;
91 void Enable( bool enable
);
94 class wxMenu
: public wxEvtHandler
96 DECLARE_DYNAMIC_CLASS(wxMenu
)
100 wxMenu( const wxString
&title
= "" );
101 void AppendSeparator(void);
102 void Append( int id
, const wxString
&item
,
103 const wxString
&helpStr
= "", bool checkable
= FALSE
);
104 void Append( int id
, const wxString
&item
,
105 wxMenu
*subMenu
, const wxString
&helpStr
= "" );
106 int FindItem( const wxString itemString
) const;
107 wxMenuItem
* FindItemForId( int id
) const;
109 void Check(int id
, bool Flag
);
110 void Enable( int id
, bool enable
);
111 bool Enabled( int id
) const;
112 void SetLabel( int id
, const wxString
&label
);
116 int FindMenuIdByMenuItem( GtkWidget
*menuItem
) const;
117 void SetInvokingWindow( wxWindow
*win
);
118 wxWindow
*GetInvokingWindow(void);
122 wxWindow
*m_invokingWindow
;
124 GtkWidget
*m_menu
; // GtkMenu
128 #endif // __GTKMENUH__