Package wx :: Class Rect
[frames | no frames]

Type Rect

object --+
         |
        Rect


A class for representing and manipulating rectangles. It has x, y, width and height properties. In wxPython most palces that expect a wx.Rect can also accept a (x,y,width,height) tuple.
Method Summary
Rect __init__(self, x, y, width, height)
Create a new Rect object.
Rect __add__(self, rect)
Add the properties of rect to this rectangle and return the result.
  __del__(self)
bool __eq__(self, rect)
Test for equality.
  __getitem__(self, index)
Rect __iadd__(self, rect)
Add the properties of rect to this rectangle, updating this rectangle.
  __len__(self)
bool __ne__(self, rect)
Test for inequality.
  __nonzero__(self)
  __reduce__(self)
  __repr__(self)
  __setitem__(self, index, val)
  __str__(self)
  asTuple(*args, **kwargs)
asTuple is deprecated, use Get instead
Rect Deflate(self, dx, dy)
Decrease the rectangle size by dx in x direction and dy in y direction.
(x,y,width,height) Get()
Return the rectangle properties as a tuple.
int GetBottom(self)
Point GetBottomRight(self)
int GetHeight(self)
int GetLeft(self)
Point GetPosition(self)
int GetRight(self)
Size GetSize(self)
int GetTop(self)
Point GetTopLeft(self)
int GetWidth(self)
int GetX(self)
int GetY(self)
Rect Inflate(self, dx, dy)
Increase the rectangle size by dx in x direction and dy in y direction.
bool Inside(self, pt)
Return True if the point is (not strcitly) inside the rect.
bool InsideXY(self, x, y)
Return True if the point is (not strcitly) inside the rect.
Rect Intersect(self, rect)
Return the intersectsion of this rectangle and rect.
bool Intersects(self, rect)
Returns True if the rectangles have a non empty intersection.
  Offset(self, pt)
Same as OffsetXY but uses dx,dy from Point
  OffsetXY(self, dx, dy)
Moves the rectangle by the specified offset.
  Set(self, x, y, width, height)
Set all rectangle properties.
  SetBottom(self, bottom)
  SetBottomRight(self, p)
  SetHeight(self, h)
  SetLeft(self, left)
  SetPosition(self, p)
  SetRight(self, right)
  SetSize(self, s)
  SetTop(self, top)
  SetTopLeft(self, p)
  SetWidth(self, w)
  SetX(self, x)
  SetY(self, y)

Property Summary
  bottom
  height
  left
  position
  right
  size
  top
  width
  x
  y

Class Variable Summary
bool __safe_for_unpickling__ = True

Method Details

__init__(self, x=0, y=0, width=0, height=0)
(Constructor)

Create a new Rect object.
Parameters:
x
           (type=int)
y
           (type=int)
width
           (type=int)
height
           (type=int)
Returns:
Rect
Overrides:
__builtin__.object.__init__

__add__(self, rect)
(Addition operator)

Add the properties of rect to this rectangle and return the result.
Parameters:
rect
           (type=Rect)
Returns:
Rect

__eq__(self, rect)
(Equality operator)

Test for equality.
Parameters:
rect
           (type=Rect)
Returns:
bool

__iadd__(self, rect)

Add the properties of rect to this rectangle, updating this rectangle.
Parameters:
rect
           (type=Rect)
Returns:
Rect

__ne__(self, rect)

Test for inequality.
Parameters:
rect
           (type=Rect)
Returns:
bool

asTuple(*args, **kwargs)

asTuple is deprecated, use Get instead

Deflate(self, dx, dy)

Decrease the rectangle size by dx in x direction and dy in y direction. Both or one of) parameters may be negative to increase the rectngle size. This method is the opposite of Inflate.
Parameters:
dx
           (type=int)
dy
           (type=int)
Returns:
Rect

Get()

Return the rectangle properties as a tuple.
Returns:
(x,y,width,height)

Inflate(self, dx, dy)

Increase the rectangle size by dx in x direction and dy in y direction. Both or one of) parameters may be negative to decrease the rectangle size.
Parameters:
dx
           (type=int)
dy
           (type=int)
Returns:
Rect

Inside(self, pt)

Return True if the point is (not strcitly) inside the rect.
Parameters:
pt
           (type=Point)
Returns:
bool

InsideXY(self, x, y)

Return True if the point is (not strcitly) inside the rect.
Parameters:
x
           (type=int)
y
           (type=int)
Returns:
bool

Intersect(self, rect)

Return the intersectsion of this rectangle and rect.
Parameters:
rect
           (type=Rect)
Returns:
Rect

Intersects(self, rect)

Returns True if the rectangles have a non empty intersection.
Parameters:
rect
           (type=Rect)
Returns:
bool

Offset(self, pt)

Same as OffsetXY but uses dx,dy from Point
Parameters:
pt
           (type=Point)

OffsetXY(self, dx, dy)

Moves the rectangle by the specified offset. If dx is positive, the rectangle is moved to the right, if dy is positive, it is moved to the bottom, otherwise it is moved to the left or top respectively.
Parameters:
dx
           (type=int)
dy
           (type=int)

Set(self, x=0, y=0, width=0, height=0)

Set all rectangle properties.
Parameters:
x
           (type=int)
y
           (type=int)
width
           (type=int)
height
           (type=int)

Property Details

bottom

Get Method:
GetBottom(self)
Set Method:
SetBottom(self, bottom)

height

Get Method:
Rect_height_get(...)
Set Method:
Rect_height_set(...)

left

Get Method:
GetLeft(self)
Set Method:
SetLeft(self, left)

position

Get Method:
GetPosition(self)
Set Method:
SetPosition(self, p)

right

Get Method:
GetRight(self)
Set Method:
SetRight(self, right)

size

Get Method:
GetSize(self)
Set Method:
SetSize(self, s)

top

Get Method:
GetTop(self)
Set Method:
SetTop(self, top)

width

Get Method:
Rect_width_get(...)
Set Method:
Rect_width_set(...)

x

Get Method:
Rect_x_get(...)
Set Method:
Rect_x_set(...)

y

Get Method:
Rect_y_get(...)
Set Method:
Rect_y_set(...)

Class Variable Details

__safe_for_unpickling__

Type:
bool
Value:
True                                                                   

Generated by Epydoc 2.1.20040428.rpd on Tue Nov 9 17:04:16 2004 http://epydoc.sf.net