X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/edf2f43eade1ec5d3c6cbd96cb13551acabc9a99..c3d8ee42db5e8cad0dceb82ae88e9500a6c08d2f:/wxPython/contrib/ogl/oglcanvas.i?ds=sidebyside diff --git a/wxPython/contrib/ogl/oglcanvas.i b/wxPython/contrib/ogl/oglcanvas.i index 0794f68e2b..451ce9a7f1 100644 --- a/wxPython/contrib/ogl/oglcanvas.i +++ b/wxPython/contrib/ogl/oglcanvas.i @@ -14,7 +14,7 @@ %module oglcanvas %{ -#include "export.h" +#include "wxPython.h" #include "oglhelpers.h" %} @@ -37,6 +37,11 @@ %pragma(python) code = "import wx" //--------------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(ShapeCanvasNameStr); +%} + //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- @@ -59,7 +64,7 @@ public: %addmethods { PyObject* GetShapeList() { wxList* list = self->GetShapeList(); - return wxPy_ConvertList(list, "wxPyShape"); + return wxPy_ConvertShapeList(list, "wxPyShape"); } } @@ -114,13 +119,12 @@ public: wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxBORDER); + long style = wxBORDER, + const wxString& name = wxPyShapeCanvasNameStr); - void _setSelf(PyObject* self, PyObject* _class); - %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyShapeCanvas)" - - %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" - %pragma(python) addtomethod = "__init__:#wx._StdOnScrollCallbacks(self)" + void _setCallbackInfo(PyObject* self, PyObject* _class); + %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyShapeCanvas)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" void AddShape(wxPyShape *shape, wxPyShape *addAfter = NULL); @@ -149,6 +153,12 @@ public: void SetDiagram(wxDiagram *diagram); void Snap(double *INOUT, double *INOUT); + + %pragma(python) addtoclass = " + def GetShapeList(self): + return self.GetDiagram().GetShapeList() + " + };