- wxMenuBar();
- void Append( wxMenu *menu, const wxString &title );
-
- int FindMenuItem( const wxString &menuString, const wxString &itemString ) const;
- wxMenuItem* FindMenuItemById( int id ) const;
- inline wxMenuItem* FindItemForId( int id ) const { return FindMenuItemById( id ); }
-
- void Check( int id, bool check );
- bool Checked( int id ) const;
- void Enable( int id, bool enable );
- bool Enabled( int id ) const;
- inline bool IsEnabled( int id ) const { return Enabled(id); }
- inline bool IsChecked( int id ) const { return Checked(id); }
-
- wxString GetLabel( int id ) const;
- void SetLabel( int id, const wxString &label );
-
- void EnableTop( int pos, bool flag );
- void SetLabelTop( int pos, const wxString& label );
- wxString GetLabelTop( int pos ) const;
-
- virtual void SetHelpString( int id, const wxString& helpString );
- virtual wxString GetHelpString( int id ) const;
-
- inline int GetMenuCount() const { return m_menus.Number(); }
- inline wxMenu *GetMenu( int n ) const { return (wxMenu *)m_menus.Nth(n)->Data(); }
-
- wxList m_menus;
- GtkWidget *m_menubar;
+ // ctors
+ wxMenuBar();
+ wxMenuBar(long style);
+ wxMenuBar(int n, wxMenu *menus[], const wxString titles[]);
+
+ // menubar construction
+ void Append( wxMenu *menu, const wxString &title );
+
+ // item search
+ // by menu and item names, returns wxNOT_FOUND if not found
+ virtual int FindMenuItem(const wxString& menuString,
+ const wxString& itemString) const;
+ // returns NULL if not found
+ wxMenuItem* FindItem( int id ) const;
+ // returns NULL if not found, fills menuForItem if !NULL
+ wxMenuItem *FindItemForId(int itemId, wxMenu **menuForItem = NULL) const;
+
+ // state control
+ void Check( int id, bool check );
+ bool IsChecked( int id ) const;
+ void Enable( int id, bool enable );
+ bool IsEnabled( int id ) const;
+
+ wxString GetLabel( int id ) const;
+ void SetLabel( int id, const wxString &label );
+
+ void EnableTop( int pos, bool flag );
+ void SetLabelTop( int pos, const wxString& label );
+ wxString GetLabelTop( int pos ) const;
+
+ virtual void SetHelpString( int id, const wxString& helpString );
+ virtual wxString GetHelpString( int id ) const;
+
+ int GetMenuCount() const { return m_menus.Number(); }
+ wxMenu *GetMenu( int n ) const { return (wxMenu *)m_menus.Nth(n)->Data(); }
+
+#ifdef WXWIN_COMPATIBILITY
+ // compatibility: these functions are deprecated
+ bool Enabled(int id) const { return IsEnabled(id); }
+ bool Checked(int id) const { return IsChecked(id); }
+
+ wxMenuItem* FindMenuItemById( int id ) const { return FindItem(id); }
+#endif // WXWIN_COMPATIBILITY
+
+ // implementation
+ wxList& GetMenus() { return m_menus; }
+
+protected:
+ wxList m_menus;
+ GtkWidget *m_menubar;