X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..30e24d9dd5a5abf1c9a375ea259eb239b122b7f7:/wxPython/src/_tglbtn.i?ds=inline diff --git a/wxPython/src/_tglbtn.i b/wxPython/src/_tglbtn.i index b0eec03e23..05fa6455f3 100644 --- a/wxPython/src/_tglbtn.i +++ b/wxPython/src/_tglbtn.i @@ -15,18 +15,15 @@ //--------------------------------------------------------------------------- -%{ - wxChar* wxToggleButtonNameStr = _T("wxToggleButton"); - DECLARE_DEF_STRING(ToggleButtonNameStr); -%} +MAKE_CONST_WXSTRING2(ToggleButtonNameStr, _T("wxToggleButton")); //--------------------------------------------------------------------------- %newgroup %{ -#ifdef __WXMAC__ -// implement dummy classes and such for wxMac +#if !wxUSE_TOGGLEBTN +// implement dummy items for platforms that don't have this class #define wxEVT_COMMAND_TOGGLEBUTTON_CLICKED 0 @@ -36,10 +33,10 @@ public: wxToggleButton(wxWindow *, wxWindowID, const wxString&, const wxPoint&, const wxSize&, long, const wxValidator&, const wxString&) - { PyErr_SetNone(PyExc_NotImplementedError); } + { wxPyRaiseNotImplemented(); } wxToggleButton() - { PyErr_SetNone(PyExc_NotImplementedError); } + { wxPyRaiseNotImplemented(); } }; #endif %} @@ -53,26 +50,27 @@ public: } +MustHaveApp(wxToggleButton); + class wxToggleButton : public wxControl { public: - %addtofunc wxToggleButton "self._setOORInfo(self)" - %addtofunc wxToggleButton() "" + %pythonAppend wxToggleButton "self._setOORInfo(self)" + %pythonAppend wxToggleButton() "" wxToggleButton(wxWindow *parent, - wxWindowID id, - const wxString& label, + wxWindowID id=-1, + const wxString& label = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxPyToggleButtonNameStr); - %name(PreToggleButton)wxToggleButton(); + %RenameCtor(PreToggleButton, wxToggleButton()); -#ifndef __WXMAC__ bool Create(wxWindow *parent, - wxWindowID id, - const wxString& label, + wxWindowID id=-1, + const wxString& label = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, @@ -82,7 +80,11 @@ public: void SetValue(bool value); bool GetValue() const ; void SetLabel(const wxString& label); -#endif + + static wxVisualAttributes + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + + %property(Value, GetValue, SetValue, doc="See `GetValue` and `SetValue`"); }; //---------------------------------------------------------------------------