]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/_gdicmn.i
Updated to SWIG 1.3.24 (plus a patch that corrects a bug and adds back
[wxWidgets.git] / wxPython / src / _gdicmn.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: _gdicmn.i
3 // Purpose: SWIG interface for common GDI stuff and misc classes
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 13-Sept-2003
8 // RCS-ID: $Id$
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 // Not a %module
14
15
16 //---------------------------------------------------------------------------
17 %newgroup
18
19
20 enum wxBitmapType
21 {
22 wxBITMAP_TYPE_INVALID, // should be == 0 for compatibility!
23 wxBITMAP_TYPE_BMP,
24 wxBITMAP_TYPE_ICO,
25 wxBITMAP_TYPE_CUR,
26 wxBITMAP_TYPE_XBM,
27 wxBITMAP_TYPE_XBM_DATA,
28 wxBITMAP_TYPE_XPM,
29 wxBITMAP_TYPE_XPM_DATA,
30 wxBITMAP_TYPE_TIF,
31 wxBITMAP_TYPE_GIF,
32 wxBITMAP_TYPE_PNG,
33 wxBITMAP_TYPE_JPEG,
34 wxBITMAP_TYPE_PNM,
35 wxBITMAP_TYPE_PCX,
36 wxBITMAP_TYPE_PICT,
37 wxBITMAP_TYPE_ICON,
38 wxBITMAP_TYPE_ANI,
39 wxBITMAP_TYPE_IFF,
40 wxBITMAP_TYPE_MACCURSOR,
41
42 // wxBITMAP_TYPE_BMP_RESOURCE,
43 // wxBITMAP_TYPE_RESOURCE = wxBITMAP_TYPE_BMP_RESOURCE,
44 // wxBITMAP_TYPE_ICO_RESOURCE,
45 // wxBITMAP_TYPE_CUR_RESOURCE,
46 // wxBITMAP_TYPE_TIF_RESOURCE,
47 // wxBITMAP_TYPE_GIF_RESOURCE,
48 // wxBITMAP_TYPE_PNG_RESOURCE,
49 // wxBITMAP_TYPE_JPEG_RESOURCE,
50 // wxBITMAP_TYPE_PNM_RESOURCE,
51 // wxBITMAP_TYPE_PCX_RESOURCE,
52 // wxBITMAP_TYPE_PICT_RESOURCE,
53 // wxBITMAP_TYPE_ICON_RESOURCE,
54 // wxBITMAP_TYPE_MACCURSOR_RESOURCE,
55
56 wxBITMAP_TYPE_ANY = 50
57 };
58
59 // Standard cursors
60 enum wxStockCursor
61 {
62 wxCURSOR_NONE, // should be 0
63 wxCURSOR_ARROW,
64 wxCURSOR_RIGHT_ARROW,
65 wxCURSOR_BULLSEYE,
66 wxCURSOR_CHAR,
67 wxCURSOR_CROSS,
68 wxCURSOR_HAND,
69 wxCURSOR_IBEAM,
70 wxCURSOR_LEFT_BUTTON,
71 wxCURSOR_MAGNIFIER,
72 wxCURSOR_MIDDLE_BUTTON,
73 wxCURSOR_NO_ENTRY,
74 wxCURSOR_PAINT_BRUSH,
75 wxCURSOR_PENCIL,
76 wxCURSOR_POINT_LEFT,
77 wxCURSOR_POINT_RIGHT,
78 wxCURSOR_QUESTION_ARROW,
79 wxCURSOR_RIGHT_BUTTON,
80 wxCURSOR_SIZENESW,
81 wxCURSOR_SIZENS,
82 wxCURSOR_SIZENWSE,
83 wxCURSOR_SIZEWE,
84 wxCURSOR_SIZING,
85 wxCURSOR_SPRAYCAN,
86 wxCURSOR_WAIT,
87 wxCURSOR_WATCH,
88 wxCURSOR_BLANK,
89 wxCURSOR_DEFAULT, // standard X11 cursor
90 wxCURSOR_COPY_ARROW , // MacOS Theme Plus arrow
91
92 // #ifdef __X__
93 // // Not yet implemented for Windows
94 // wxCURSOR_CROSS_REVERSE,
95 // wxCURSOR_DOUBLE_ARROW,
96 // wxCURSOR_BASED_ARROW_UP,
97 // wxCURSOR_BASED_ARROW_DOWN,
98 // #endif // X11
99
100 wxCURSOR_ARROWWAIT,
101
102 wxCURSOR_MAX
103 };
104
105 %{
106 #ifndef __WXMAC__
107 #define wxCURSOR_COPY_ARROW wxCURSOR_ARROW
108 #endif
109 %}
110
111 //---------------------------------------------------------------------------
112 %newgroup
113
114 DocStr( wxSize,
115 "wx.Size is a useful data structure used to represent the size of
116 something. It simply contians integer width and height
117 proprtites. In most places in wxPython where a wx.Size is
118 expected a (width, height) tuple can be used instead.", "");
119
120 class wxSize
121 {
122 public:
123 %Rename(width, int, x);
124 %Rename(height,int, y);
125 %pythoncode { x = width; y = height }
126
127 DocCtorStr(
128 wxSize(int w=0, int h=0),
129 "Creates a size object.", "");
130
131 ~wxSize();
132
133 // None/NULL is now handled properly by the typemap, so these are not needed.
134 // %extend {
135 // bool __eq__(const wxSize* other) { return other ? (*self == *other) : false; }
136 // bool __ne__(const wxSize* other) { return other ? (*self != *other) : true; }
137 // }
138
139 DocDeclStr(
140 bool, operator==(const wxSize& sz),
141 "Test for equality of wx.Size objects.", "");
142
143 DocDeclStr(
144 bool, operator!=(const wxSize& sz),
145 "Test for inequality.", "");
146
147 DocDeclStr(
148 wxSize, operator+(const wxSize& sz),
149 "Add sz's proprties to this and return the result.", "");
150
151 DocDeclStr(
152 wxSize, operator-(const wxSize& sz),
153 "Subtract sz's properties from this and return the result.", "");
154
155 DocDeclStr(
156 void, IncTo(const wxSize& sz),
157 "Increments this object so that both of its dimensions are not less
158 than the corresponding dimensions of the size.", "");
159
160 DocDeclStr(
161 void, DecTo(const wxSize& sz),
162 "Decrements this object so that both of its dimensions are not greater
163 than the corresponding dimensions of the size.", "");
164
165 DocDeclStr(
166 void, Set(int w, int h),
167 "Set both width and height.", "");
168
169 void SetWidth(int w);
170 void SetHeight(int h);
171 int GetWidth() const;
172 int GetHeight() const;
173
174
175 DocDeclStr(
176 bool , IsFullySpecified() const,
177 "Returns True if both components of the size are non-default values.", "");
178
179
180 DocDeclStr(
181 void , SetDefaults(const wxSize& size),
182 "Combine this size with the other one replacing the default components
183 of this object (i.e. equal to -1) with those of the other.", "");
184
185
186 //int GetX() const;
187 //int GetY() const;
188
189 %extend {
190 DocAStr(Get,
191 "Get() -> (width,height)",
192 "Returns the width and height properties as a tuple.", "");
193 PyObject* Get() {
194 bool blocked = wxPyBeginBlockThreads();
195 PyObject* tup = PyTuple_New(2);
196 PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
197 PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
198 wxPyEndBlockThreads(blocked);
199 return tup;
200 }
201 }
202 %pythoncode {
203 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
204 def __str__(self): return str(self.Get())
205 def __repr__(self): return 'wx.Size'+str(self.Get())
206 def __len__(self): return len(self.Get())
207 def __getitem__(self, index): return self.Get()[index]
208 def __setitem__(self, index, val):
209 if index == 0: self.width = val
210 elif index == 1: self.height = val
211 else: raise IndexError
212 def __nonzero__(self): return self.Get() != (0,0)
213 __safe_for_unpickling__ = True
214 def __reduce__(self): return (wx.Size, self.Get())
215 }
216
217 };
218
219 //---------------------------------------------------------------------------
220 %newgroup
221
222 DocStr( wxRealPoint,
223 "A data structure for representing a point or position with floating
224 point x and y properties. In wxPython most places that expect a
225 wx.RealPoint can also accept a (x,y) tuple.", "");
226 class wxRealPoint
227 {
228 public:
229 double x;
230 double y;
231
232 DocCtorStr(
233 wxRealPoint(double x=0.0, double y=0.0),
234 "Create a wx.RealPoint object", "");
235
236 ~wxRealPoint();
237
238 DocDeclStr(
239 bool, operator==(const wxRealPoint& pt),
240 "Test for equality of wx.RealPoint objects.", "");
241
242 DocDeclStr(
243 bool, operator!=(const wxRealPoint& pt),
244 "Test for inequality of wx.RealPoint objects.", "");
245
246
247 DocDeclStr(
248 wxRealPoint, operator+(const wxRealPoint& pt),
249 "Add pt's proprties to this and return the result.", "");
250
251 DocDeclStr(
252 wxRealPoint, operator-(const wxRealPoint& pt),
253 "Subtract pt's proprties from this and return the result", "");
254
255
256 %extend {
257 DocStr(Set, "Set both the x and y properties", "");
258 void Set(double x, double y) {
259 self->x = x;
260 self->y = y;
261 }
262
263 DocAStr(Get,
264 "Get() -> (x,y)",
265 "Return the x and y properties as a tuple. ", "");
266 PyObject* Get() {
267 bool blocked = wxPyBeginBlockThreads();
268 PyObject* tup = PyTuple_New(2);
269 PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x));
270 PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y));
271 wxPyEndBlockThreads(blocked);
272 return tup;
273 }
274 }
275
276 %pythoncode {
277 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
278 def __str__(self): return str(self.Get())
279 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
280 def __len__(self): return len(self.Get())
281 def __getitem__(self, index): return self.Get()[index]
282 def __setitem__(self, index, val):
283 if index == 0: self.x = val
284 elif index == 1: self.y = val
285 else: raise IndexError
286 def __nonzero__(self): return self.Get() != (0.0, 0.0)
287 __safe_for_unpickling__ = True
288 def __reduce__(self): return (wx.RealPoint, self.Get())
289 }
290 };
291
292
293 //---------------------------------------------------------------------------
294 %newgroup
295
296
297 DocStr(wxPoint,
298 "A data structure for representing a point or position with integer x
299 and y properties. Most places in wxPython that expect a wx.Point can
300 also accept a (x,y) tuple.", "");
301
302 class wxPoint
303 {
304 public:
305 int x, y;
306
307 DocCtorStr(
308 wxPoint(int x=0, int y=0),
309 "Create a wx.Point object", "");
310
311 ~wxPoint();
312
313
314 DocDeclStr(
315 bool, operator==(const wxPoint& pt),
316 "Test for equality of wx.Point objects.", "");
317
318 DocDeclStr(
319 bool, operator!=(const wxPoint& pt),
320 "Test for inequality of wx.Point objects.", "");
321
322
323
324 // %nokwargs operator+;
325 // %nokwargs operator-;
326 // %nokwargs operator+=;
327 // %nokwargs operator-=;
328
329 DocDeclStr(
330 wxPoint, operator+(const wxPoint& pt),
331 "Add pt's proprties to this and return the result.", "");
332
333
334 DocDeclStr(
335 wxPoint, operator-(const wxPoint& pt),
336 "Subtract pt's proprties from this and return the result", "");
337
338
339 DocDeclStr(
340 wxPoint&, operator+=(const wxPoint& pt),
341 "Add pt to this object.", "");
342
343 DocDeclStr(
344 wxPoint&, operator-=(const wxPoint& pt),
345 "Subtract pt from this object.", "");
346
347
348
349 // DocDeclStr(
350 // wxPoint, operator+(const wxSize& sz),
351 // "Add sz to this Point and return the result.", "");
352
353 // DocDeclStr(
354 // wxPoint, operator-(const wxSize& sz),
355 // "Subtract sz from this Point and return the result", "");
356
357
358 // DocDeclStr(
359 // wxPoint&, operator+=(const wxSize& sz),
360 // "Add sz to this object.", "");
361
362 // DocDeclStr(
363 // wxPoint&, operator-=(const wxSize& sz),
364 // "Subtract sz from this object.", "");
365
366
367
368
369 %extend {
370 DocStr(Set, "Set both the x and y properties", "");
371 void Set(long x, long y) {
372 self->x = x;
373 self->y = y;
374 }
375
376 DocAStr(Get,
377 "Get() -> (x,y)",
378 "Return the x and y properties as a tuple. ", "");
379 PyObject* Get() {
380 bool blocked = wxPyBeginBlockThreads();
381 PyObject* tup = PyTuple_New(2);
382 PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
383 PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
384 wxPyEndBlockThreads(blocked);
385 return tup;
386 }
387 }
388
389 %pythoncode {
390 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
391 def __str__(self): return str(self.Get())
392 def __repr__(self): return 'wx.Point'+str(self.Get())
393 def __len__(self): return len(self.Get())
394 def __getitem__(self, index): return self.Get()[index]
395 def __setitem__(self, index, val):
396 if index == 0: self.x = val
397 elif index == 1: self.y = val
398 else: raise IndexError
399 def __nonzero__(self): return self.Get() != (0,0)
400 __safe_for_unpickling__ = True
401 def __reduce__(self): return (wx.Point, self.Get())
402 }
403 };
404
405 //---------------------------------------------------------------------------
406 %newgroup
407
408
409 DocStr(wxRect,
410 "A class for representing and manipulating rectangles. It has x, y,
411 width and height properties. In wxPython most palces that expect a
412 wx.Rect can also accept a (x,y,width,height) tuple.", "");
413
414 class wxRect
415 {
416 public:
417 DocCtorStr(
418 wxRect(int x=0, int y=0, int width=0, int height=0),
419 "Create a new Rect object.", "");
420
421 DocCtorStrName(
422 wxRect(const wxPoint& topLeft, const wxPoint& bottomRight),
423 "Create a new Rect object from Points representing two corners.", "",
424 RectPP);
425
426 DocCtorStrName(
427 wxRect(const wxPoint& pos, const wxSize& size),
428 "Create a new Rect from a position and size.", "",
429 RectPS);
430
431 DocCtorStrName(
432 wxRect(const wxSize& size),
433 "Create a new Rect from a size only.", "",
434 RectS);
435
436 ~wxRect();
437
438 int GetX() const;
439 void SetX(int x);
440
441 int GetY();
442 void SetY(int y);
443
444 int GetWidth() const;
445 void SetWidth(int w);
446
447 int GetHeight() const;
448 void SetHeight(int h);
449
450 wxPoint GetPosition() const;
451 void SetPosition( const wxPoint &p );
452
453 wxSize GetSize() const;
454 void SetSize( const wxSize &s );
455
456 wxPoint GetTopLeft() const;
457 void SetTopLeft(const wxPoint &p);
458 wxPoint GetBottomRight() const;
459 void SetBottomRight(const wxPoint &p);
460
461 // wxPoint GetLeftTop() const;
462 // void SetLeftTop(const wxPoint &p);
463 // wxPoint GetRightBottom() const;
464 // void SetRightBottom(const wxPoint &p);
465
466 int GetLeft() const;
467 int GetTop() const;
468 int GetBottom() const;
469 int GetRight() const;
470
471 void SetLeft(int left);
472 void SetRight(int right);
473 void SetTop(int top);
474 void SetBottom(int bottom);
475
476 %pythoncode {
477 position = property(GetPosition, SetPosition)
478 size = property(GetSize, SetSize)
479 left = property(GetLeft, SetLeft)
480 right = property(GetRight, SetRight)
481 top = property(GetTop, SetTop)
482 bottom = property(GetBottom, SetBottom)
483 }
484
485 DocDeclStr(
486 wxRect&, Inflate(wxCoord dx, wxCoord dy),
487 "Increase the rectangle size by dx in x direction and dy in y
488 direction. Both (or one of) parameters may be negative to decrease the
489 rectangle size.", "");
490
491 DocDeclStr(
492 wxRect&, Deflate(wxCoord dx, wxCoord dy),
493 "Decrease the rectangle size by dx in x direction and dy in y
494 direction. Both (or one of) parameters may be negative to increase the
495 rectngle size. This method is the opposite of Inflate.", "");
496
497 DocDeclStrName(
498 void, Offset(wxCoord dx, wxCoord dy),
499 "Moves the rectangle by the specified offset. If dx is positive, the
500 rectangle is moved to the right, if dy is positive, it is moved to the
501 bottom, otherwise it is moved to the left or top respectively.", "",
502 OffsetXY);
503
504 DocDeclStr(
505 void, Offset(const wxPoint& pt),
506 "Same as OffsetXY but uses dx,dy from Point", "");
507
508 DocDeclStr(
509 wxRect, Intersect(const wxRect& rect),
510 "Returns the intersectsion of this rectangle and rect.", "");
511
512 DocDeclStr(
513 wxRect , Union(const wxRect& rect),
514 "Returns the union of this rectangle and rect.", "");
515
516
517 DocDeclStr(
518 wxRect, operator+(const wxRect& rect) const,
519 "Add the properties of rect to this rectangle and return the result.", "");
520
521 DocDeclStr(
522 wxRect&, operator+=(const wxRect& rect),
523 "Add the properties of rect to this rectangle, updating this rectangle.", "");
524
525 DocDeclStr(
526 bool, operator==(const wxRect& rect) const,
527 "Test for equality.", "");
528
529 DocDeclStr(
530 bool, operator!=(const wxRect& rect) const,
531 "Test for inequality.", "");
532
533
534 DocStr( Inside, "Return True if the point is (not strcitly) inside the rect.", "");
535 %Rename(InsideXY, bool, Inside(int x, int y) const);
536 bool Inside(const wxPoint& pt) const;
537
538 DocDeclStr(
539 bool, Intersects(const wxRect& rect) const,
540 "Returns True if the rectangles have a non empty intersection.", "");
541
542
543 int x, y, width, height;
544
545
546 %extend {
547 DocStr(Set, "Set all rectangle properties.", "");
548 void Set(int x=0, int y=0, int width=0, int height=0) {
549 self->x = x;
550 self->y = y;
551 self->width = width;
552 self->height = height;
553 }
554
555 DocAStr(Get,
556 "Get() -> (x,y,width,height)",
557 "Return the rectangle properties as a tuple.", "");
558 PyObject* Get() {
559 bool blocked = wxPyBeginBlockThreads();
560 PyObject* tup = PyTuple_New(4);
561 PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
562 PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
563 PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width));
564 PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height));
565 wxPyEndBlockThreads(blocked);
566 return tup;
567 }
568 }
569
570 %pythoncode {
571 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
572 def __str__(self): return str(self.Get())
573 def __repr__(self): return 'wx.Rect'+str(self.Get())
574 def __len__(self): return len(self.Get())
575 def __getitem__(self, index): return self.Get()[index]
576 def __setitem__(self, index, val):
577 if index == 0: self.x = val
578 elif index == 1: self.y = val
579 elif index == 2: self.width = val
580 elif index == 3: self.height = val
581 else: raise IndexError
582 def __nonzero__(self): return self.Get() != (0,0,0,0)
583 __safe_for_unpickling__ = True
584 def __reduce__(self): return (wx.Rect, self.Get())
585 }
586 };
587
588
589 MustHaveApp(wxIntersectRect);
590
591 DocAStr(wxIntersectRect,
592 "IntersectRect(Rect r1, Rect r2) -> Rect",
593 "Calculate and return the intersection of r1 and r2.", "");
594 %inline %{
595 PyObject* wxIntersectRect(wxRect* r1, wxRect* r2) {
596 wxRegion reg1(*r1);
597 wxRegion reg2(*r2);
598 wxRect dest(0,0,0,0);
599 PyObject* obj;
600
601 reg1.Intersect(reg2);
602 dest = reg1.GetBox();
603
604 if (dest != wxRect(0,0,0,0)) {
605 bool blocked = wxPyBeginBlockThreads();
606 wxRect* newRect = new wxRect(dest);
607 obj = wxPyConstructObject((void*)newRect, wxT("wxRect"), true);
608 wxPyEndBlockThreads(blocked);
609 return obj;
610 }
611 Py_INCREF(Py_None);
612 return Py_None;
613 }
614 %}
615
616 //---------------------------------------------------------------------------
617 %newgroup
618
619
620 DocStr(wxPoint2D,
621 "wx.Point2Ds represent a point or a vector in a 2d coordinate system
622 with floating point values.", "");
623
624 class wxPoint2D
625 {
626 public:
627 DocStr(wxPoint2D, "Create a w.Point2D object.", "");
628 wxPoint2D( double x=0.0 , double y=0.0 );
629 %RenameCtor(Point2DCopy, wxPoint2D( const wxPoint2D &pt ));
630 %RenameCtor(Point2DFromPoint, wxPoint2D( const wxPoint &pt ));
631
632 DocDeclAStr(
633 void, GetFloor( int *OUTPUT , int *OUTPUT ) const,
634 "GetFloor() -> (x,y)",
635 "Convert to integer", "");
636
637 DocDeclAStr(
638 void, GetRounded( int *OUTPUT , int *OUTPUT ) const,
639 "GetRounded() -> (x,y)",
640 "Convert to integer", "");
641
642 double GetVectorLength() const;
643 double GetVectorAngle() const ;
644 void SetVectorLength( double length );
645 void SetVectorAngle( double degrees );
646
647 // LinkError: void SetPolarCoordinates( double angle , double length );
648 // LinkError: void Normalize();
649 %pythoncode {
650 def SetPolarCoordinates(self, angle, length):
651 self.SetVectorLength(length)
652 self.SetVectorAngle(angle)
653 def Normalize(self):
654 self.SetVectorLength(1.0)
655 }
656
657 double GetDistance( const wxPoint2D &pt ) const;
658 double GetDistanceSquare( const wxPoint2D &pt ) const;
659 double GetDotProduct( const wxPoint2D &vec ) const;
660 double GetCrossProduct( const wxPoint2D &vec ) const;
661
662 DocDeclStr(
663 wxPoint2D, operator-(),
664 "the reflection of this point", "");
665
666 wxPoint2D& operator+=(const wxPoint2D& pt);
667 wxPoint2D& operator-=(const wxPoint2D& pt);
668
669 wxPoint2D& operator*=(const wxPoint2D& pt);
670 wxPoint2D& operator/=(const wxPoint2D& pt);
671
672 DocDeclStr(
673 bool, operator==(const wxPoint2D& pt) const,
674 "Test for equality", "");
675
676 DocDeclStr(
677 bool, operator!=(const wxPoint2D& pt) const,
678 "Test for inequality", "");
679
680 %Rename(x, double, m_x);
681 %Rename(y, double, m_y);
682
683 %extend {
684 void Set( double x=0 , double y=0 ) {
685 self->m_x = x;
686 self->m_y = y;
687 }
688
689 DocAStr(Get,
690 "Get() -> (x,y)",
691 "Return x and y properties as a tuple.", "");
692 PyObject* Get() {
693 bool blocked = wxPyBeginBlockThreads();
694 PyObject* tup = PyTuple_New(2);
695 PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->m_x));
696 PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->m_y));
697 wxPyEndBlockThreads(blocked);
698 return tup;
699 }
700 }
701
702 %pythoncode {
703 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
704 def __str__(self): return str(self.Get())
705 def __repr__(self): return 'wx.Point2D'+str(self.Get())
706 def __len__(self): return len(self.Get())
707 def __getitem__(self, index): return self.Get()[index]
708 def __setitem__(self, index, val):
709 if index == 0: self.x = val
710 elif index == 1: self.y = val
711 else: raise IndexError
712 def __nonzero__(self): return self.Get() != (0.0, 0.0)
713 __safe_for_unpickling__ = True
714 def __reduce__(self): return (wx.Point2D, self.Get())
715 }
716 };
717
718
719 //---------------------------------------------------------------------------
720
721 %immutable;
722 const wxPoint wxDefaultPosition;
723 const wxSize wxDefaultSize;
724 %mutable;
725
726 //---------------------------------------------------------------------------