X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/86381d4297f0225448823369a0df73ba67664078..d3fa4bc22e84e3ca4d88cc1772f2d414140a1017:/interface/wx/menu.h diff --git a/interface/wx/menu.h b/interface/wx/menu.h index 87922d10a8..a6b5cbe0d9 100644 --- a/interface/wx/menu.h +++ b/interface/wx/menu.h @@ -107,6 +107,16 @@ public: */ void Enable(int id, bool enable); + /** + Returns true if the menu with the given index is enabled. + + @param pos + The menu position (0-based) + + @since 2.9.4 + */ + bool IsEnabledTop(size_t pos) const; + /** Enables or disables a whole menu. @@ -373,6 +383,37 @@ public: @remarks Use only after the menubar has been associated with a frame. */ virtual void SetMenuLabel(size_t pos, const wxString& label); + + /** + Enables you to set the global menubar on Mac, that is, the menubar displayed + when the app is running without any frames open. + + @param menubar + The menubar to set. + + @remarks Only exists on Mac, other platforms do not have this method. + + @onlyfor{wxosx} + */ + static void MacSetCommonMenuBar(wxMenuBar* menubar); + + /** + Enables you to get the global menubar on Mac, that is, the menubar displayed + when the app is running without any frames open. + + @return The global menubar. + + @remarks Only exists on Mac, other platforms do not have this method. + + @onlyfor{wxosx} + */ + static wxMenuBar* MacGetCommonMenuBar(); + + wxFrame *GetFrame() const; + bool IsAttached() const; + virtual void Attach(wxFrame *frame); + virtual void Detach(); + }; @@ -395,7 +436,6 @@ public: and have a special meaning since entries using these IDs will be taken out of the normal menus under MacOS X and will be inserted into the system menu (following the appropriate MacOS X interface guideline). - On PalmOS @e wxID_EXIT is disabled according to Palm OS Companion guidelines. Menu items may be either @e normal items, @e check items or @e radio items. Normal items don't have any special properties while the check items have a @@ -434,7 +474,7 @@ public: If the menu is part of a menubar, then wxMenuBar event processing is used. With a popup menu (see wxWindow::PopupMenu), there is a variety of ways to - handle a menu selection event (@c wxEVT_COMMAND_MENU_SELECTED): + handle a menu selection event (@c wxEVT_MENU): - Provide @c EVT_MENU handlers in the window which pops up the menu, or in an ancestor of that window (the simplest method); - Derive a new class from wxMenu and define event table entries using the @c EVT_MENU macro; @@ -780,7 +820,7 @@ public: wxMenuItemList is a pseudo-template list class containing wxMenuItem pointers, see wxList. */ - wxMenuItemList& GetMenuItems() const; + wxMenuItemList& GetMenuItems(); const wxMenuItemList& GetMenuItems() const; //@} @@ -799,7 +839,7 @@ public: @see Append(), Prepend() */ - wxMenuItem* Insert(size_t pos, wxMenuItem* item); + wxMenuItem* Insert(size_t pos, wxMenuItem* menuItem); /** Inserts the given @a item before the position @a pos. @@ -862,7 +902,7 @@ public: bool IsEnabled(int id) const; /** - Inserts the given @a item at position 0, i.e. before all the other + Inserts the given @a item at position 0, i.e.\ before all the other existing items. @see Append(), Insert() @@ -870,7 +910,7 @@ public: wxMenuItem* Prepend(wxMenuItem* item); /** - Inserts the given @a item at position 0, i.e. before all the other + Inserts the given @a item at position 0, i.e.\ before all the other existing items. @see Append(), Insert() @@ -972,5 +1012,18 @@ public: but the application may call it at other times if required. */ void UpdateUI(wxEvtHandler* source = NULL); + + + void SetInvokingWindow(wxWindow *win); + wxWindow *GetInvokingWindow() const; + wxWindow *GetWindow() const; + long GetStyle() const; + void SetParent(wxMenu *parent); + wxMenu *GetParent() const; + + virtual void Attach(wxMenuBar *menubar); + virtual void Detach(); + bool IsAttached() const; + };