]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/misc.i
incremented wxPython version number
[wxWidgets.git] / utils / wxPython / src / misc.i
index faef0a7a9aff143867c29ebe9ab89aeea3b276c0..589e506322ec3d33cf79d5f1fcb93fbbe14417cf 100644 (file)
@@ -68,8 +68,24 @@ public:
     double y;
     wxRealPoint(double x=0.0, double y=0.0);
     ~wxRealPoint();
+
+    %addmethods {
+        void Set(double x, double y) {
+            self->x = x;
+            self->y = y;
+        }
+        PyObject* asTuple() {
+            PyObject* tup = PyTuple_New(2);
+            PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x));
+            PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y));
+            return tup;
+        }
+    }
+    %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())"
+    %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())"
 };
 
+
 class wxPoint {
 public:
     long x;
@@ -126,8 +142,8 @@ public:
             PyObject* tup = PyTuple_New(4);
             PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
             PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
-            PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->width));
-            PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->height));
+            PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width));
+            PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height));
             return tup;
         }
     }
@@ -377,7 +393,7 @@ public:
 class wxAcceleratorEntry {
 public:
     wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0);
-    //~wxAcceleratorEntry();  *** ?
+    ~wxAcceleratorEntry();
 
     void Set(int flags, int keyCode, int Cmd);
     int GetFlags();
@@ -390,7 +406,7 @@ class wxAcceleratorTable {
 public:
     // Can also accept a list of 3-tuples
     wxAcceleratorTable(int LCOUNT, wxAcceleratorEntry* LIST);
-    // ~wxAcceleratorEntry(); *** ?
+    ~wxAcceleratorTable();
 
 };