X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c4287548985b4a8246eb1d9b4ced2f346fc95253..e17b6377be593ce71d722beb3cdcffb67baccf00:/wxPython/src/_menu.i diff --git a/wxPython/src/_menu.i b/wxPython/src/_menu.i index 3db6b18786..50a3f6e7fc 100644 --- a/wxPython/src/_menu.i +++ b/wxPython/src/_menu.i @@ -33,7 +33,7 @@ public: // append any kind of item (normal/check/radio/separator) wxMenuItem* Append(int id, - const wxString& text, + const wxString& text = wxPyEmptyString, const wxString& help = wxPyEmptyString, wxItemKind kind = wxITEM_NORMAL); @@ -76,7 +76,7 @@ public: // insert an item before given position wxMenuItem* Insert(size_t pos, int id, - const wxString& text, + const wxString& text = wxPyEmptyString, const wxString& help = wxPyEmptyString, wxItemKind kind = wxITEM_NORMAL); @@ -104,7 +104,7 @@ public: // prepend any item to the menu wxMenuItem* Prepend(int id, - const wxString& text, + const wxString& text = wxPyEmptyString, const wxString& help = wxPyEmptyString, wxItemKind kind = wxITEM_NORMAL); @@ -214,6 +214,17 @@ public: // set/get the parent of this menu void SetParent(wxMenu *parent); wxMenu *GetParent() const; + + %property(EventHandler, GetEventHandler, SetEventHandler, doc="See `GetEventHandler` and `SetEventHandler`"); + %property(HelpString, GetHelpString, SetHelpString, doc="See `GetHelpString` and `SetHelpString`"); + %property(InvokingWindow, GetInvokingWindow, SetInvokingWindow, doc="See `GetInvokingWindow` and `SetInvokingWindow`"); + %property(MenuBar, GetMenuBar, doc="See `GetMenuBar`"); + %property(MenuItemCount, GetMenuItemCount, doc="See `GetMenuItemCount`"); + %property(MenuItems, GetMenuItems, doc="See `GetMenuItems`"); + %property(Parent, GetParent, SetParent, doc="See `GetParent` and `SetParent`"); + %property(Style, GetStyle, doc="See `GetStyle`"); + %property(Title, GetTitle, SetTitle, doc="See `GetTitle` and `SetTitle`"); + }; //--------------------------------------------------------------------------- @@ -321,6 +332,25 @@ public: static bool GetAutoWindowMenu() { return false; } } #endif + + %pythoncode { + def GetMenus(self): + """Return a list of (menu, label) items for the menus in the MenuBar. """ + return [(self.GetMenu(i), self.GetLabelTop(i)) + for i in range(self.GetMenuCount())] + + def SetMenus(self, items): + """Clear and add new menus to the MenuBar from a list of (menu, label) items. """ + for i in range(self.GetMenuCount()-1, -1, -1): + self.Remove(i) + for m, l in items: + self.Append(m, l) + } + + %property(Frame, GetFrame, doc="See `GetFrame`"); + %property(Menu, GetMenu, doc="See `GetMenu`"); + %property(MenuCount, GetMenuCount, doc="See `GetMenuCount`"); + %property(Menus, GetMenus, SetMenus, doc="See `GetMenus` and `SetMenus`"); }; //--------------------------------------------------------------------------- @@ -436,6 +466,22 @@ public: void ResetOwnerDrawn() {} } #endif + + %property(Accel, GetAccel, SetAccel, doc="See `GetAccel` and `SetAccel`"); + %property(BackgroundColour, GetBackgroundColour, SetBackgroundColour, doc="See `GetBackgroundColour` and `SetBackgroundColour`"); + %property(Bitmap, GetBitmap, SetBitmap, doc="See `GetBitmap` and `SetBitmap`"); + %property(DisabledBitmap, GetDisabledBitmap, SetDisabledBitmap, doc="See `GetDisabledBitmap` and `SetDisabledBitmap`"); + %property(Font, GetFont, SetFont, doc="See `GetFont` and `SetFont`"); + %property(Help, GetHelp, SetHelp, doc="See `GetHelp` and `SetHelp`"); + %property(Id, GetId, SetId, doc="See `GetId` and `SetId`"); + %property(Kind, GetKind, SetKind, doc="See `GetKind` and `SetKind`"); + %property(Label, GetLabel, doc="See `GetLabel`"); + %property(MarginWidth, GetMarginWidth, SetMarginWidth, doc="See `GetMarginWidth` and `SetMarginWidth`"); + %property(Menu, GetMenu, SetMenu, doc="See `GetMenu` and `SetMenu`"); + %property(SubMenu, GetSubMenu, SetSubMenu, doc="See `GetSubMenu` and `SetSubMenu`"); + %property(Text, GetText, SetText, doc="See `GetText` and `SetText`"); + %property(TextColour, GetTextColour, SetTextColour, doc="See `GetTextColour` and `SetTextColour`"); + }; //---------------------------------------------------------------------------