diff --git a/wxPython/src/mac/controls.cpp b/wxPython/src/mac/controls.cpp index 5e11b717d4..fd0668dc1b 100644 --- a/wxPython/src/mac/controls.cpp +++ b/wxPython/src/mac/controls.cpp @@ -11078,7 +11078,38 @@ 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 PyMethodDef controlscMethods[] = { + { "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/mac/controls.py b/wxPython/src/mac/controls.py index b198c9f725..2f5891c83c 100644 --- a/wxPython/src/mac/controls.py +++ b/wxPython/src/mac/controls.py @@ -1103,6 +1103,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/mac/gdi.cpp b/wxPython/src/mac/gdi.cpp index 2af329172b..53f515bcd2 100644 --- a/wxPython/src/mac/gdi.cpp +++ b/wxPython/src/mac/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/mac/printfw.cpp b/wxPython/src/mac/printfw.cpp index af0892da95..96db8f33bb 100644 --- a/wxPython/src/mac/printfw.cpp +++ b/wxPython/src/mac/printfw.cpp @@ -4643,6 +4643,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; @@ -5366,6 +5412,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 }, @@ -5638,6 +5686,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/mac/printfw.py b/wxPython/src/mac/printfw.py index a550e9faf3..899b78f48c 100644 --- a/wxPython/src/mac/printfw.py +++ b/wxPython/src/mac/printfw.py @@ -525,6 +525,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): @@ -624,7 +627,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/mac/windows2.cpp b/wxPython/src/mac/windows2.cpp index 0e97d3909c..3d595705ee 100644 --- a/wxPython/src/mac/windows2.cpp +++ b/wxPython/src/mac/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/mac/wx.cpp b/wxPython/src/mac/wx.cpp index ec4e194b8a..38ee4e66fd 100644 --- a/wxPython/src/mac/wx.cpp +++ b/wxPython/src/mac/wx.cpp @@ -2952,7 +2952,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); @@ -2997,17 +2996,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/mac/wx.py b/wxPython/src/mac/wx.py index 88ece33404..c7a06129bc 100644 --- a/wxPython/src/mac/wx.py +++ b/wxPython/src/mac/wx.py @@ -950,7 +950,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) @@ -1618,15 +1617,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") #----------------------------------------------------------------------