diff --git a/wxPython/src/msw/misc.cpp b/wxPython/src/msw/misc.cpp index 622250961b..1175d40b17 100644 --- a/wxPython/src/msw/misc.cpp +++ b/wxPython/src/msw/misc.cpp @@ -194,43 +194,6 @@ static PyObject *_wrap_wxRegisterId(PyObject *self, PyObject *args, PyObject *kw return _resultobj; } -static PyObject *_wrap_NewId(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - long _result; - char *_kwnames[] = { NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,":NewId",_kwnames)) - return NULL; -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (long )wxNewId(); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("l",_result); - return _resultobj; -} - -static PyObject *_wrap_RegisterId(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - long _arg0; - char *_kwnames[] = { "id", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"l:RegisterId",_kwnames,&_arg0)) - return NULL; -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxRegisterId(_arg0); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - static PyObject *_wrap_wxGetCurrentId(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; long _result; @@ -5587,8 +5550,6 @@ static PyMethodDef misccMethods[] = { { "wxEndBusyCursor", (PyCFunction) _wrap_wxEndBusyCursor, METH_VARARGS | METH_KEYWORDS }, { "wxBell", (PyCFunction) _wrap_wxBell, METH_VARARGS | METH_KEYWORDS }, { "wxGetCurrentId", (PyCFunction) _wrap_wxGetCurrentId, METH_VARARGS | METH_KEYWORDS }, - { "RegisterId", (PyCFunction) _wrap_RegisterId, METH_VARARGS | METH_KEYWORDS }, - { "NewId", (PyCFunction) _wrap_NewId, METH_VARARGS | METH_KEYWORDS }, { "wxRegisterId", (PyCFunction) _wrap_wxRegisterId, METH_VARARGS | METH_KEYWORDS }, { "wxNewId", (PyCFunction) _wrap_wxNewId, METH_VARARGS | METH_KEYWORDS }, { "wxIntersectRect", (PyCFunction) _wrap_wxIntersectRect, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/misc.py b/wxPython/src/msw/misc.py index cb8cd13413..892e56dcf7 100644 --- a/wxPython/src/msw/misc.py +++ b/wxPython/src/msw/misc.py @@ -753,10 +753,6 @@ wxNewId = miscc.wxNewId wxRegisterId = miscc.wxRegisterId -NewId = miscc.NewId - -RegisterId = miscc.RegisterId - wxGetCurrentId = miscc.wxGetCurrentId wxBell = miscc.wxBell diff --git a/wxPython/src/msw/windows.cpp b/wxPython/src/msw/windows.cpp index 651805eea9..7349a56836 100644 --- a/wxPython/src/msw/windows.cpp +++ b/wxPython/src/msw/windows.cpp @@ -1603,6 +1603,34 @@ static PyObject *_wrap_wxWindow_Enable(PyObject *self, PyObject *args, PyObject return _resultobj; } +#define wxWindow_Disable(_swigobj) (_swigobj->Disable()) +static PyObject *_wrap_wxWindow_Disable(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_Disable",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_Disable. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxWindow_Disable(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxWindow_FindWindowById(_swigobj,_swigarg0) (_swigobj->FindWindow(_swigarg0)) static PyObject *_wrap_wxWindow_FindWindowById(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -12149,6 +12177,7 @@ static PyMethodDef windowscMethods[] = { { "wxWindow_Fit", (PyCFunction) _wrap_wxWindow_Fit, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_FindWindowByName", (PyCFunction) _wrap_wxWindow_FindWindowByName, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_FindWindowById", (PyCFunction) _wrap_wxWindow_FindWindowById, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_Disable", (PyCFunction) _wrap_wxWindow_Disable, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Enable", (PyCFunction) _wrap_wxWindow_Enable, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_DragAcceptFiles", (PyCFunction) _wrap_wxWindow_DragAcceptFiles, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_IsBeingDeleted", (PyCFunction) _wrap_wxWindow_IsBeingDeleted, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py index 517d34174f..39f7f50988 100644 --- a/wxPython/src/msw/windows.py +++ b/wxPython/src/msw/windows.py @@ -165,6 +165,9 @@ class wxWindowPtr(wxEvtHandlerPtr): def Enable(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_Enable,(self,) + _args, _kwargs) return val + def Disable(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_Disable,(self,) + _args, _kwargs) + return val def FindWindowById(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_FindWindowById,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index 3b54f8c50b..0651bebe47 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -1564,12 +1564,7 @@ wxPen = wxPyPen wxScrollbar = wxScrollBar wxPoint2D = wxPoint2DDouble -# Use Python's bool constants if available, make aliases if not -try: - True -except NameError: - True = 1==1 - False = 1==0 +wxPyAssertionError = wxc.wxPyAssertionError # backwards compatibility @@ -1580,15 +1575,43 @@ NULL = None wxSystemSettings_GetSystemColour = wxSystemSettings_GetColour wxSystemSettings_GetSystemFont = wxSystemSettings_GetFont wxSystemSettings_GetSystemMetric = wxSystemSettings_GetMetric -false = FALSE = False -true = TRUE = True # workarounds for bad wxRTTI names __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' -wxPyAssertionError = wxc.wxPyAssertionError + +def NewId(): + import warnings + warnings.warn("Use wxNewId instead", DeprecationWarning, 2) + return wxNewId() + +def RegisterId(ID): + import warnings + warnings.warn("Use wxRegisterId instead", DeprecationWarning, 2) + return wxRegisterId(ID) + + + +# Use Python's bool constants if available, make aliases if not +try: + True +except NameError: + True = 1==1 + False = 1==0 + +class _DeprecatedNonBool: + def __init__(self, val, txt): + self.__val = val + self.__txt = txt + def __int__(self): + import warnings + warnings.warn("Use Python's %s instead" % self.__txt, DeprecationWarning, 3) + return self.__val + +TRUE = true = _DeprecatedNonBool(True, 'True') +FALSE = false = _DeprecatedNonBool(False, 'False') #----------------------------------------------------------------------