Fixed GetShapeList and similar methods to use OOR.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -186,6 +186,25 @@ PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) {
|
|||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
PyObject* wxPy_ConvertShapeList(wxListBase* list, const char* className) {
|
||||||
|
PyObject* pyList;
|
||||||
|
PyObject* pyObj;
|
||||||
|
wxObject* wxObj;
|
||||||
|
wxNode* node = list->First();
|
||||||
|
|
||||||
|
wxPyBeginBlockThreads();
|
||||||
|
pyList = PyList_New(0);
|
||||||
|
while (node) {
|
||||||
|
wxObj = node->Data();
|
||||||
|
pyObj = wxPyMake_wxShapeEvtHandler((wxShapeEvtHandler*)wxObj);
|
||||||
|
PyList_Append(pyList, pyObj);
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
wxPyEndBlockThreads();
|
||||||
|
return pyList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@@ -235,6 +235,25 @@ PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) {
|
|||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
PyObject* wxPy_ConvertShapeList(wxListBase* list, const char* className) {
|
||||||
|
PyObject* pyList;
|
||||||
|
PyObject* pyObj;
|
||||||
|
wxObject* wxObj;
|
||||||
|
wxNode* node = list->First();
|
||||||
|
|
||||||
|
wxPyBeginBlockThreads();
|
||||||
|
pyList = PyList_New(0);
|
||||||
|
while (node) {
|
||||||
|
wxObj = node->Data();
|
||||||
|
pyObj = wxPyMake_wxShapeEvtHandler((wxShapeEvtHandler*)wxObj);
|
||||||
|
PyList_Append(pyList, pyObj);
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
wxPyEndBlockThreads();
|
||||||
|
return pyList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@@ -3080,7 +3080,7 @@ static PyObject *_wrap_wxPyShape_GetTopAncestor(PyObject *self, PyObject *args,
|
|||||||
|
|
||||||
static PyObject * wxPyShape_GetChildren(wxPyShape *self) {
|
static PyObject * wxPyShape_GetChildren(wxPyShape *self) {
|
||||||
wxList& list = self->GetChildren();
|
wxList& list = self->GetChildren();
|
||||||
return wxPy_ConvertList(&list, "wxPyShape");
|
return wxPy_ConvertShapeList(&list, "wxPyShape");
|
||||||
}
|
}
|
||||||
static PyObject *_wrap_wxPyShape_GetChildren(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_wxPyShape_GetChildren(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject * _resultobj;
|
PyObject * _resultobj;
|
||||||
@@ -4147,7 +4147,7 @@ static PyObject *_wrap_wxPyShape_GetMaintainAspectRatio(PyObject *self, PyObject
|
|||||||
|
|
||||||
static PyObject * wxPyShape_GetLines(wxPyShape *self) {
|
static PyObject * wxPyShape_GetLines(wxPyShape *self) {
|
||||||
wxList& list = self->GetLines();
|
wxList& list = self->GetLines();
|
||||||
return wxPy_ConvertList(&list, "wxPyLineShape");
|
return wxPy_ConvertShapeList(&list, "wxPyLineShape");
|
||||||
}
|
}
|
||||||
static PyObject *_wrap_wxPyShape_GetLines(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_wxPyShape_GetLines(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject * _resultobj;
|
PyObject * _resultobj;
|
||||||
|
@@ -179,7 +179,7 @@ public:
|
|||||||
%addmethods {
|
%addmethods {
|
||||||
PyObject* GetChildren() {
|
PyObject* GetChildren() {
|
||||||
wxList& list = self->GetChildren();
|
wxList& list = self->GetChildren();
|
||||||
return wxPy_ConvertList(&list, "wxPyShape");
|
return wxPy_ConvertShapeList(&list, "wxPyShape");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ public:
|
|||||||
%addmethods {
|
%addmethods {
|
||||||
PyObject* GetLines() {
|
PyObject* GetLines() {
|
||||||
wxList& list = self->GetLines();
|
wxList& list = self->GetLines();
|
||||||
return wxPy_ConvertList(&list, "wxPyLineShape");
|
return wxPy_ConvertShapeList(&list, "wxPyLineShape");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -425,7 +425,7 @@ static PyObject *_wrap_wxDiagram_GetMouseTolerance(PyObject *self, PyObject *arg
|
|||||||
|
|
||||||
static PyObject * wxDiagram_GetShapeList(wxDiagram *self) {
|
static PyObject * wxDiagram_GetShapeList(wxDiagram *self) {
|
||||||
wxList* list = self->GetShapeList();
|
wxList* list = self->GetShapeList();
|
||||||
return wxPy_ConvertList(list, "wxPyShape");
|
return wxPy_ConvertShapeList(list, "wxPyShape");
|
||||||
}
|
}
|
||||||
static PyObject *_wrap_wxDiagram_GetShapeList(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_wxDiagram_GetShapeList(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject * _resultobj;
|
PyObject * _resultobj;
|
||||||
|
@@ -59,7 +59,7 @@ public:
|
|||||||
%addmethods {
|
%addmethods {
|
||||||
PyObject* GetShapeList() {
|
PyObject* GetShapeList() {
|
||||||
wxList* list = self->GetShapeList();
|
wxList* list = self->GetShapeList();
|
||||||
return wxPy_ConvertList(list, "wxPyShape");
|
return wxPy_ConvertShapeList(list, "wxPyShape");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,6 +147,12 @@ public:
|
|||||||
void SetDiagram(wxDiagram *diagram);
|
void SetDiagram(wxDiagram *diagram);
|
||||||
void Snap(double *INOUT, double *INOUT);
|
void Snap(double *INOUT, double *INOUT);
|
||||||
|
|
||||||
|
|
||||||
|
%pragma(python) addtoclass = "
|
||||||
|
def GetShapeList(self):
|
||||||
|
return self.GetDiagram().GetShapeList()
|
||||||
|
"
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -209,6 +209,10 @@ class wxPyShapeCanvasPtr(wxScrolledWindowPtr):
|
|||||||
return val
|
return val
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<C wxPyShapeCanvas instance at %s>" % (self.this,)
|
return "<C wxPyShapeCanvas instance at %s>" % (self.this,)
|
||||||
|
|
||||||
|
def GetShapeList(self):
|
||||||
|
return self.GetDiagram().GetShapeList()
|
||||||
|
|
||||||
class wxPyShapeCanvas(wxPyShapeCanvasPtr):
|
class wxPyShapeCanvas(wxPyShapeCanvasPtr):
|
||||||
def __init__(self,*_args,**_kwargs):
|
def __init__(self,*_args,**_kwargs):
|
||||||
self.this = apply(oglcanvasc.new_wxPyShapeCanvas,_args,_kwargs)
|
self.this = apply(oglcanvasc.new_wxPyShapeCanvas,_args,_kwargs)
|
||||||
|
@@ -101,6 +101,7 @@
|
|||||||
wxList* wxPy_wxListHelper(PyObject* pyList, char* className);
|
wxList* wxPy_wxListHelper(PyObject* pyList, char* className);
|
||||||
wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList);
|
wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList);
|
||||||
PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source);
|
PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source);
|
||||||
|
PyObject* wxPy_ConvertShapeList(wxListBase* list, const char* className);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -8147,7 +8147,7 @@ static PyObject *_wrap_wxPyCompositeShape_GetConstraints(PyObject *self, PyObjec
|
|||||||
|
|
||||||
static PyObject * wxPyCompositeShape_GetDivisions(wxPyCompositeShape *self) {
|
static PyObject * wxPyCompositeShape_GetDivisions(wxPyCompositeShape *self) {
|
||||||
wxList& list = self->GetDivisions();
|
wxList& list = self->GetDivisions();
|
||||||
return wxPy_ConvertList(&list, "wxPyDivisionShape");
|
return wxPy_ConvertShapeList(&list, "wxPyDivisionShape");
|
||||||
}
|
}
|
||||||
static PyObject *_wrap_wxPyCompositeShape_GetDivisions(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_wxPyCompositeShape_GetDivisions(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject * _resultobj;
|
PyObject * _resultobj;
|
||||||
|
@@ -408,7 +408,7 @@ public:
|
|||||||
|
|
||||||
PyObject* GetDivisions() {
|
PyObject* GetDivisions() {
|
||||||
wxList& list = self->GetDivisions();
|
wxList& list = self->GetDivisions();
|
||||||
return wxPy_ConvertList(&list, "wxPyDivisionShape");
|
return wxPy_ConvertShapeList(&list, "wxPyDivisionShape");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4093,7 +4093,7 @@ static PyObject *_wrap_wxPyLineShape_MakeLineControlPoints(PyObject *self, PyObj
|
|||||||
|
|
||||||
static PyObject * wxPyLineShape_GetLineControlPoints(wxPyLineShape *self) {
|
static PyObject * wxPyLineShape_GetLineControlPoints(wxPyLineShape *self) {
|
||||||
wxList* list = self->GetLineControlPoints();
|
wxList* list = self->GetLineControlPoints();
|
||||||
return wxPy_ConvertList(list, "wxPyControlPoint");
|
return wxPy_ConvertShapeList(list, "wxPyControlPoint");
|
||||||
}
|
}
|
||||||
static PyObject *_wrap_wxPyLineShape_GetLineControlPoints(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_wxPyLineShape_GetLineControlPoints(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject * _resultobj;
|
PyObject * _resultobj;
|
||||||
|
@@ -221,7 +221,7 @@ public:
|
|||||||
%addmethods {
|
%addmethods {
|
||||||
PyObject* GetLineControlPoints() {
|
PyObject* GetLineControlPoints() {
|
||||||
wxList* list = self->GetLineControlPoints();
|
wxList* list = self->GetLineControlPoints();
|
||||||
return wxPy_ConvertList(list, "wxPyControlPoint");
|
return wxPy_ConvertShapeList(list, "wxPyControlPoint");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user