- void Append(wxMenu *menu, const wxString& title);
- virtual void Delete(wxMenu *menu, int index = 0); /* Menu not destroyed */
-
- // state control
- // NB: must only be used AFTER menu has been attached to frame,
- // otherwise use individual menus to enable/disable items
- // enable the item
- void Enable(int id, bool enable);
- // TRUE if item enabled
- bool IsEnabled(int id) const;
- //
- void EnableTop(int pos, bool enable);
-
- // works only with checkable items
- void Check(int id, bool check);
- // TRUE if checked
- bool IsChecked(int id) const;
-
- void SetLabel(int id, const wxString& label) ;
- wxString GetLabel(int id) const ;
-
- virtual void SetHelpString(int id, const wxString& helpString);
- virtual wxString GetHelpString(int id) const ;
-
- void SetLabelTop(int pos, const wxString& label) ;
- wxString GetLabelTop(int pos) const ;
-
- // notifications: return FALSE to prevent the menu from being
- // appended/deleted
- virtual bool OnAppend(wxMenu *menu, const char *title);
- virtual bool OnDelete(wxMenu *menu, int index);
-
- // 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 { return FindItemForId(id); }
- // returns NULL if not found, fills menuForItem if !NULL
- wxMenuItem *FindItemForId(int itemId, wxMenu **menuForItem = NULL) const;
-
- // submenus access
- int GetMenuCount() const { return m_menuCount; }
- wxMenu *GetMenu(int i) const { return m_menus[i]; }
-
- void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
- wxEvtHandler *GetEventHandler() { return m_eventHandler; }
-
-#ifdef WXWIN_COMPATIBILITY
- // compatibility: these functions are deprecated
- bool Enabled(int id) const { return IsEnabled(id); }
- bool Checked(int id) const { return IsChecked(id); }
-#endif // WXWIN_COMPATIBILITY
-
- // IMPLEMENTATION
- // returns TRUE if we're attached to a frame
- bool IsAttached() const { return m_menuBarFrame != NULL; }
- // get the frame we live in
- wxFrame *GetFrame() const { return m_menuBarFrame; }
- // attach to a frame
- void Attach(wxFrame *frame);
-
- // get the accel table for the menus
- const wxAcceleratorTable& GetAccelTable() const { return m_accelTable; }
+ virtual void Detach();
+ virtual void Attach(wxFrame *frame);
+
+#if defined(__WXWINCE__) && wxUSE_TOOLBAR
+ // Under WinCE, a menubar is owned by the frame's toolbar
+ void SetToolBar(wxToolBar* toolBar) { m_toolBar = toolBar; }
+ wxToolBar* GetToolBar() const { return m_toolBar; }
+#endif
+
+#ifdef WINCE_WITH_COMMANDBAR
+ WXHWND GetCommandBar() const { return m_commandBar; }
+ bool AddAdornments(long style);
+#endif
+
+#if wxUSE_ACCEL
+ // update the accel table (must be called after adding/deleting a menu)
+ void RebuildAccelTable();
+#endif // wxUSE_ACCEL
+