1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface for common GDI stuff and misc classes
7 // Created: 13-Sept-2003
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
22 wxBITMAP_TYPE_INVALID, // should be == 0 for compatibility!
27 wxBITMAP_TYPE_XBM_DATA,
29 wxBITMAP_TYPE_XPM_DATA,
40 wxBITMAP_TYPE_MACCURSOR,
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,
56 wxBITMAP_TYPE_ANY = 50
62 wxCURSOR_NONE, // should be 0
72 wxCURSOR_MIDDLE_BUTTON,
78 wxCURSOR_QUESTION_ARROW,
79 wxCURSOR_RIGHT_BUTTON,
89 wxCURSOR_DEFAULT, // standard X11 cursor
90 wxCURSOR_COPY_ARROW , // MacOS Theme Plus arrow
93 // // Not yet implemented for Windows
94 // wxCURSOR_CROSS_REVERSE,
95 // wxCURSOR_DOUBLE_ARROW,
96 // wxCURSOR_BASED_ARROW_UP,
97 // wxCURSOR_BASED_ARROW_DOWN,
107 #define wxCURSOR_COPY_ARROW wxCURSOR_ARROW
111 //---------------------------------------------------------------------------
115 "wx.Size is a useful data structure used to represent the size of
116 something. It simply contains integer width and height
117 properties. In most places in wxPython where a wx.Size is
118 expected a (width, height) tuple can be used instead.", "");
123 %Rename(width, int, x);
124 %Rename(height,int, y);
125 %pythoncode { x = width; y = height }
128 wxSize(int w=0, int h=0),
129 "Creates a size object.", "");
136 DocStr(__eq__, "Test for equality of wx.Size objects.", "");
137 bool __eq__(PyObject* other) {
138 wxSize temp, *obj = &temp;
139 if ( other == Py_None ) return false;
140 if ( ! wxSize_helper(other, &obj) ) {
144 return self->operator==(*obj);
149 DocStr(__ne__, "Test for inequality of wx.Size objects.", "");
150 bool __ne__(PyObject* other) {
151 wxSize temp, *obj = &temp;
152 if ( other == Py_None ) return true;
153 if ( ! wxSize_helper(other, &obj)) {
157 return self->operator!=(*obj);
162 wxSize, operator+(const wxSize& sz),
163 "Add sz's proprties to this and return the result.", "");
166 wxSize, operator-(const wxSize& sz),
167 "Subtract sz's properties from this and return the result.", "");
170 void, IncTo(const wxSize& sz),
171 "Increments this object so that both of its dimensions are not less
172 than the corresponding dimensions of the size.", "");
175 void, DecTo(const wxSize& sz),
176 "Decrements this object so that both of its dimensions are not greater
177 than the corresponding dimensions of the size.", "");
181 void , IncBy(int dx, int dy),
186 void , DecBy(int dx, int dy),
189 // TODO: handle these overloads too?
190 // void IncBy(const wxSize& sz);
191 // void IncBy(int d);
192 // void DecBy(const wxSize& sz);
193 // void DecBy(int d);
196 void , Scale(float xscale, float yscale),
197 "Scales the dimensions of this object by the given factors.", "");
200 void, Set(int w, int h),
201 "Set both width and height.", "");
203 void SetWidth(int w);
204 void SetHeight(int h);
205 int GetWidth() const;
206 int GetHeight() const;
210 bool , IsFullySpecified() const,
211 "Returns True if both components of the size are non-default values.", "");
215 void , SetDefaults(const wxSize& size),
216 "Combine this size with the other one replacing the default components
217 of this object (i.e. equal to -1) with those of the other.", "");
225 "Get() -> (width,height)",
226 "Returns the width and height properties as a tuple.", "");
228 wxPyBlock_t blocked = wxPyBeginBlockThreads();
229 PyObject* tup = PyTuple_New(2);
230 PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
231 PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
232 wxPyEndBlockThreads(blocked);
237 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
238 def __str__(self): return str(self.Get())
239 def __repr__(self): return 'wx.Size'+str(self.Get())
240 def __len__(self): return len(self.Get())
241 def __getitem__(self, index): return self.Get()[index]
242 def __setitem__(self, index, val):
243 if index == 0: self.width = val
244 elif index == 1: self.height = val
245 else: raise IndexError
246 def __nonzero__(self): return self.Get() != (0,0)
247 __safe_for_unpickling__ = True
248 def __reduce__(self): return (wx.Size, self.Get())
253 //---------------------------------------------------------------------------
257 "A data structure for representing a point or position with floating
258 point x and y properties. In wxPython most places that expect a
259 wx.RealPoint can also accept a (x,y) tuple.", "");
267 wxRealPoint(double x=0.0, double y=0.0),
268 "Create a wx.RealPoint object", "");
274 DocStr(__eq__, "Test for equality of wx.RealPoint objects.", "");
275 bool __eq__(PyObject* other) {
276 wxRealPoint temp, *obj = &temp;
277 if ( other == Py_None ) return false;
278 if ( ! wxRealPoint_helper(other, &obj) ) {
282 return self->operator==(*obj);
287 DocStr(__ne__, "Test for inequality of wx.RealPoint objects.", "");
288 bool __ne__(PyObject* other) {
289 wxRealPoint temp, *obj = &temp;
290 if ( other == Py_None ) return true;
291 if ( ! wxRealPoint_helper(other, &obj)) {
295 return self->operator!=(*obj);
301 wxRealPoint, operator+(const wxRealPoint& pt),
302 "Add pt's proprties to this and return the result.", "");
305 wxRealPoint, operator-(const wxRealPoint& pt),
306 "Subtract pt's proprties from this and return the result", "");
310 DocStr(Set, "Set both the x and y properties", "");
311 void Set(double x, double y) {
318 "Return the x and y properties as a tuple. ", "");
320 wxPyBlock_t blocked = wxPyBeginBlockThreads();
321 PyObject* tup = PyTuple_New(2);
322 PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x));
323 PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y));
324 wxPyEndBlockThreads(blocked);
330 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
331 def __str__(self): return str(self.Get())
332 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
333 def __len__(self): return len(self.Get())
334 def __getitem__(self, index): return self.Get()[index]
335 def __setitem__(self, index, val):
336 if index == 0: self.x = val
337 elif index == 1: self.y = val
338 else: raise IndexError
339 def __nonzero__(self): return self.Get() != (0.0, 0.0)
340 __safe_for_unpickling__ = True
341 def __reduce__(self): return (wx.RealPoint, self.Get())
346 //---------------------------------------------------------------------------
351 "A data structure for representing a point or position with integer x
352 and y properties. Most places in wxPython that expect a wx.Point can
353 also accept a (x,y) tuple.", "");
361 wxPoint(int x=0, int y=0),
362 "Create a wx.Point object", "");
369 DocStr(__eq__, "Test for equality of wx.Point objects.", "");
370 bool __eq__(PyObject* other) {
371 wxPoint temp, *obj = &temp;
372 if ( other == Py_None ) return false;
373 if ( ! wxPoint_helper(other, &obj) ) {
377 return self->operator==(*obj);
382 DocStr(__ne__, "Test for inequality of wx.Point objects.", "");
383 bool __ne__(PyObject* other) {
384 wxPoint temp, *obj = &temp;
385 if ( other == Py_None ) return true;
386 if ( ! wxPoint_helper(other, &obj)) {
390 return self->operator!=(*obj);
395 // %nokwargs operator+;
396 // %nokwargs operator-;
397 // %nokwargs operator+=;
398 // %nokwargs operator-=;
401 wxPoint, operator+(const wxPoint& pt),
402 "Add pt's proprties to this and return the result.", "");
406 wxPoint, operator-(const wxPoint& pt),
407 "Subtract pt's proprties from this and return the result", "");
411 wxPoint&, operator+=(const wxPoint& pt),
412 "Add pt to this object.", "");
415 wxPoint&, operator-=(const wxPoint& pt),
416 "Subtract pt from this object.", "");
421 // wxPoint, operator+(const wxSize& sz),
422 // "Add sz to this Point and return the result.", "");
425 // wxPoint, operator-(const wxSize& sz),
426 // "Subtract sz from this Point and return the result", "");
430 // wxPoint&, operator+=(const wxSize& sz),
431 // "Add sz to this object.", "");
434 // wxPoint&, operator-=(const wxSize& sz),
435 // "Subtract sz from this object.", "");
441 DocStr(Set, "Set both the x and y properties", "");
442 void Set(long x, long y) {
449 "Return the x and y properties as a tuple. ", "");
451 wxPyBlock_t blocked = wxPyBeginBlockThreads();
452 PyObject* tup = PyTuple_New(2);
453 PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
454 PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
455 wxPyEndBlockThreads(blocked);
461 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
462 def __str__(self): return str(self.Get())
463 def __repr__(self): return 'wx.Point'+str(self.Get())
464 def __len__(self): return len(self.Get())
465 def __getitem__(self, index): return self.Get()[index]
466 def __setitem__(self, index, val):
467 if index == 0: self.x = val
468 elif index == 1: self.y = val
469 else: raise IndexError
470 def __nonzero__(self): return self.Get() != (0,0)
471 __safe_for_unpickling__ = True
472 def __reduce__(self): return (wx.Point, self.Get())
476 //---------------------------------------------------------------------------
481 "A class for representing and manipulating rectangles. It has x, y,
482 width and height properties. In wxPython most palces that expect a
483 wx.Rect can also accept a (x,y,width,height) tuple.", "");
489 wxRect(int x=0, int y=0, int width=0, int height=0),
490 "Create a new Rect object.", "");
493 wxRect(const wxPoint& topLeft, const wxPoint& bottomRight),
494 "Create a new Rect object from Points representing two corners.", "",
498 wxRect(const wxPoint& pos, const wxSize& size),
499 "Create a new Rect from a position and size.", "",
503 wxRect(const wxSize& size),
504 "Create a new Rect from a size only.", "",
515 int GetWidth() const;
516 void SetWidth(int w);
518 int GetHeight() const;
519 void SetHeight(int h);
521 wxPoint GetPosition() const;
522 void SetPosition( const wxPoint &p );
524 wxSize GetSize() const;
525 void SetSize( const wxSize &s );
527 bool IsEmpty() const;
529 wxPoint GetTopLeft() const;
530 void SetTopLeft(const wxPoint &p);
531 wxPoint GetBottomRight() const;
532 void SetBottomRight(const wxPoint &p);
534 wxPoint GetTopRight() const;
535 void SetTopRight(const wxPoint &p);
536 wxPoint GetBottomLeft() const;
537 void SetBottomLeft(const wxPoint &p);
539 // wxPoint GetLeftTop() const;
540 // void SetLeftTop(const wxPoint &p);
541 // wxPoint GetRightBottom() const;
542 // void SetRightBottom(const wxPoint &p);
543 // wxPoint GetRightTop() const;
544 // void SetRightTop(const wxPoint &p);
545 // wxPoint GetLeftBottom() const;
546 // void SetLeftBottom(const wxPoint &p);
550 int GetBottom() const;
551 int GetRight() const;
553 void SetLeft(int left);
554 void SetRight(int right);
555 void SetTop(int top);
556 void SetBottom(int bottom);
559 position = property(GetPosition, SetPosition)
560 size = property(GetSize, SetSize)
561 left = property(GetLeft, SetLeft)
562 right = property(GetRight, SetRight)
563 top = property(GetTop, SetTop)
564 bottom = property(GetBottom, SetBottom)
569 wxRect&, Inflate(wxCoord dx, wxCoord dy),
570 "Increases the size of the rectangle.
572 The left border is moved farther left and the right border is moved
573 farther right by ``dx``. The upper border is moved farther up and the
574 bottom border is moved farther down by ``dy``. (Note the the width and
575 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
576 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
577 opposite happens: the rectangle size decreases in the respective
580 The change is made to the rectangle inplace, if instead you need a
581 copy that is inflated, preserving the original then make the copy
584 copy = wx.Rect(*original)
588 Inflating and deflating behaves *naturally*. Defined more precisely,
591 * Real inflates (that is, ``dx`` and/or ``dy`` >= 0) are not
592 constrained. Thus inflating a rectangle can cause its upper left
593 corner to move into the negative numbers. (The versions prior to
594 2.5.4 forced the top left coordinate to not fall below (0, 0),
595 which implied a forced move of the rectangle.)
597 * Deflates are clamped to not reduce the width or height of the
598 rectangle below zero. In such cases, the top-left corner is
599 nonetheless handled properly. For example, a rectangle at (10,
600 10) with size (20, 40) that is inflated by (-15, -15) will
601 become located at (20, 25) at size (0, 10). Finally, observe
602 that the width and height are treated independently. In the
603 above example, the width is reduced by 20, whereas the height is
604 reduced by the full 30 (rather than also stopping at 20, when
605 the width reached zero).
610 // There are also these versions...
611 //wxRect& Inflate(const wxSize& d);
612 //wxRect& Inflate(wxCoord d);
616 wxRect&, Deflate(wxCoord dx, wxCoord dy),
617 "Decrease the rectangle size. This method is the opposite of `Inflate`
618 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
619 `Inflate` for a full description.", "");
621 // There are also these versions...
622 //wxRect& Deflate(const wxSize& d) { return Inflate(-d.x, -d.y); }
623 //wxRect& Deflate(wxCoord d) { return Inflate(-d); }
626 void, Offset(wxCoord dx, wxCoord dy),
627 "Moves the rectangle by the specified offset. If dx is positive, the
628 rectangle is moved to the right, if dy is positive, it is moved to the
629 bottom, otherwise it is moved to the left or top respectively.", "",
633 void, Offset(const wxPoint& pt),
634 "Same as `OffsetXY` but uses dx,dy from Point", "");
637 wxRect, Intersect(const wxRect& rect),
638 "Returns the intersectsion of this rectangle and rect.", "");
641 wxRect , Union(const wxRect& rect),
642 "Returns the union of this rectangle and rect.", "");
646 wxRect, operator+(const wxRect& rect) const,
647 "Add the properties of rect to this rectangle and return the result.", "");
650 wxRect&, operator+=(const wxRect& rect),
651 "Add the properties of rect to this rectangle, updating this rectangle.", "");
655 DocStr(__eq__, "Test for equality of wx.Rect objects.", "");
656 bool __eq__(PyObject* other) {
657 wxRect temp, *obj = &temp;
658 if ( other == Py_None ) return false;
659 if ( ! wxRect_helper(other, &obj) ) {
663 return self->operator==(*obj);
668 DocStr(__ne__, "Test for inequality of wx.Rect objects.", "");
669 bool __ne__(PyObject* other) {
670 wxRect temp, *obj = &temp;
671 if ( other == Py_None ) return true;
672 if ( ! wxRect_helper(other, &obj)) {
676 return self->operator!=(*obj);
681 DocStr( Contains, "Return True if the point is inside the rect.", "");
682 %Rename(ContainsXY, bool, Contains(int x, int y) const);
683 bool Contains(const wxPoint& pt) const;
686 bool, Contains(const wxRect& rect) const,
687 "Returns ``True`` if the given rectangle is completely inside this
688 rectangle or touches its boundary.", "",
692 %#Inside = wx._deprecated(Contains, "Use `Contains` instead.")
693 %#InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
694 %#InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
696 InsideXY = ContainsXY
697 InsideRect = ContainsRect
701 bool, Intersects(const wxRect& rect) const,
702 "Returns True if the rectangles have a non empty intersection.", "");
705 wxRect, CenterIn(const wxRect& r, int dir = wxBOTH),
706 "Center this rectangle within the one passed to the method, which is
707 usually, but not necessarily, the larger one.", "");
708 %pythoncode { CentreIn = CenterIn }
711 int x, y, width, height;
715 DocStr(Set, "Set all rectangle properties.", "");
716 void Set(int x=0, int y=0, int width=0, int height=0) {
720 self->height = height;
724 "Get() -> (x,y,width,height)",
725 "Return the rectangle properties as a tuple.", "");
727 wxPyBlock_t blocked = wxPyBeginBlockThreads();
728 PyObject* tup = PyTuple_New(4);
729 PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
730 PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
731 PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width));
732 PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height));
733 wxPyEndBlockThreads(blocked);
739 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
740 def __str__(self): return str(self.Get())
741 def __repr__(self): return 'wx.Rect'+str(self.Get())
742 def __len__(self): return len(self.Get())
743 def __getitem__(self, index): return self.Get()[index]
744 def __setitem__(self, index, val):
745 if index == 0: self.x = val
746 elif index == 1: self.y = val
747 elif index == 2: self.width = val
748 elif index == 3: self.height = val
749 else: raise IndexError
750 def __nonzero__(self): return self.Get() != (0,0,0,0)
751 __safe_for_unpickling__ = True
752 def __reduce__(self): return (wx.Rect, self.Get())
756 %property(Bottom, GetBottom, SetBottom, doc="See `GetBottom` and `SetBottom`");
757 %property(BottomRight, GetBottomRight, SetBottomRight, doc="See `GetBottomRight` and `SetBottomRight`");
758 %property(BottomLeft, GetBottomLeft, SetBottomLeft, doc="See `GetBottomLeft` and `SetBottomLeft`");
759 %property(Height, GetHeight, SetHeight, doc="See `GetHeight` and `SetHeight`");
760 %property(Left, GetLeft, SetLeft, doc="See `GetLeft` and `SetLeft`");
761 %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
762 %property(Right, GetRight, SetRight, doc="See `GetRight` and `SetRight`");
763 %property(Size, GetSize, SetSize, doc="See `GetSize` and `SetSize`");
764 %property(Top, GetTop, SetTop, doc="See `GetTop` and `SetTop`");
765 %property(TopLeft, GetTopLeft, SetTopLeft, doc="See `GetTopLeft` and `SetTopLeft`");
766 %property(TopRight, GetTopRight, SetTopRight, doc="See `GetTopRight` and `SetTopRight`");
767 %property(Width, GetWidth, SetWidth, doc="See `GetWidth` and `SetWidth`");
768 %property(X, GetX, SetX, doc="See `GetX` and `SetX`");
769 %property(Y, GetY, SetY, doc="See `GetY` and `SetY`");
771 %property(Empty, IsEmpty, doc="See `IsEmpty`");
775 MustHaveApp(wxIntersectRect);
777 DocAStr(wxIntersectRect,
778 "IntersectRect(Rect r1, Rect r2) -> Rect",
779 "Calculate and return the intersection of r1 and r2.", "");
781 PyObject* wxIntersectRect(wxRect* r1, wxRect* r2) {
784 wxRect dest(0,0,0,0);
787 reg1.Intersect(reg2);
788 dest = reg1.GetBox();
790 if (dest != wxRect(0,0,0,0)) {
791 wxPyBlock_t blocked = wxPyBeginBlockThreads();
792 wxRect* newRect = new wxRect(dest);
793 obj = wxPyConstructObject((void*)newRect, wxT("wxRect"), true);
794 wxPyEndBlockThreads(blocked);
802 //---------------------------------------------------------------------------
807 "wx.Point2Ds represent a point or a vector in a 2d coordinate system
808 with floating point values.", "");
813 DocStr(wxPoint2D, "Create a w.Point2D object.", "");
814 wxPoint2D( double x=0.0 , double y=0.0 );
815 %RenameCtor(Point2DCopy, wxPoint2D( const wxPoint2D &pt ));
816 %RenameCtor(Point2DFromPoint, wxPoint2D( const wxPoint &pt ));
819 void, GetFloor( int *OUTPUT , int *OUTPUT ) const,
820 "GetFloor() -> (x,y)",
821 "Convert to integer", "");
824 void, GetRounded( int *OUTPUT , int *OUTPUT ) const,
825 "GetRounded() -> (x,y)",
826 "Convert to integer", "");
828 double GetVectorLength() const;
829 double GetVectorAngle() const ;
830 void SetVectorLength( double length );
831 void SetVectorAngle( double degrees );
833 // LinkError: void SetPolarCoordinates( double angle , double length );
834 // LinkError: void Normalize();
836 def SetPolarCoordinates(self, angle, length):
837 self.SetVectorLength(length)
838 self.SetVectorAngle(angle)
840 self.SetVectorLength(1.0)
843 double GetDistance( const wxPoint2D &pt ) const;
844 double GetDistanceSquare( const wxPoint2D &pt ) const;
845 double GetDotProduct( const wxPoint2D &vec ) const;
846 double GetCrossProduct( const wxPoint2D &vec ) const;
849 wxPoint2D, operator-(),
850 "the reflection of this point", "");
852 wxPoint2D& operator+=(const wxPoint2D& pt);
853 wxPoint2D& operator-=(const wxPoint2D& pt);
855 wxPoint2D& operator*=(const wxPoint2D& pt);
856 wxPoint2D& operator/=(const wxPoint2D& pt);
860 DocStr(__eq__, "Test for equality of wx.Point2D objects.", "");
861 bool __eq__(PyObject* other) {
862 wxPoint2D temp, *obj = &temp;
863 if ( other == Py_None ) return false;
864 if ( ! wxPoint2D_helper(other, &obj) ) {
868 return self->operator==(*obj);
873 DocStr(__ne__, "Test for inequality of wx.Point2D objects.", "");
874 bool __ne__(PyObject* other) {
875 wxPoint2D temp, *obj = &temp;
876 if ( other == Py_None ) return true;
877 if ( ! wxPoint2D_helper(other, &obj)) {
881 return self->operator!=(*obj);
885 %Rename(x, double, m_x);
886 %Rename(y, double, m_y);
889 void Set( double x=0 , double y=0 ) {
896 "Return x and y properties as a tuple.", "");
898 wxPyBlock_t blocked = wxPyBeginBlockThreads();
899 PyObject* tup = PyTuple_New(2);
900 PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->m_x));
901 PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->m_y));
902 wxPyEndBlockThreads(blocked);
908 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
909 def __str__(self): return str(self.Get())
910 def __repr__(self): return 'wx.Point2D'+str(self.Get())
911 def __len__(self): return len(self.Get())
912 def __getitem__(self, index): return self.Get()[index]
913 def __setitem__(self, index, val):
914 if index == 0: self.x = val
915 elif index == 1: self.y = val
916 else: raise IndexError
917 def __nonzero__(self): return self.Get() != (0.0, 0.0)
918 __safe_for_unpickling__ = True
919 def __reduce__(self): return (wx.Point2D, self.Get())
922 %property(Floor, GetFloor, doc="See `GetFloor`");
923 %property(Rounded, GetRounded, doc="See `GetRounded`");
924 %property(VectorAngle, GetVectorAngle, SetVectorAngle, doc="See `GetVectorAngle` and `SetVectorAngle`");
925 %property(VectorLength, GetVectorLength, SetVectorLength, doc="See `GetVectorLength` and `SetVectorLength`");
930 //---------------------------------------------------------------------------
933 const wxPoint wxDefaultPosition;
934 const wxSize wxDefaultSize;
937 //---------------------------------------------------------------------------