]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/ogl/_oglshapes2.i
test wxString's char<->wchar_t ctors
[wxWidgets.git] / wxPython / contrib / ogl / _oglshapes2.i
index cdbb5de50795453b4df42dbff2bc5e0799d95e37..99b00d4025a04f7b2a1b42984078ec7181c14ae3 100644 (file)
@@ -193,7 +193,27 @@ public:
     %extend {
         PyObject* GetLineControlPoints() {
             wxList* list = self->GetLineControlPoints();
     %extend {
         PyObject* GetLineControlPoints() {
             wxList* list = self->GetLineControlPoints();
-            return wxPy_ConvertShapeList(list);
+            return wxPy_ConvertRealPointList(list);
+        }
+
+        // part of Patch# 893337
+        void SetLineControlPoints(PyObject* list) {
+            wxList* real_point_list = wxPy_wxRealPoint_ListHelper(list);
+            self->MakeLineControlPoints((int)(real_point_list->GetCount()));
+            wxList* old_control_points = self->GetLineControlPoints();
+            wxNode* old_node = old_control_points->GetFirst();
+            wxNode* real_node = real_point_list->GetFirst();
+            while(old_node)
+            {
+                wxRealPoint* old_point = (wxRealPoint*)old_node->GetData();
+                wxRealPoint* new_point = (wxRealPoint*)real_node->GetData();
+                old_point->x = new_point->x;
+                old_point->y = new_point->y;
+                old_node = old_node->GetNext();
+                real_node = real_node->GetNext();
+            }
+            self->ClearPointList(*real_point_list);
+            delete real_point_list;
         }
     }
 
         }
     }
 
@@ -282,21 +302,7 @@ public:
     %extend {
         PyObject* GetPoints() {
             wxList* list = self->GetPoints();
     %extend {
         PyObject* GetPoints() {
             wxList* list = self->GetPoints();
-            PyObject*   pyList;
-            PyObject*   pyObj;
-            wxObject*   wxObj;
-            wxNode*     node = list->GetFirst();
-
-            bool blocked = wxPyBeginBlockThreads();
-            pyList = PyList_New(0);
-            while (node) {
-                wxObj = node->GetData();
-                pyObj = wxPyConstructObject(wxObj, wxT("wxRealPoint"), 0);
-                PyList_Append(pyList, pyObj);
-                node = node->GetNext();
-            }
-            wxPyEndBlockThreads(blocked);
-            return pyList;
+            return wxPy_ConvertRealPointList(list);
         }
 
         PyObject* GetOriginalPoints() {
         }
 
         PyObject* GetOriginalPoints() {