X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c801d85f158c4cba50b588807daabdcbd0ed3853..3bbb630a217d8212c63ac16d5338f692b70ab392:/include/wx/gtk1/menu.h diff --git a/include/wx/gtk1/menu.h b/include/wx/gtk1/menu.h index 7e24c65f6d..50ed50f32b 100644 --- a/include/wx/gtk1/menu.h +++ b/include/wx/gtk1/menu.h @@ -29,6 +29,12 @@ class wxMenuBar; class wxMenuItem; class wxMenu; +//----------------------------------------------------------------------------- +// const +//----------------------------------------------------------------------------- + +#define ID_SEPARATOR (-1) + //----------------------------------------------------------------------------- // wxMenuBar //----------------------------------------------------------------------------- @@ -42,6 +48,9 @@ class wxMenuBar: public wxWindow wxMenuBar(void); void Append( wxMenu *menu, const wxString &title ); int FindMenuItem( const wxString &menuString, const wxString &itemString ) const; + wxMenuItem* FindMenuItemById( int id ) const; + bool IsChecked( int id ) const; + bool IsEnabled( int id ) const; wxList m_menus; GtkWidget *m_menubar; @@ -69,7 +78,17 @@ class wxMenuItem: public wxObject wxString m_helpStr; GtkWidget *m_menuItem; // GtkMenuItem - + + bool IsCheckable() const { return m_isCheckMenu; } + bool IsSeparator() const { return m_id == ID_SEPARATOR; } + bool IsEnabled() const { return m_isEnabled; } + int GetId() const { return m_id; } + const wxString& GetHelp() const { return m_helpStr; } + wxMenu *GetSubMenu() const { return m_subMenu; } + + void Check( bool check ); + bool IsChecked() const; + void Enable( bool enable ); }; class wxMenu: public wxEvtHandler @@ -80,16 +99,18 @@ class wxMenu: public wxEvtHandler wxMenu( const wxString &title = "" ); void AppendSeparator(void); - void Append( const int id, const wxString &item, - const wxString &helpStr = "", const bool checkable = FALSE ); - void Append( const int id, const wxString &item, + void Append( int id, const wxString &item, + const wxString &helpStr = "", bool checkable = FALSE ); + void Append( int id, const wxString &item, wxMenu *subMenu, const wxString &helpStr = "" ); int FindItem( const wxString itemString ) const; + wxMenuItem* FindItemForId( int id ) const; void Break(void) {}; - void Enable( const int id, const bool enable ); - bool Enabled( const int id ) const; - void SetLabel( const int id, const wxString &label ); - + void Check(int id, bool Flag); + void Enable( int id, bool enable ); + bool Enabled( int id ) const; + void SetLabel( int id, const wxString &label ); + public: int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;