]>
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;
56 //-----------------------------------------------------------------------------
58 //-----------------------------------------------------------------------------
60 class wxMenuItem
: public wxObject
62 DECLARE_DYNAMIC_CLASS(wxMenuItem
)
77 GtkWidget
*m_menuItem
; // GtkMenuItem
79 bool IsSeparator() const { return m_id
== ID_SEPARATOR
; }
80 bool IsEnabled() const { return m_isEnabled
; }
81 bool IsChecked() const { return m_checked
; }
83 int GetId() const { return m_id
; }
84 const wxString
& GetHelp() const { return m_helpStr
; }
85 wxMenu
*GetSubMenu() const { return m_subMenu
; }
89 class wxMenu
: public wxEvtHandler
91 DECLARE_DYNAMIC_CLASS(wxMenu
)
95 wxMenu( const wxString
&title
= "" );
96 void AppendSeparator(void);
97 void Append( int id
, const wxString
&item
,
98 const wxString
&helpStr
= "", bool checkable
= FALSE
);
99 void Append( int id
, const wxString
&item
,
100 wxMenu
*subMenu
, const wxString
&helpStr
= "" );
101 int FindItem( const wxString itemString
) const;
103 void Check(int id
, bool Flag
);
104 void Enable( int id
, bool enable
);
105 bool Enabled( int id
) const;
106 void SetLabel( int id
, const wxString
&label
);
110 int FindMenuIdByMenuItem( GtkWidget
*menuItem
) const;
111 void SetInvokingWindow( wxWindow
*win
);
112 wxWindow
*GetInvokingWindow(void);
116 wxWindow
*m_invokingWindow
;
118 GtkWidget
*m_menu
; // GtkMenu
122 #endif // __GTKMENUH__