diff --git a/wxPython/src/msw/controls.cpp b/wxPython/src/msw/controls.cpp index 0d60533c80..9ae598fc9c 100644 --- a/wxPython/src/msw/controls.cpp +++ b/wxPython/src/msw/controls.cpp @@ -11172,6 +11172,36 @@ static PyObject *_wrap_wxSpinCtrl_SetValue(PyObject *self, PyObject *args, PyObj return _resultobj; } +#define wxSpinCtrl_SetSelection(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetSelection(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxSpinCtrl_SetSelection(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxSpinCtrl * _arg0; + long _arg1; + long _arg2; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","from","to", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oll:wxSpinCtrl_SetSelection",_kwnames,&_argo0,&_arg1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxSpinCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxSpinCtrl_SetSelection. Expected _wxSpinCtrl_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxSpinCtrl_SetSelection(_arg0,_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxToggleButtonTowxControl(void *ptr) { wxToggleButton *src; wxControl *dest; @@ -11509,6 +11539,7 @@ static PyMethodDef controlscMethods[] = { { "wxToggleButton_Create", (PyCFunction) _wrap_wxToggleButton_Create, METH_VARARGS | METH_KEYWORDS }, { "new_wxPreToggleButton", (PyCFunction) _wrap_new_wxPreToggleButton, METH_VARARGS | METH_KEYWORDS }, { "new_wxToggleButton", (PyCFunction) _wrap_new_wxToggleButton, METH_VARARGS | METH_KEYWORDS }, + { "wxSpinCtrl_SetSelection", (PyCFunction) _wrap_wxSpinCtrl_SetSelection, METH_VARARGS | METH_KEYWORDS }, { "wxSpinCtrl_SetValue", (PyCFunction) _wrap_wxSpinCtrl_SetValue, METH_VARARGS | METH_KEYWORDS }, { "wxSpinCtrl_SetRange", (PyCFunction) _wrap_wxSpinCtrl_SetRange, METH_VARARGS | METH_KEYWORDS }, { "wxSpinCtrl_GetValue", (PyCFunction) _wrap_wxSpinCtrl_GetValue, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/controls.py b/wxPython/src/msw/controls.py index 3c63c24508..c631a568f6 100644 --- a/wxPython/src/msw/controls.py +++ b/wxPython/src/msw/controls.py @@ -1112,6 +1112,9 @@ class wxSpinCtrlPtr(wxSpinButtonPtr): def SetValue(self, *_args, **_kwargs): val = controlsc.wxSpinCtrl_SetValue(self, *_args, **_kwargs) return val + def SetSelection(self, *_args, **_kwargs): + val = controlsc.wxSpinCtrl_SetSelection(self, *_args, **_kwargs) + return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxSpinCtrl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) class wxSpinCtrl(wxSpinCtrlPtr): diff --git a/wxPython/src/msw/gdi.cpp b/wxPython/src/msw/gdi.cpp index 4f4ff9c5cf..28ef653e2f 100644 --- a/wxPython/src/msw/gdi.cpp +++ b/wxPython/src/msw/gdi.cpp @@ -185,11 +185,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } wxCursor* wxCursorFromImage(const wxImage& image) { - #ifndef __WXMAC__ return new wxCursor(image); - #else - return NULL; - #endif } // Alternate 'constructor' wxColour* wxNamedColour(const wxString& colorName) { diff --git a/wxPython/src/msw/printfw.cpp b/wxPython/src/msw/printfw.cpp index 44a5114bbd..2c0a407110 100644 --- a/wxPython/src/msw/printfw.cpp +++ b/wxPython/src/msw/printfw.cpp @@ -4756,6 +4756,52 @@ static PyObject *_wrap_wxPrinter_Setup(PyObject *self, PyObject *args, PyObject return _resultobj; } +#define wxPrinter_GetAbort(_swigobj) (_swigobj->GetAbort()) +static PyObject *_wrap_wxPrinter_GetAbort(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxPrinter * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxPrinter_GetAbort",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPrinter_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPrinter_GetAbort. Expected _wxPrinter_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxPrinter_GetAbort(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +static PyObject *_wrap_wxPrinter_GetLastError(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPrinterError _result; + char *_kwnames[] = { NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxPrinter_GetLastError",_kwnames)) + return NULL; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxPrinterError )wxPrinter::GetLastError(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxPrintPreviewTowxObject(void *ptr) { wxPrintPreview *src; wxObject *dest; @@ -5479,6 +5525,8 @@ static PyMethodDef printfwcMethods[] = { { "wxPrintPreview_GetCurrentPage", (PyCFunction) _wrap_wxPrintPreview_GetCurrentPage, METH_VARARGS | METH_KEYWORDS }, { "wxPrintPreview_GetCanvas", (PyCFunction) _wrap_wxPrintPreview_GetCanvas, METH_VARARGS | METH_KEYWORDS }, { "new_wxPrintPreview", (PyCFunction) _wrap_new_wxPrintPreview, METH_VARARGS | METH_KEYWORDS }, + { "wxPrinter_GetLastError", (PyCFunction) _wrap_wxPrinter_GetLastError, METH_VARARGS | METH_KEYWORDS }, + { "wxPrinter_GetAbort", (PyCFunction) _wrap_wxPrinter_GetAbort, METH_VARARGS | METH_KEYWORDS }, { "wxPrinter_Setup", (PyCFunction) _wrap_wxPrinter_Setup, METH_VARARGS | METH_KEYWORDS }, { "wxPrinter_ReportError", (PyCFunction) _wrap_wxPrinter_ReportError, METH_VARARGS | METH_KEYWORDS }, { "wxPrinter_PrintDialog", (PyCFunction) _wrap_wxPrinter_PrintDialog, METH_VARARGS | METH_KEYWORDS }, @@ -5755,6 +5803,9 @@ SWIGEXPORT(void) initprintfwc() { SWIG_globals = SWIG_newvarlink(); m = Py_InitModule("printfwc", printfwcMethods); d = PyModule_GetDict(m); + PyDict_SetItemString(d,"wxPRINTER_NO_ERROR", PyInt_FromLong((long) wxPRINTER_NO_ERROR)); + PyDict_SetItemString(d,"wxPRINTER_CANCELLED", PyInt_FromLong((long) wxPRINTER_CANCELLED)); + PyDict_SetItemString(d,"wxPRINTER_ERROR", PyInt_FromLong((long) wxPRINTER_ERROR)); wxPyPtrTypeMap_Add("wxPrintout", "wxPyPrintout"); { diff --git a/wxPython/src/msw/printfw.py b/wxPython/src/msw/printfw.py index 086515a1db..663329cb7f 100644 --- a/wxPython/src/msw/printfw.py +++ b/wxPython/src/msw/printfw.py @@ -544,6 +544,9 @@ class wxPrinterPtr(wxObjectPtr): def Setup(self, *_args, **_kwargs): val = printfwc.wxPrinter_Setup(self, *_args, **_kwargs) return val + def GetAbort(self, *_args, **_kwargs): + val = printfwc.wxPrinter_GetAbort(self, *_args, **_kwargs) + return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxPrinter instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) class wxPrinter(wxPrinterPtr): @@ -643,7 +646,12 @@ wxPostScriptDC_SetResolution = printfwc.wxPostScriptDC_SetResolution wxPostScriptDC_GetResolution = printfwc.wxPostScriptDC_GetResolution +wxPrinter_GetLastError = printfwc.wxPrinter_GetLastError + #-------------- VARIABLE WRAPPERS ------------------ +wxPRINTER_NO_ERROR = printfwc.wxPRINTER_NO_ERROR +wxPRINTER_CANCELLED = printfwc.wxPRINTER_CANCELLED +wxPRINTER_ERROR = printfwc.wxPRINTER_ERROR diff --git a/wxPython/src/msw/windows2.cpp b/wxPython/src/msw/windows2.cpp index f0e9eed052..24c0ca369a 100644 --- a/wxPython/src/msw/windows2.cpp +++ b/wxPython/src/msw/windows2.cpp @@ -1280,7 +1280,7 @@ static PyObject *_wrap_wxNotebook_InsertPage(PyObject *self, PyObject *args, PyO PyObject * _argo2 = 0; PyObject * _obj3 = 0; int tempbool4 = (int) FALSE; - char *_kwnames[] = { "self","page","page","text","select","imageId", NULL }; + char *_kwnames[] = { "self","index","page","text","select","imageId", NULL }; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiOO|ii:wxNotebook_InsertPage",_kwnames,&_argo0,&_arg1,&_argo2,&_obj3,&tempbool4,&_arg5)) diff --git a/wxPython/src/msw/wx.cpp b/wxPython/src/msw/wx.cpp index 5fe7254649..3e6837af0f 100644 --- a/wxPython/src/msw/wx.cpp +++ b/wxPython/src/msw/wx.cpp @@ -3013,7 +3013,6 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxEVT_COMMAND_ENTER", PyInt_FromLong((long) wxEVT_COMMAND_ENTER)); PyDict_SetItemString(d,"wxEVT_NAVIGATION_KEY", PyInt_FromLong((long) wxEVT_NAVIGATION_KEY)); PyDict_SetItemString(d,"wxEVT_TIMER", PyInt_FromLong((long) wxEVT_TIMER)); - PyDict_SetItemString(d,"__version__", PyString_FromString("0.0.0")); PyDict_SetItemString(d,"cvar", SWIG_globals); SWIG_addvarlink(SWIG_globals,"wxDefaultPosition",_wrap_wxDefaultPosition_get, _wrap_wxDefaultPosition_set); SWIG_addvarlink(SWIG_globals,"wxDefaultSize",_wrap_wxDefaultSize_get, _wrap_wxDefaultSize_set); @@ -3058,17 +3057,12 @@ SWIGEXPORT(void) initwxc() { initfontsc(); + // Although these are redfined in __version__ they need to be here too so + // that an assert can be done to ensure that the wxPython and the wxWindows + // versions match. PyDict_SetItemString(d,"wxMAJOR_VERSION", PyInt_FromLong((long)wxMAJOR_VERSION )); PyDict_SetItemString(d,"wxMINOR_VERSION", PyInt_FromLong((long)wxMINOR_VERSION )); - PyDict_SetItemString(d,"wxRELEASE_NUMBER", PyInt_FromLong((long)wxRELEASE_NUMBER )); - PyDict_SetItemString(d,"wxVERSION_NUMBER", PyInt_FromLong((long)wxVERSION_NUMBER )); -#if wxUSE_UNICODE - wxString tempStr(wxVERSION_STRING); - PyDict_SetItemString(d,"wxVERSION_STRING", PyUnicode_FromWideChar(tempStr.c_str(), tempStr.Len())); -#else - PyDict_SetItemString(d,"wxVERSION_STRING", PyString_FromString(wxVERSION_STRING)); -#endif - + PyDict_SetItemString(d,"wxRELEASE_VERSION", PyInt_FromLong((long)wxRELEASE_NUMBER )); { int i; diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index f35f2ddc73..6f98058428 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -956,7 +956,6 @@ wxEVT_COMMAND_KILL_FOCUS = wxc.wxEVT_COMMAND_KILL_FOCUS wxEVT_COMMAND_ENTER = wxc.wxEVT_COMMAND_ENTER wxEVT_NAVIGATION_KEY = wxc.wxEVT_NAVIGATION_KEY wxEVT_TIMER = wxc.wxEVT_TIMER -__version__ = wxc.__version__ cvar = wxc.cvar wxDefaultPosition = wxPointPtr(wxc.cvar.wxDefaultPosition) wxDefaultSize = wxSizePtr(wxc.cvar.wxDefaultSize) @@ -1624,15 +1623,17 @@ if wxPlatform == "__WXMSW__": del os #---------------------------------------------------------------------- -# wxWindows version numbers. wxPython version is in __version__. +# Load version numbers from __version__... Ensure that major and minor +# versions are the same for both wxPython and wxWindows. -wxMAJOR_VERSION = wxc.wxMAJOR_VERSION -wxMINOR_VERSION = wxc.wxMINOR_VERSION -wxRELEASE_NUMBER = wxc.wxRELEASE_NUMBER -wxVERSION_STRING = wxc.wxVERSION_STRING -wxVERSION_NUMBER = wxc.wxVERSION_NUMBER +from wxPython.__version__ import * +__version__ = wxVERSION_STRING -wxVERSION = (wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) +assert wxMAJOR_VERSION == wxc.wxMAJOR_VERSION, "wxPython/wxWindows version mismatch" +assert wxMINOR_VERSION == wxc.wxMINOR_VERSION, "wxPython/wxWindows version mismatch" +if wxRELEASE_VERSION != wxc.wxRELEASE_VERSION: + import warnings + warnings.warn("wxPython/wxWindows release number mismatch") #----------------------------------------------------------------------