-public:
- // construction
- wxMenu( const wxString &title = "" );
-
- // operations
- // menu creation
- void AppendSeparator();
- 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 = "" );
- void Break() {};
-
- // find item by name/id
- int FindItem( const wxString itemString ) const;
- wxMenuItem *FindItem(int id) const;
-
- // get/set item's state
- void Enable( int id, bool enable );
- bool IsEnabled( int id ) const;
- void Check( int id, bool check );
- bool IsChecked( int id ) const;
-
- void SetLabel( int id, const wxString &label );
-
- // accessors
- wxList& GetItems() { return m_items; }
-
-public:
- void SetInvokingWindow( wxWindow *win );
- wxWindow *GetInvokingWindow();
-
- wxString m_title;
- wxList m_items;
- wxWindow *m_invokingWindow;
+ wxMenuBar();
+ wxMenuBar(int n, wxMenu *menus[], const wxString titles[]);
+ ~wxMenuBar();
+
+ void Append(wxMenu *menu, const wxString& title);
+ // Must only be used AFTER menu has been attached to frame,
+ // otherwise use individual menus to enable/disable items
+ void Enable(int Id, bool Flag);
+ bool Enabled(int Id) const ;
+ inline bool IsEnabled(int Id) const { return Enabled(Id); };
+ void EnableTop(int pos, bool Flag);
+ void Check(int id, bool Flag);
+ bool Checked(int id) const ;
+ inline bool IsChecked(int Id) const { return Checked(Id); };
+ void SetLabel(int id, const wxString& label) ;
+ wxString GetLabel(int id) const ;
+ void SetLabelTop(int pos, const wxString& label) ;
+ wxString GetLabelTop(int pos) const ;
+ virtual void Delete(wxMenu *menu, int index = 0); /* Menu not destroyed */
+ virtual bool OnAppend(wxMenu *menu, const char *title);
+ virtual bool OnDelete(wxMenu *menu, int index);
+
+ virtual void SetHelpString(int Id, const wxString& helpString);
+ virtual wxString GetHelpString(int Id) const ;
+
+ virtual int FindMenuItem(const wxString& menuString, const wxString& itemString) const ;
+
+ // Find wxMenuItem for item ID, and return item's
+ // menu too if itemMenu is non-NULL.
+ wxMenuItem *FindItemForId(int itemId, wxMenu **menuForItem = NULL) const ;
+
+ inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
+ inline wxEvtHandler *GetEventHandler() { return m_eventHandler; }
+
+ inline int GetMenuCount() const { return m_menuCount; }
+ inline wxMenu* GetMenu(int i) const { return m_menus[i]; }
+
+ public:
+ wxEvtHandler * m_eventHandler;
+ int m_menuCount;
+ wxMenu ** m_menus;
+ wxString * m_titles;
+ wxFrame * m_menuBarFrame;
+/* TODO: data that represents the actual menubar when created.
+ */