From 211a46cf8271a93ad670effd0d2b742c6050f50f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 21 Feb 2001 20:57:57 +0000 Subject: [PATCH] some little fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/ogl/oglcanvas.cpp | 48 +++++++++++++++++------------ wxPython/contrib/ogl/oglcanvas.i | 4 +-- wxPython/contrib/ogl/oglshapes2.i | 3 ++ wxPython/src/misc.i | 8 ++--- wxPython/src/msw/misc.py | 49 +++++++++++++++++++++++++----- 5 files changed, 78 insertions(+), 34 deletions(-) diff --git a/wxPython/contrib/ogl/oglcanvas.cpp b/wxPython/contrib/ogl/oglcanvas.cpp index 01e8e4f8e2..cb4a4542e2 100644 --- a/wxPython/contrib/ogl/oglcanvas.cpp +++ b/wxPython/contrib/ogl/oglcanvas.cpp @@ -1119,20 +1119,16 @@ static PyObject *_wrap_wxDiagram_Snap(PyObject *self, PyObject *args, PyObject * PyObject * _resultobj; wxDiagram * _arg0; double * _arg1; - double temp; double * _arg2; - double temp0; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + double temp; + PyObject * _obj1 = 0; + double temp0; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","INOUT","INOUT", NULL }; self = self; -{ - _arg1 = &temp; -} -{ - _arg2 = &temp0; -} - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxDiagram_Snap",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxDiagram_Snap",_kwnames,&_argo0,&_obj1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1141,6 +1137,14 @@ static PyObject *_wrap_wxDiagram_Snap(PyObject *self, PyObject *args, PyObject * return NULL; } } +{ + temp = PyFloat_AsDouble(_obj1); + _arg1 = &temp; +} +{ + temp0 = PyFloat_AsDouble(_obj2); + _arg2 = &temp0; +} { wxPy_BEGIN_ALLOW_THREADS; wxDiagram_Snap(_arg0,_arg1,_arg2); @@ -1896,20 +1900,16 @@ static PyObject *_wrap_wxPyShapeCanvas_Snap(PyObject *self, PyObject *args, PyOb PyObject * _resultobj; wxPyShapeCanvas * _arg0; double * _arg1; - double temp; double * _arg2; - double temp0; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + double temp; + PyObject * _obj1 = 0; + double temp0; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","INOUT","INOUT", NULL }; self = self; -{ - _arg1 = &temp; -} -{ - _arg2 = &temp0; -} - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxPyShapeCanvas_Snap",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxPyShapeCanvas_Snap",_kwnames,&_argo0,&_obj1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1918,6 +1918,14 @@ static PyObject *_wrap_wxPyShapeCanvas_Snap(PyObject *self, PyObject *args, PyOb return NULL; } } +{ + temp = PyFloat_AsDouble(_obj1); + _arg1 = &temp; +} +{ + temp0 = PyFloat_AsDouble(_obj2); + _arg2 = &temp0; +} { wxPy_BEGIN_ALLOW_THREADS; wxPyShapeCanvas_Snap(_arg0,_arg1,_arg2); diff --git a/wxPython/contrib/ogl/oglcanvas.i b/wxPython/contrib/ogl/oglcanvas.i index 88ed4a4345..036aaa8377 100644 --- a/wxPython/contrib/ogl/oglcanvas.i +++ b/wxPython/contrib/ogl/oglcanvas.i @@ -91,7 +91,7 @@ public: void SetQuickEditMode(bool mode); void SetSnapToGrid(bool snap); void ShowAll(bool show); - void Snap(double *OUTPUT, double *OUTPUT); + void Snap(double *INOUT, double *INOUT); }; @@ -147,7 +147,7 @@ public: void Redraw(wxDC& dc); void RemoveShape(wxPyShape *shape); void SetDiagram(wxDiagram *diagram); - void Snap(double *OUTPUT, double *OUTPUT); + void Snap(double *INOUT, double *INOUT); }; diff --git a/wxPython/contrib/ogl/oglshapes2.i b/wxPython/contrib/ogl/oglshapes2.i index 2b90a48590..a79ebca598 100644 --- a/wxPython/contrib/ogl/oglshapes2.i +++ b/wxPython/contrib/ogl/oglshapes2.i @@ -207,6 +207,9 @@ public: bool IsSpline(); void MakeLineControlPoints(int n); + // TODO: + // inline wxList *GetLineControlPoints() { return m_lineControlPoints; } + void SetAttachmentFrom(int fromAttach); void SetAttachments(int fromAttach, int toAttach); void SetAttachmentTo(int toAttach); diff --git a/wxPython/src/misc.i b/wxPython/src/misc.i index 74b104185d..1378bba20f 100644 --- a/wxPython/src/misc.i +++ b/wxPython/src/misc.i @@ -64,7 +64,7 @@ public: %pragma(python) addtoclass = " def __str__(self): return str(self.asTuple()) def __repr__(self): return str(self.asTuple()) - def __len__(self): return len(self.asTuple() + def __len__(self): return len(self.asTuple()) def __getitem__(self, index): return self.asTuple()[index] def __setitem__(self, index, val): if index == 0: self.width = val @@ -113,7 +113,7 @@ public: %pragma(python) addtoclass = " def __str__(self): return str(self.asTuple()) def __repr__(self): return str(self.asTuple()) - def __len__(self): return len(self.asTuple() + def __len__(self): return len(self.asTuple()) def __getitem__(self, index): return self.asTuple()[index] def __setitem__(self, index, val): if index == 0: self.width = val @@ -160,7 +160,7 @@ public: %pragma(python) addtoclass = " def __str__(self): return str(self.asTuple()) def __repr__(self): return str(self.asTuple()) - def __len__(self): return len(self.asTuple() + def __len__(self): return len(self.asTuple()) def __getitem__(self, index): return self.asTuple()[index] def __setitem__(self, index, val): if index == 0: self.x = val @@ -229,7 +229,7 @@ public: %pragma(python) addtoclass = " def __str__(self): return str(self.asTuple()) def __repr__(self): return str(self.asTuple()) - def __len__(self): return len(self.asTuple() + def __len__(self): return len(self.asTuple()) def __getitem__(self, index): return self.asTuple()[index] def __setitem__(self, index, val): if index == 0: self.x = val diff --git a/wxPython/src/msw/misc.py b/wxPython/src/msw/misc.py index e2ad047487..d6ad91e3fb 100644 --- a/wxPython/src/msw/misc.py +++ b/wxPython/src/msw/misc.py @@ -57,8 +57,16 @@ class wxSizePtr : raise AttributeError,name def __repr__(self): return "" % (self.this,) - def __str__(self): return str(self.asTuple()) - def __repr__(self): return str(self.asTuple()) + + def __str__(self): return str(self.asTuple()) + def __repr__(self): return str(self.asTuple()) + def __len__(self): return len(self.asTuple()) + def __getitem__(self, index): return self.asTuple()[index] + def __setitem__(self, index, val): + if index == 0: self.width = val + elif index == 1: self.height = val + else: raise IndexError + class wxSize(wxSizePtr): def __init__(self,*_args,**_kwargs): self.this = apply(miscc.new_wxSize,_args,_kwargs) @@ -107,8 +115,16 @@ class wxRealPointPtr : raise AttributeError,name def __repr__(self): return "" % (self.this,) - def __str__(self): return str(self.asTuple()) - def __repr__(self): return str(self.asTuple()) + + def __str__(self): return str(self.asTuple()) + def __repr__(self): return str(self.asTuple()) + def __len__(self): return len(self.asTuple()) + def __getitem__(self, index): return self.asTuple()[index] + def __setitem__(self, index, val): + if index == 0: self.width = val + elif index == 1: self.height = val + else: raise IndexError + class wxRealPoint(wxRealPointPtr): def __init__(self,*_args,**_kwargs): self.this = apply(miscc.new_wxRealPoint,_args,_kwargs) @@ -157,8 +173,16 @@ class wxPointPtr : raise AttributeError,name def __repr__(self): return "" % (self.this,) - def __str__(self): return str(self.asTuple()) - def __repr__(self): return str(self.asTuple()) + + def __str__(self): return str(self.asTuple()) + def __repr__(self): return str(self.asTuple()) + def __len__(self): return len(self.asTuple()) + def __getitem__(self, index): return self.asTuple()[index] + def __setitem__(self, index, val): + if index == 0: self.x = val + elif index == 1: self.y = val + else: raise IndexError + class wxPoint(wxPointPtr): def __init__(self,*_args,**_kwargs): self.this = apply(miscc.new_wxPoint,_args,_kwargs) @@ -272,9 +296,18 @@ class wxRectPtr : raise AttributeError,name def __repr__(self): return "" % (self.this,) - def __str__(self): return str(self.asTuple()) - def __repr__(self): return str(self.asTuple()) + def __str__(self): return str(self.asTuple()) + def __repr__(self): return str(self.asTuple()) + def __len__(self): return len(self.asTuple()) + def __getitem__(self, index): return self.asTuple()[index] + def __setitem__(self, index, val): + if index == 0: self.x = val + elif index == 1: self.y = val + elif index == 2: self.width = val + elif index == 3: self.height = val + else: raise IndexError + # override the __getattr__ made by SWIG def __getattr__(self, name): d = { -- 2.45.2