]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/ogl/oglbasic.i
use wxColourDatabase::Find() instead of deprecated FindColour(); some minor code...
[wxWidgets.git] / wxPython / contrib / ogl / oglbasic.i
index 7e982eeb31f768da0b22557bc411c04897dd1d95..72202703238ba87c4771da1a9ba9c3de9a00daf3 100644 (file)
@@ -14,7 +14,7 @@
 %module oglbasic
 
 %{
 %module oglbasic
 
 %{
-#include "export.h"
+#include "wxPython.h"
 #include "oglhelpers.h"
 %}
 
 #include "oglhelpers.h"
 %}
 
@@ -99,7 +99,7 @@ public:
     %addmethods { void Destroy() { delete self; } }
     %addmethods {
         void _setOORInfo(PyObject* _self) {
     %addmethods { void Destroy() { delete self; } }
     %addmethods {
         void _setOORInfo(PyObject* _self) {
-            self->SetClientObject(new wxPyClientData(_self));
+            self->SetClientObject(new wxPyOORClientData(_self));
         }
     }
 
         }
     }
 
@@ -179,7 +179,7 @@ public:
     %addmethods {
         PyObject* GetChildren() {
             wxList& list = self->GetChildren();
     %addmethods {
         PyObject* GetChildren() {
             wxList& list = self->GetChildren();
-            return wxPy_ConvertList(&list, "wxPyShape");
+            return wxPy_ConvertShapeList(&list, "wxPyShape");
         }
     }
 
         }
     }
 
@@ -223,7 +223,7 @@ public:
     %addmethods {
         PyObject* GetLines() {
             wxList& list = self->GetLines();
     %addmethods {
         PyObject* GetLines() {
             wxList& list = self->GetLines();
-            return wxPy_ConvertList(&list, "wxPyLineShape");
+            return wxPy_ConvertShapeList(&list, "wxPyLineShape");
         }
     }
 
         }
     }
 
@@ -240,25 +240,17 @@ public:
 
     // void SetClientData(wxObject *client_data);
     // wxObject *GetClientData();
 
     // void SetClientData(wxObject *client_data);
     // wxObject *GetClientData();
-    %addmethods {
-        void SetClientData(PyObject* userData) {
-            wxPyUserData* data = NULL;
-            if (userData)
-                data = new wxPyUserData(userData);
-            self->SetClientData(data);
-        }
 
 
-        PyObject* GetClientData() {
-            wxPyUserData* data = (wxPyUserData*)self->GetClientData();
-            if (data) {
-                Py_INCREF(data->m_obj);
-                return data->m_obj;
-            } else {
-                Py_INCREF(Py_None);
-                return Py_None;
-            }
-        }
-    }
+    // The real client data methods are being used for OOR, so just fake it.
+    %pragma(python) addtoclass = "
+    def SetClientData(self, data):
+        self.clientData = data
+    def GetClientData(self):
+        if hasattr(self, 'clientData'):
+            return self.clientData
+        else:
+            return None
+"
 
     void Show(bool show);
     bool IsShown();
 
     void Show(bool show);
     bool IsShown();
@@ -311,7 +303,7 @@ public:
     void ClearText(int regionId = 0);
     void RemoveLine(wxPyLineShape *line);
 
     void ClearText(int regionId = 0);
     void RemoveLine(wxPyLineShape *line);
 
-#ifdef PROLOGIO
+#ifdef wxUSE_PROLOGIO
     void WriteAttributes(wxExpr *clause);
     void ReadAttributes(wxExpr *clause);
     void ReadConstraints(wxExpr *clause, wxExprDatabase *database);
     void WriteAttributes(wxExpr *clause);
     void ReadAttributes(wxExpr *clause);
     void ReadConstraints(wxExpr *clause, wxExprDatabase *database);