]> git.saurik.com Git - wxWidgets.git/commitdiff
Some wxOGL tweaks to match what has been done in the C++ classes
authorRobin Dunn <robin@alldunn.com>
Fri, 2 Jan 2004 20:37:37 +0000 (20:37 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 2 Jan 2004 20:37:37 +0000 (20:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/contrib/ogl/_ogl_rename.i
wxPython/contrib/ogl/_oglbasic.i
wxPython/contrib/ogl/_oglshapes.i
wxPython/contrib/ogl/_oglshapes2.i

index c02b9f190e6eae6d530c20e38d7b272aae3ac60b..415d2d94e8116b7868b8688d7d8e288c65c2b38d 100644 (file)
@@ -4,6 +4,7 @@
 #ifndef BUILDING_RENAMERS
 
 %rename(ShapeRegion)                        wxShapeRegion;
+%rename(AttachmentPoint)                    wxAttachmentPoint;
 %rename(PyShapeEvtHandler)                  wxPyShapeEvtHandler;
 %rename(PyShape)                            wxPyShape;
 %rename(PseudoMetaFile)                     wxPseudoMetaFile;
index 334ef5260579af16fdeeaa9e949948ef9dc469b0..334cc093c0d81c7db2a4f86c70709082e313c4f2 100644 (file)
@@ -56,6 +56,22 @@ public:
 };
 
 
+//---------------------------------------------------------------------------
+
+/*
+ * User-defined attachment point
+ */
+
+class wxAttachmentPoint: public wxObject
+{
+public:
+    wxAttachmentPoint(int id=0, double x=0.0, double y=0.0);
+    int            m_id;           // Identifier
+    double         m_x;            // x offset from centre of object
+    double         m_y;            // y offset from centre of object
+};
+
+
 //---------------------------------------------------------------------------
 
 %{
@@ -294,6 +310,14 @@ public:
                                int nth = 0, int no_arcs = 1, wxPyLineShape *line = NULL);
     int GetNumberOfAttachments();
     bool AttachmentIsValid(int attachment);
+
+    %extend {
+        PyObject* GetAttachments() {
+            wxList& list = self->GetAttachments();
+            return wxPy_ConvertList(&list);            
+        }
+    }
+    
     bool GetAttachmentPositionEdge(int attachment, double *OUTPUT, double *OUTPUT,
                                    int nth = 0, int no_arcs = 1, wxPyLineShape *line = NULL);
     wxRealPoint CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPoint& pt2,
@@ -336,6 +360,7 @@ public:
     void CopyWithHandler(wxPyShape& copy);
     void Rotate(double x, double y, double theta);
     double GetRotation();
+    void SetRotation(double rotation);
     void ClearAttachments();
     void Recentre(wxDC& dc);
     void ClearPointList(wxList& list);
index db2111178ff9f96847bbc0395226d65a295dfcdd..ef27d7bba3c0fead2996fe30a66c45e6f0a48251 100644 (file)
@@ -130,7 +130,8 @@ public:
     void _setCallbackInfo(PyObject* self, PyObject* _class);
 
     void SetCornerRadius(double radius);
-
+    double GetCornerRadius();
+    
     void base_OnDelete();
     void base_OnDraw(wxDC& dc);
     void base_OnDrawContents(wxDC& dc);
index febeead238afa78ee589f5cb4850c3ba87cf1f10..8a8a570003e5b62882c7d45116fd51107f1c2efc 100644 (file)
@@ -209,6 +209,13 @@ public:
     void Unlink();
 
 
+    void SetAlignmentOrientation(bool isEnd, bool isHoriz);
+    void SetAlignmentType(bool isEnd, int alignType);
+    bool GetAlignmentOrientation(bool isEnd);
+    int GetAlignmentType(bool isEnd);
+    int GetAlignmentStart() const;
+    int GetAlignmentEnd() const;
+
     void base_OnDraw(wxDC& dc);
     void base_OnDrawContents(wxDC& dc);
     void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
@@ -291,8 +298,33 @@ public:
             wxPyEndBlockThreads();
             return pyList;
         }
+
+        PyObject* GetOriginalPoints() {
+            wxList* list = self->GetOriginalPoints();
+            PyObject*   pyList;
+            PyObject*   pyObj;
+            wxObject*   wxObj;
+            wxNode*     node = list->GetFirst();
+
+            wxPyBeginBlockThreads();
+            pyList = PyList_New(0);
+            while (node) {
+                wxObj = node->GetData();
+                pyObj = wxPyConstructObject(wxObj, wxT("wxRealPoint"), 0);
+                PyList_Append(pyList, pyObj);
+                node = node->GetNext();
+            }
+            wxPyEndBlockThreads();
+            return pyList;
+        }        
     }
 
+    double GetOriginalWidth() const;
+    double GetOriginalHeight() const;
+
+    void SetOriginalWidth(double w);
+    void SetOriginalHeight(double h);
+
     void UpdateOriginalPoints();
 
     void base_OnDraw(wxDC& dc);