]> git.saurik.com Git - wxWidgets.git/blob - wxPython/contrib/ogl/oglshapes.i
Fix for internal compiler error
[wxWidgets.git] / wxPython / contrib / ogl / oglshapes.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: oglshapes.i
3 // Purpose: SWIG definitions for the wxWindows Object Graphics Library
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 3-Sept-1999
8 // RCS-ID: $Id$
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13
14 %module oglshapes
15
16 %{
17 #include "wxPython.h"
18 #include "oglhelpers.h"
19 %}
20
21 //---------------------------------------------------------------------------
22
23 %include typemaps.i
24 %include my_typemaps.i
25
26 %extern wx.i
27 %import windows.i
28 %extern _defs.i
29 %extern misc.i
30 %extern gdi.i
31
32 %include _ogldefs.i
33
34 %import oglbasic.i
35
36
37 %pragma(python) code = "import wx"
38
39 //---------------------------------------------------------------------------
40 //---------------------------------------------------------------------------
41 //---------------------------------------------------------------------------
42
43 class wxPseudoMetaFile : public wxObject {
44 public:
45 wxPseudoMetaFile();
46 ~wxPseudoMetaFile();
47
48 void Draw(wxDC& dc, double xoffset, double yoffset);
49 #ifdef wxUSE_PROLOGIO
50 void WriteAttributes(wxExpr *clause, int whichAngle);
51 void ReadAttributes(wxExpr *clause, int whichAngle);
52 #endif
53 void Clear();
54 void Copy(wxPseudoMetaFile& copy);
55 void Scale(double sx, double sy);
56 void ScaleTo(double w, double h);
57 void Translate(double x, double y);
58 void Rotate(double x, double y, double theta);
59 bool LoadFromMetaFile(const wxString& filename, double *width, double *height);
60 void GetBounds(double *minX, double *minY, double *maxX, double *maxY);
61 void CalculateSize(wxPyDrawnShape* shape);
62
63 // **** fix these... is it even possible? these are lists of various GDI opperations (not the objects...)
64 // wxList& GetOutlineColours();
65 // wxList& GetFillColours();
66 // wxList& GetOps();
67
68 void SetRotateable(bool rot);
69 bool GetRotateable();
70 void SetSize(double w, double h);
71 void SetFillBrush(wxBrush* brush);
72 wxBrush* GetFillBrush();
73 void SetOutlinePen(wxPen* pen);
74 wxPen* GetOutlinePen();
75 void SetOutlineOp(int op);
76 int GetOutlineOp();
77
78
79 bool IsValid();
80 void DrawLine(const wxPoint& pt1, const wxPoint& pt2);
81 void DrawRectangle(const wxRect& rect);
82 void DrawRoundedRectangle(const wxRect& rect, double radius);
83 void DrawArc(const wxPoint& centrePt, const wxPoint& startPt, const wxPoint& endPt);
84 void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle);
85 void DrawEllipse(const wxRect& rect);
86 void DrawPoint(const wxPoint& pt);
87 void DrawText(const wxString& text, const wxPoint& pt);
88 void DrawLines(int PCOUNT, wxPoint* points);
89 void DrawPolygon(int PCOUNT, wxPoint* points, int flags = 0);
90 void DrawSpline(int PCOUNT, wxPoint* points);
91 void SetClippingRect(const wxRect& rect);
92 void DestroyClippingRect();
93 void SetPen(wxPen* pen, bool isOutline = FALSE);
94 void SetBrush(wxBrush* brush, bool isFill = FALSE);
95 void SetFont(wxFont* font);
96 void SetTextColour(const wxColour& colour);
97 void SetBackgroundColour(const wxColour& colour);
98 void SetBackgroundMode(int mode);
99 };
100
101
102 //---------------------------------------------------------------------------
103
104 %{
105 // Using this macro can sometimes provoke an Internal Compiler Error in MSVC
106 // 6, so instead I'l just expand it out by hand...
107 // WXSHAPE_IMP_CALLBACKS(wxPyRectangleShape, wxRectangleShape);
108
109 IMP_PYCALLBACK__ (wxPyRectangleShape, wxRectangleShape, OnDelete);
110 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnDraw);
111 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnDrawContents);
112 IMP_PYCALLBACK__DCBOOL (wxPyRectangleShape, wxRectangleShape, OnDrawBranches);
113 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnMoveLinks);
114 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnErase);
115 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnEraseContents);
116 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnHighlight);
117 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnLeftClick);
118 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnLeftDoubleClick);
119 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnRightClick);
120 IMP_PYCALLBACK__2DBL (wxPyRectangleShape, wxRectangleShape, OnSize);
121 IMP_PYCALLBACK_BOOL_DC4DBLBOOL (wxPyRectangleShape, wxRectangleShape, OnMovePre);
122 IMP_PYCALLBACK__DC4DBLBOOL (wxPyRectangleShape, wxRectangleShape, OnMovePost);
123 IMP_PYCALLBACK__BOOL2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnDragLeft);
124 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnBeginDragLeft);
125 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnEndDragLeft);
126 IMP_PYCALLBACK__BOOL2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnDragRight);
127 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnBeginDragRight);
128 IMP_PYCALLBACK__2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnEndDragRight);
129 IMP_PYCALLBACK__DC4DBL (wxPyRectangleShape, wxRectangleShape, OnDrawOutline);
130 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnDrawControlPoints);
131 IMP_PYCALLBACK__DC (wxPyRectangleShape, wxRectangleShape, OnEraseControlPoints);
132 IMP_PYCALLBACK__DCBOOL (wxPyRectangleShape, wxRectangleShape, OnMoveLink);
133 IMP_PYCALLBACK__WXCPBOOL2DBL2INT(wxPyRectangleShape, wxRectangleShape, OnSizingDragLeft);
134 IMP_PYCALLBACK__WXCP2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnSizingBeginDragLeft);
135 IMP_PYCALLBACK__WXCP2DBL2INT (wxPyRectangleShape, wxRectangleShape, OnSizingEndDragLeft);
136 IMP_PYCALLBACK__2DBL (wxPyRectangleShape, wxRectangleShape, OnBeginSize);
137 IMP_PYCALLBACK__2DBL (wxPyRectangleShape, wxRectangleShape, OnEndSize)
138
139 %}
140
141 class wxPyRectangleShape : public wxPyShape {
142 public:
143 wxPyRectangleShape(double width = 0.0, double height = 0.0);
144
145 void _setCallbackInfo(PyObject* self, PyObject* _class);
146 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyRectangleShape)"
147 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
148
149 void SetCornerRadius(double radius);
150
151 void base_OnDelete();
152 void base_OnDraw(wxDC& dc);
153 void base_OnDrawContents(wxDC& dc);
154 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
155 void base_OnMoveLinks(wxDC& dc);
156 void base_OnErase(wxDC& dc);
157 void base_OnEraseContents(wxDC& dc);
158 void base_OnHighlight(wxDC& dc);
159 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
160 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
161 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
162 void base_OnSize(double x, double y);
163 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
164 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
165 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
166 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
167 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
168 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
169 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
170 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
171 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
172 void base_OnDrawControlPoints(wxDC& dc);
173 void base_OnEraseControlPoints(wxDC& dc);
174 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
175 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
176 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
177 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
178 void base_OnBeginSize(double w, double h);
179 void base_OnEndSize(double w, double h);
180 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
181 };
182
183 //---------------------------------------------------------------------------
184
185 %{
186 WXSHAPE_IMP_CALLBACKS(wxPyControlPoint, wxControlPoint);
187 %}
188
189 class wxPyControlPoint : public wxPyRectangleShape {
190 public:
191 wxPyControlPoint(wxPyShapeCanvas *the_canvas = NULL,
192 wxPyShape *object = NULL,
193 double size = 0.0, double the_xoffset = 0.0,
194 double the_yoffset = 0.0, int the_type = 0);
195
196 void _setCallbackInfo(PyObject* self, PyObject* _class);
197 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyControlPoint)"
198 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
199
200 void SetCornerRadius(double radius);
201
202 void base_OnDelete();
203 void base_OnDraw(wxDC& dc);
204 void base_OnDrawContents(wxDC& dc);
205 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
206 void base_OnMoveLinks(wxDC& dc);
207 void base_OnErase(wxDC& dc);
208 void base_OnEraseContents(wxDC& dc);
209 void base_OnHighlight(wxDC& dc);
210 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
211 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
212 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
213 void base_OnSize(double x, double y);
214 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
215 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
216 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
217 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
218 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
219 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
220 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
221 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
222 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
223 void base_OnDrawControlPoints(wxDC& dc);
224 void base_OnEraseControlPoints(wxDC& dc);
225 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
226 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
227 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
228 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
229 void base_OnBeginSize(double w, double h);
230 void base_OnEndSize(double w, double h);
231 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
232 };
233
234 //---------------------------------------------------------------------------
235 %{
236 WXSHAPE_IMP_CALLBACKS(wxPyBitmapShape, wxBitmapShape);
237 %}
238
239
240 class wxPyBitmapShape : public wxPyRectangleShape {
241 public:
242 wxPyBitmapShape();
243
244 void _setCallbackInfo(PyObject* self, PyObject* _class);
245 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyBitmapShape)"
246 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
247
248 wxBitmap& GetBitmap();
249 wxString GetFilename();
250 void SetBitmap(const wxBitmap& bitmap);
251 void SetFilename(const wxString& filename);
252
253 void base_OnDelete();
254 void base_OnDraw(wxDC& dc);
255 void base_OnDrawContents(wxDC& dc);
256 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
257 void base_OnMoveLinks(wxDC& dc);
258 void base_OnErase(wxDC& dc);
259 void base_OnEraseContents(wxDC& dc);
260 void base_OnHighlight(wxDC& dc);
261 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
262 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
263 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
264 void base_OnSize(double x, double y);
265 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
266 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
267 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
268 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
269 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
270 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
271 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
272 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
273 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
274 void base_OnDrawControlPoints(wxDC& dc);
275 void base_OnEraseControlPoints(wxDC& dc);
276 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
277 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
278 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
279 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
280 void base_OnBeginSize(double w, double h);
281 void base_OnEndSize(double w, double h);
282 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
283 };
284
285 //---------------------------------------------------------------------------
286 %{
287 WXSHAPE_IMP_CALLBACKS(wxPyDrawnShape, wxDrawnShape);
288 %}
289
290 class wxPyDrawnShape : public wxPyRectangleShape {
291 public:
292 wxPyDrawnShape();
293
294 void _setCallbackInfo(PyObject* self, PyObject* _class);
295 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyDrawnShape)"
296 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
297
298 void CalculateSize();
299 void DestroyClippingRect();
300 void DrawArc(const wxPoint& centrePoint, const wxPoint& startPoint,
301 const wxPoint& endPoint);
302 void DrawAtAngle(int angle);
303 void DrawEllipticArc(const wxRect& rect, double startAngle, double endAngle);
304 void DrawLine(const wxPoint& point1, const wxPoint& point2);
305 void DrawLines(int PCOUNT, wxPoint* points);
306 void DrawPoint(const wxPoint& point);
307 void DrawPolygon(int PCOUNT, wxPoint* points, int flags = 0);
308 void DrawRectangle(const wxRect& rect);
309 void DrawRoundedRectangle(const wxRect& rect, double radius);
310 void DrawSpline(int PCOUNT, wxPoint* points);
311 void DrawText(const wxString& text, const wxPoint& point);
312 int GetAngle();
313
314 wxPseudoMetaFile& GetMetaFile();
315
316 double GetRotation();
317 bool LoadFromMetaFile(const wxString& filename);
318 void Rotate(double x, double y, double theta);
319 void SetClippingRect(const wxRect& rect);
320 void SetDrawnBackgroundColour(const wxColour& colour);
321 void SetDrawnBackgroundMode(int mode);
322 void SetDrawnBrush(wxBrush* pen, bool isOutline = FALSE);
323 void SetDrawnFont(wxFont* font);
324 void SetDrawnPen(wxPen* pen, bool isOutline = FALSE);
325 void SetDrawnTextColour(const wxColour& colour);
326 void Scale(double sx, double sy);
327 void SetSaveToFile(bool save);
328 void Translate(double x, double y);
329
330
331 void base_OnDelete();
332 void base_OnDraw(wxDC& dc);
333 void base_OnDrawContents(wxDC& dc);
334 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
335 void base_OnMoveLinks(wxDC& dc);
336 void base_OnErase(wxDC& dc);
337 void base_OnEraseContents(wxDC& dc);
338 void base_OnHighlight(wxDC& dc);
339 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
340 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
341 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
342 void base_OnSize(double x, double y);
343 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
344 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
345 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
346 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
347 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
348 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
349 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
350 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
351 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
352 void base_OnDrawControlPoints(wxDC& dc);
353 void base_OnEraseControlPoints(wxDC& dc);
354 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
355 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
356 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
357 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
358 void base_OnBeginSize(double w, double h);
359 void base_OnEndSize(double w, double h);
360 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
361
362 };
363
364
365 //---------------------------------------------------------------------------
366
367 class wxOGLConstraint : public wxObject {
368 public:
369 //wxOGLConstraint(int type, wxPyShape *constraining, wxList& constrained);
370 %addmethods {
371 wxOGLConstraint(int type, wxPyShape *constraining, PyObject* constrained) {
372 wxList* list = wxPy_wxListHelper(constrained, "_wxPyShape_p");
373 wxOGLConstraint* rv = new wxOGLConstraint(type, constraining, *list);
374 delete list;
375 return rv;
376 }
377 }
378
379 //~wxOGLConstraint(); The wxCompositShape takes ownership of the constraint
380
381 bool Evaluate();
382 void SetSpacing(double x, double y);
383 bool Equals(double a, double b);
384
385 };
386
387
388
389 //---------------------------------------------------------------------------
390
391 %{
392 WXSHAPE_IMP_CALLBACKS(wxPyCompositeShape, wxCompositeShape);
393 %}
394
395 class wxPyCompositeShape : public wxPyRectangleShape {
396 public:
397 wxPyCompositeShape();
398
399 void _setCallbackInfo(PyObject* self, PyObject* _class);
400 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyCompositeShape)"
401 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
402
403 void AddChild(wxPyShape *child, wxPyShape *addAfter = NULL);
404
405 wxOGLConstraint * AddConstraint(wxOGLConstraint *constraint);
406
407
408 //wxOGLConstraint * AddConstraint(int type,
409 // wxPyShape *constraining,
410 // wxList& constrained);
411 %addmethods {
412 wxOGLConstraint * AddConstrainedShapes(int type, wxPyShape *constraining,
413 PyObject* constrained) {
414 wxList* list = wxPy_wxListHelper(constrained, "_wxPyShape_p");
415 wxOGLConstraint* rv = self->AddConstraint(type, constraining, *list);
416 delete list;
417 return rv;
418 }
419 }
420
421 %name(AddSimpleConstraint)wxOGLConstraint* AddConstraint(int type,
422 wxPyShape *constraining,
423 wxPyShape *constrained);
424
425 void CalculateSize();
426 bool ContainsDivision(wxPyDivisionShape *division);
427 void DeleteConstraint(wxOGLConstraint *constraint);
428 void DeleteConstraintsInvolvingChild(wxPyShape *child);
429
430 // **** Needs an output typemap
431 //wxOGLConstraint * FindConstraint(long id, wxPyCompositeShape **actualComposite);
432
433 wxPyShape * FindContainerImage();
434
435 // wxList& GetConstraints();
436 // wxList& GetDivisions();
437 %addmethods {
438 PyObject* GetConstraints() {
439 wxList& list = self->GetConstraints();
440 return wxPy_ConvertList(&list, "wxOGLConstraint");
441 }
442
443 PyObject* GetDivisions() {
444 wxList& list = self->GetDivisions();
445 return wxPy_ConvertShapeList(&list, "wxPyDivisionShape");
446 }
447 }
448
449 void MakeContainer();
450 bool Recompute();
451 void RemoveChild(wxPyShape *child);
452
453
454 void base_OnDelete();
455 void base_OnDraw(wxDC& dc);
456 void base_OnDrawContents(wxDC& dc);
457 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
458 void base_OnMoveLinks(wxDC& dc);
459 void base_OnErase(wxDC& dc);
460 void base_OnEraseContents(wxDC& dc);
461 void base_OnHighlight(wxDC& dc);
462 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
463 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
464 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
465 void base_OnSize(double x, double y);
466 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
467 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
468 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
469 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
470 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
471 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
472 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
473 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
474 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
475 void base_OnDrawControlPoints(wxDC& dc);
476 void base_OnEraseControlPoints(wxDC& dc);
477 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
478 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
479 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
480 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
481 void base_OnBeginSize(double w, double h);
482 void base_OnEndSize(double w, double h);
483 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
484
485 };
486
487
488 //---------------------------------------------------------------------------
489
490 %{
491 WXSHAPE_IMP_CALLBACKS(wxPyDividedShape, wxDividedShape);
492 %}
493
494 class wxPyDividedShape : public wxPyRectangleShape {
495 public:
496 wxPyDividedShape(double width = 0.0, double height = 0.0);
497
498 void _setCallbackInfo(PyObject* self, PyObject* _class);
499 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyDividedShape)"
500 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
501
502 void EditRegions();
503 void SetRegionSizes();
504
505 void base_OnDelete();
506 void base_OnDraw(wxDC& dc);
507 void base_OnDrawContents(wxDC& dc);
508 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
509 void base_OnMoveLinks(wxDC& dc);
510 void base_OnErase(wxDC& dc);
511 void base_OnEraseContents(wxDC& dc);
512 void base_OnHighlight(wxDC& dc);
513 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
514 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
515 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
516 void base_OnSize(double x, double y);
517 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
518 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
519 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
520 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
521 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
522 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
523 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
524 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
525 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
526 void base_OnDrawControlPoints(wxDC& dc);
527 void base_OnEraseControlPoints(wxDC& dc);
528 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
529 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
530 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
531 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
532 void base_OnBeginSize(double w, double h);
533 void base_OnEndSize(double w, double h);
534 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
535
536 };
537
538
539 //---------------------------------------------------------------------------
540 %{
541 WXSHAPE_IMP_CALLBACKS(wxPyDivisionShape, wxDivisionShape);
542 %}
543
544 class wxPyDivisionShape : public wxPyCompositeShape {
545 public:
546 wxPyDivisionShape();
547
548 void _setCallbackInfo(PyObject* self, PyObject* _class);
549 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyDivisionShape)"
550 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
551
552 void AdjustBottom(double bottom, bool test);
553 void AdjustLeft(double left, bool test);
554 void AdjustRight(double right, bool test);
555 void AdjustTop(double top, bool test);
556 void Divide(int direction);
557 void EditEdge(int side);
558 wxPyDivisionShape * GetBottomSide();
559 int GetHandleSide();
560 wxPyDivisionShape * GetLeftSide();
561 wxString GetLeftSideColour();
562 wxPen * GetLeftSidePen();
563 wxPyDivisionShape * GetRightSide();
564 wxPyDivisionShape * GetTopSide();
565 wxPen * GetTopSidePen();
566 void ResizeAdjoining(int side, double newPos, bool test);
567 void PopupMenu(double x, double y);
568 void SetBottomSide(wxPyDivisionShape *shape);
569 void SetHandleSide(int side);
570 void SetLeftSide(wxPyDivisionShape *shape);
571 void SetLeftSideColour(const wxString& colour);
572 void SetLeftSidePen(wxPen *pen);
573 void SetRightSide(wxPyDivisionShape *shape);
574 void SetTopSide(wxPyDivisionShape *shape);
575 void SetTopSideColour(const wxString& colour);
576 void SetTopSidePen(wxPen *pen);
577
578
579
580 void base_OnDelete();
581 void base_OnDraw(wxDC& dc);
582 void base_OnDrawContents(wxDC& dc);
583 void base_OnDrawBranches(wxDC& dc, bool erase = FALSE);
584 void base_OnMoveLinks(wxDC& dc);
585 void base_OnErase(wxDC& dc);
586 void base_OnEraseContents(wxDC& dc);
587 void base_OnHighlight(wxDC& dc);
588 void base_OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
589 void base_OnLeftDoubleClick(double x, double y, int keys = 0, int attachment = 0);
590 void base_OnRightClick(double x, double y, int keys = 0, int attachment = 0);
591 void base_OnSize(double x, double y);
592 bool base_OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
593 void base_OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display = TRUE);
594 void base_OnDragLeft(bool draw, double x, double y, int keys=0, int attachment = 0);
595 void base_OnBeginDragLeft(double x, double y, int keys=0, int attachment = 0);
596 void base_OnEndDragLeft(double x, double y, int keys=0, int attachment = 0);
597 void base_OnDragRight(bool draw, double x, double y, int keys=0, int attachment = 0);
598 void base_OnBeginDragRight(double x, double y, int keys=0, int attachment = 0);
599 void base_OnEndDragRight(double x, double y, int keys=0, int attachment = 0);
600 void base_OnDrawOutline(wxDC& dc, double x, double y, double w, double h);
601 void base_OnDrawControlPoints(wxDC& dc);
602 void base_OnEraseControlPoints(wxDC& dc);
603 void base_OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
604 void base_OnSizingDragLeft(wxPyControlPoint* pt, bool draw, double x, double y, int keys=0, int attachment = 0);
605 void base_OnSizingBeginDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
606 void base_OnSizingEndDragLeft(wxPyControlPoint* pt, double x, double y, int keys=0, int attachment = 0);
607 void base_OnBeginSize(double w, double h);
608 void base_OnEndSize(double w, double h);
609 // void base_OnChangeAttachment(int attachment, wxPyLineShape* line, wxList& ordering);
610
611 };
612
613
614
615 //---------------------------------------------------------------------------
616