diff --git a/wxPython/src/msw/fonts.py b/wxPython/src/msw/fonts.py index b6a35cb2cc..d6240d3358 100644 --- a/wxPython/src/msw/fonts.py +++ b/wxPython/src/msw/fonts.py @@ -212,6 +212,7 @@ class wxFontPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxFont instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxFont(wxFontPtr): def __init__(self,*_args,**_kwargs): self.this = fontsc.new_wxFont(*_args,**_kwargs) @@ -398,6 +399,7 @@ class wxEncodingConverterPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxEncodingConverter instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.IsOk() class wxEncodingConverter(wxEncodingConverterPtr): def __init__(self,*_args,**_kwargs): self.this = fontsc.new_wxEncodingConverter(*_args,**_kwargs) diff --git a/wxPython/src/msw/gdi.py b/wxPython/src/msw/gdi.py index 2d18caeb78..62eddbcfaf 100644 --- a/wxPython/src/msw/gdi.py +++ b/wxPython/src/msw/gdi.py @@ -117,6 +117,7 @@ class wxBitmapPtr(wxGDIObjectPtr): mask = wxMaskColour(self, colour) self.SetMask(mask) + def __nonzero__(self): return self.Ok() class wxBitmap(wxBitmapPtr): def __init__(self,*_args,**_kwargs): self.this = gdic.new_wxBitmap(*_args,**_kwargs) @@ -190,6 +191,7 @@ class wxIconPtr(wxGDIObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxIcon instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxIcon(wxIconPtr): def __init__(self,*_args,**_kwargs): self.this = gdic.new_wxIcon(*_args,**_kwargs) @@ -280,6 +282,7 @@ class wxCursorPtr(wxGDIObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxCursor instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxCursor(wxCursorPtr): def __init__(self,*_args,**_kwargs): self.this = gdic.new_wxCursor(*_args,**_kwargs) @@ -422,6 +425,7 @@ class wxPenPtr(wxGDIObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxPen instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxPen(wxPenPtr): def __init__(self,*_args,**_kwargs): self.this = gdic.new_wxPen(*_args,**_kwargs) @@ -514,6 +518,7 @@ class wxBrushPtr(wxGDIObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxBrush instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxBrush(wxBrushPtr): def __init__(self,*_args,**_kwargs): self.this = gdic.new_wxBrush(*_args,**_kwargs) @@ -865,6 +870,7 @@ class wxDCPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() def DrawPointList(self, points, pens=None): if pens is None: @@ -1119,6 +1125,7 @@ class wxMetaFilePtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxMetaFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxMetaFile(wxMetaFilePtr): def __init__(self,*_args,**_kwargs): self.this = gdic.new_wxMetaFile(*_args,**_kwargs) @@ -1166,6 +1173,7 @@ class wxPalettePtr(wxGDIObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxPalette instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxPalette(wxPalettePtr): def __init__(self,*_args,**_kwargs): self.this = gdic.new_wxPalette(*_args,**_kwargs) diff --git a/wxPython/src/msw/grid.cpp b/wxPython/src/msw/grid.cpp index 7d014abd12..d4c234a3c5 100644 --- a/wxPython/src/msw/grid.cpp +++ b/wxPython/src/msw/grid.cpp @@ -4094,14 +4094,20 @@ static PyObject *_wrap_wxGridCellAttr_GetSize(PyObject *self, PyObject *args, Py PyObject * _resultobj; wxGridCellAttr * _arg0; int * _arg1; + int temp; int * _arg2; + int temp0; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - PyObject * _argo2 = 0; - char *_kwnames[] = { "self","num_rows","num_cols", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxGridCellAttr_GetSize",_kwnames,&_argo0,&_argo1,&_argo2)) +{ + _arg1 = &temp; +} +{ + _arg2 = &temp0; +} + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGridCellAttr_GetSize",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4110,20 +4116,6 @@ static PyObject *_wrap_wxGridCellAttr_GetSize(PyObject *self, PyObject *args, Py return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGridCellAttr_GetSize. Expected _int_p."); - return NULL; - } - } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxGridCellAttr_GetSize. Expected _int_p."); - return NULL; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); wxGridCellAttr_GetSize(_arg0,_arg1,_arg2); @@ -4132,6 +4124,16 @@ static PyObject *_wrap_wxGridCellAttr_GetSize(PyObject *self, PyObject *args, Py if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg1)); + _resultobj = t_output_helper(_resultobj, o); +} +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg2)); + _resultobj = t_output_helper(_resultobj, o); +} return _resultobj; } @@ -11022,14 +11024,20 @@ static PyObject *_wrap_wxGrid_GetDefaultCellAlignment(PyObject *self, PyObject * PyObject * _resultobj; wxGrid * _arg0; int * _arg1; + int temp; int * _arg2; + int temp0; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - PyObject * _argo2 = 0; - char *_kwnames[] = { "self","horiz","vert", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxGrid_GetDefaultCellAlignment",_kwnames,&_argo0,&_argo1,&_argo2)) +{ + _arg1 = &temp; +} +{ + _arg2 = &temp0; +} + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGrid_GetDefaultCellAlignment",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -11038,20 +11046,6 @@ static PyObject *_wrap_wxGrid_GetDefaultCellAlignment(PyObject *self, PyObject * return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGrid_GetDefaultCellAlignment. Expected _int_p."); - return NULL; - } - } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxGrid_GetDefaultCellAlignment. Expected _int_p."); - return NULL; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); wxGrid_GetDefaultCellAlignment(_arg0,_arg1,_arg2); @@ -11060,6 +11054,16 @@ static PyObject *_wrap_wxGrid_GetDefaultCellAlignment(PyObject *self, PyObject * if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg1)); + _resultobj = t_output_helper(_resultobj, o); +} +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg2)); + _resultobj = t_output_helper(_resultobj, o); +} return _resultobj; } @@ -11070,14 +11074,20 @@ static PyObject *_wrap_wxGrid_GetCellAlignment(PyObject *self, PyObject *args, P int _arg1; int _arg2; int * _arg3; + int temp; int * _arg4; + int temp0; PyObject * _argo0 = 0; - PyObject * _argo3 = 0; - PyObject * _argo4 = 0; - char *_kwnames[] = { "self","row","col","horiz","vert", NULL }; + char *_kwnames[] = { "self","row","col", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiiOO:wxGrid_GetCellAlignment",_kwnames,&_argo0,&_arg1,&_arg2,&_argo3,&_argo4)) +{ + _arg3 = &temp; +} +{ + _arg4 = &temp0; +} + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxGrid_GetCellAlignment",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -11086,20 +11096,6 @@ static PyObject *_wrap_wxGrid_GetCellAlignment(PyObject *self, PyObject *args, P return NULL; } } - if (_argo3) { - if (_argo3 == Py_None) { _arg3 = NULL; } - else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxGrid_GetCellAlignment. Expected _int_p."); - return NULL; - } - } - if (_argo4) { - if (_argo4 == Py_None) { _arg4 = NULL; } - else if (SWIG_GetPtrObj(_argo4,(void **) &_arg4,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 5 of wxGrid_GetCellAlignment. Expected _int_p."); - return NULL; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); wxGrid_GetCellAlignment(_arg0,_arg1,_arg2,_arg3,_arg4); @@ -11108,6 +11104,16 @@ static PyObject *_wrap_wxGrid_GetCellAlignment(PyObject *self, PyObject *args, P if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg3)); + _resultobj = t_output_helper(_resultobj, o); +} +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg4)); + _resultobj = t_output_helper(_resultobj, o); +} return _resultobj; } diff --git a/wxPython/src/msw/image.py b/wxPython/src/msw/image.py index a292abc2f5..63d6120d19 100644 --- a/wxPython/src/msw/image.py +++ b/wxPython/src/msw/image.py @@ -345,6 +345,7 @@ class wxImagePtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxImage(wxImagePtr): def __init__(self,*_args,**_kwargs): self.this = imagec.new_wxImage(*_args,**_kwargs) diff --git a/wxPython/src/msw/misc2.py b/wxPython/src/msw/misc2.py index c4aac2a0c3..82a2840a26 100644 --- a/wxPython/src/msw/misc2.py +++ b/wxPython/src/msw/misc2.py @@ -147,6 +147,7 @@ class wxCaretPtr : return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxCaret instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.IsOk() class wxCaret(wxCaretPtr): def __init__(self,*_args,**_kwargs): self.this = misc2c.new_wxCaret(*_args,**_kwargs) @@ -794,6 +795,7 @@ class wxJoystickPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxJoystick instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.IsOk() class wxJoystick(wxJoystickPtr): def __init__(self,*_args,**_kwargs): self.this = misc2c.new_wxJoystick(*_args,**_kwargs) @@ -820,6 +822,7 @@ class wxWavePtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxWave instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.IsOk() class wxWave(wxWavePtr): def __init__(self,*_args,**_kwargs): self.this = misc2c.new_wxWave(*_args,**_kwargs) diff --git a/wxPython/src/msw/printfw.py b/wxPython/src/msw/printfw.py index 663329cb7f..074d81a448 100644 --- a/wxPython/src/msw/printfw.py +++ b/wxPython/src/msw/printfw.py @@ -157,6 +157,7 @@ class wxPrintDataPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxPrintData instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxPrintData(wxPrintDataPtr): def __init__(self,*_args,**_kwargs): self.this = printfwc.new_wxPrintData(*_args,**_kwargs) @@ -310,6 +311,7 @@ class wxPageSetupDialogDataPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxPageSetupDialogData instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxPageSetupDialogData(wxPageSetupDialogDataPtr): def __init__(self,*_args,**_kwargs): self.this = printfwc.new_wxPageSetupDialogData(*_args,**_kwargs) @@ -422,6 +424,7 @@ class wxPrintDialogDataPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxPrintDialogData instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxPrintDialogData(wxPrintDialogDataPtr): def __init__(self,*_args,**_kwargs): self.this = printfwc.new_wxPrintDialogData(*_args,**_kwargs) @@ -612,6 +615,7 @@ class wxPrintPreviewPtr(wxObjectPtr): return val def __repr__(self): return "<%s.%s instance; proxy of C++ wxPrintPreview instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this) + def __nonzero__(self): return self.Ok() class wxPrintPreview(wxPrintPreviewPtr): def __init__(self,*_args,**_kwargs): self.this = printfwc.new_wxPrintPreview(*_args,**_kwargs)