X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/214c4fbea5875368cc21a082d20cb082cd38cb3c..90fb367e86c1e82367f8d4781b8c1bdc31a26593:/wxPython/src/_menu.i?ds=sidebyside diff --git a/wxPython/src/_menu.i b/wxPython/src/_menu.i index b57f7bd6e7..3db6b18786 100644 --- a/wxPython/src/_menu.i +++ b/wxPython/src/_menu.i @@ -55,16 +55,24 @@ public: wxMenu *submenu, const wxString& help = wxPyEmptyString)); + wxMenuItem* AppendSubMenu(wxMenu *submenu, + const wxString& text, + const wxString& help = wxPyEmptyString); + + %disownarg(wxMenuItem*); // the most generic form of Append() - append anything %Rename(AppendItem, wxMenuItem*, Append(wxMenuItem *item)); + // insert an item before given position + %Rename(InsertItem, wxMenuItem*, Insert(size_t pos, wxMenuItem *item)); + // prepend an item to the menu + %Rename(PrependItem, wxMenuItem*, Prepend(wxMenuItem *item)); + %cleardisown(wxMenuItem*); + // insert a break in the menu (only works when appending the items, not // inserting them) virtual void Break(); - // insert an item before given position - %Rename(InsertItem, wxMenuItem*, Insert(size_t pos, wxMenuItem *item)); - // insert an item before given position wxMenuItem* Insert(size_t pos, int id, @@ -94,9 +102,6 @@ public: wxMenu *submenu, const wxString& help = wxPyEmptyString)); - // prepend an item to the menu - %Rename(PrependItem, wxMenuItem*, Prepend(wxMenuItem *item)); - // prepend any item to the menu wxMenuItem* Prepend(int id, const wxString& text, @@ -122,9 +127,11 @@ public: wxMenu *submenu, const wxString& help = wxPyEmptyString)); + // detach an item from the menu, but don't delete it so that it can be // added back later (but if it's not, the caller is responsible for // deleting it!) + %newobject Remove; wxMenuItem *Remove(int id); %Rename(RemoveItem, wxMenuItem*, Remove(wxMenuItem *item)); @@ -302,6 +309,9 @@ public: // called before deleting the menubar normally virtual void Detach(); + // update all menu item states in all menus + virtual void UpdateMenus(); + #ifdef __WXMAC__ static void SetAutoWindowMenu( bool enable ); static bool GetAutoWindowMenu(); @@ -323,6 +333,7 @@ public: const wxString& help = wxPyEmptyString, wxItemKind kind = wxITEM_NORMAL, wxMenu* subMenu = NULL); + ~wxMenuItem(); // the menu we're in wxMenu *GetMenu() const;