class wxMenuItem;
class wxMenu;
+//-----------------------------------------------------------------------------
+// const
+//-----------------------------------------------------------------------------
+
+#define ID_SEPARATOR (-1)
+
//-----------------------------------------------------------------------------
// wxMenuBar
//-----------------------------------------------------------------------------
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;
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
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;