- // Destroy menubar, but keep data structures intact so we can recreate it.
- bool DestroyMenuBar();
-
- const wxColour& GetBackgroundColour() const { return m_backgroundColour; }
- const wxColour& GetForegroundColour() const { return m_foregroundColour; }
- const wxFont& GetFont() const { return m_font; }
-
- void SetBackgroundColour(const wxColour& colour);
- void SetForegroundColour(const wxColour& colour);
- void SetFont(const wxFont& colour);
- void ChangeFont(bool keepOriginalSize = FALSE);
-
- public:
- wxEvtHandler * m_eventHandler;
- int m_menuCount;
- wxMenu ** m_menus;
- wxString * m_titles;
- wxFrame * m_menuBarFrame;
-
- //// Motif-specific
- WXWidget m_mainWidget;
+public:
+ wxMenuBar( long style );
+ 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 ;
+ 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 ;
+ 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 ;
+
+ void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
+ wxEvtHandler *GetEventHandler() { return m_eventHandler; }
+
+ int GetMenuCount() const { return m_menuCount; }
+ wxMenu* GetMenu(int i) const { return m_menus[i]; }
+
+ //// Motif-specific
+ wxFrame* GetMenuBarFrame() const { return m_menuBarFrame; }
+ void SetMenuBarFrame(wxFrame* frame) { m_menuBarFrame = frame; }
+ WXWidget GetMainWidget() const { return m_mainWidget; }
+ void SetMainWidget(WXWidget widget) { m_mainWidget = widget; }
+
+ // Create menubar
+ bool CreateMenuBar(wxFrame* frame);
+
+ // Destroy menubar, but keep data structures intact so we can recreate it.
+ bool DestroyMenuBar();
+
+ const wxColour& GetBackgroundColour() const { return m_backgroundColour; }
+ const wxColour& GetForegroundColour() const { return m_foregroundColour; }
+ const wxFont& GetFont() const { return m_font; }
+
+ void SetBackgroundColour(const wxColour& colour);
+ void SetForegroundColour(const wxColour& colour);
+ void SetFont(const wxFont& colour);
+ void ChangeFont(bool keepOriginalSize = FALSE);