X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b9048c56f0aa04b2adbb7813f9698abdda15184..56a52e909411904736e41258c39f306d218d84d5:/wxPython/src/_menu.i diff --git a/wxPython/src/_menu.i b/wxPython/src/_menu.i index 02dc200a3c..e1407bad00 100644 --- a/wxPython/src/_menu.i +++ b/wxPython/src/_menu.i @@ -17,13 +17,20 @@ %newgroup +MustHaveApp(wxMenu); + class wxMenu : public wxEvtHandler { public: %pythonAppend wxMenu "self._setOORInfo(self)" + %typemap(out) wxMenu*; // turn off this typemap + wxMenu(const wxString& title = wxPyEmptyString, long style = 0); + // Turn it back on again + %typemap(out) wxMenu* { $result = wxPyMake_wxObject($1, $owner); } + // append any kind of item (normal/check/radio/separator) wxMenuItem* Append(int id, const wxString& text, @@ -203,12 +210,18 @@ public: //--------------------------------------------------------------------------- %newgroup +MustHaveApp(wxMenuBar); + class wxMenuBar : public wxWindow { public: %pythonAppend wxMenuBar "self._setOORInfo(self)" + %typemap(out) wxMenuBar*; // turn off this typemap + wxMenuBar(long style = 0); + // Turn it back on again + %typemap(out) wxMenuBar* { $result = wxPyMake_wxObject($1, $owner); } // append a menu to the end of menubar, return True if ok virtual bool Append(wxMenu *menu, const wxString& title); @@ -236,7 +249,7 @@ public: virtual void EnableTop(size_t pos, bool enable); // is the menu enabled? - virtual bool IsEnabledTop(size_t WXUNUSED(pos)) const { return True; } + virtual bool IsEnabledTop(size_t WXUNUSED(pos)) const { return true; } // get or change the label of the menu at given position virtual void SetLabelTop(size_t pos, const wxString& label); @@ -292,7 +305,7 @@ public: class wxMenuItem : public wxObject { public: - wxMenuItem(wxMenu* parentMenu=NULL, int id=wxID_SEPARATOR, + wxMenuItem(wxMenu* parentMenu=NULL, int id=wxID_ANY, const wxString& text = wxPyEmptyString, const wxString& help = wxPyEmptyString, wxItemKind kind = wxITEM_NORMAL, @@ -322,6 +335,7 @@ public: // what kind of menu item we are wxItemKind GetKind() const; + void SetKind(wxItemKind kind); virtual void SetCheckable(bool checkable); bool IsCheckable() const; @@ -331,10 +345,10 @@ public: wxMenu *GetSubMenu() const; // state - virtual void Enable(bool enable = True); + virtual void Enable(bool enable = true); virtual bool IsEnabled() const; - virtual void Check(bool check = True); + virtual void Check(bool check = true); virtual bool IsChecked() const; void Toggle(); @@ -370,7 +384,7 @@ public: bool IsOwnerDrawn(); // switch on/off owner-drawing the item - void SetOwnerDrawn(bool ownerDrawn = True); + void SetOwnerDrawn(bool ownerDrawn = true); void ResetOwnerDrawn(); #else // just to keep the global renamers in sync