Home | Trees | Index | Help |
|
---|
Package wx :: Class 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 |
Create a new Rect object. |
Rect |
Add the properties of rect to this rectangle and return the result. |
__del__(self)
| |
bool |
Test for equality of wx.Rect objects. |
__getitem__(self,
index)
| |
Rect |
Add the properties of rect to this rectangle, updating this rectangle. |
__len__(self)
| |
bool |
Test for inequality of wx.Rect objects. |
__nonzero__(self)
| |
__reduce__(self)
| |
__repr__(self)
| |
__setitem__(self,
index,
val)
| |
__str__(self)
| |
asTuple is deprecated, use Get instead | |
Rect |
Center this rectangle within the one passed to the method, which is usually, but not necessarily, the larger one. |
Rect |
Center this rectangle within the one passed to the method, which is usually, but not necessarily, the larger one. |
bool |
Return True if the point is inside the rect. |
bool |
Returns True if the given rectangle is completely inside this rectangle or touches its boundary. |
bool |
Return True if the point is inside the rect. |
Rect |
Decrease the rectangle size. |
(x,y,width,height) |
Return the rectangle properties as a tuple. |
int | GetBottom(self)
|
Point | GetBottomLeft(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)
|
Point | GetTopRight(self)
|
int | GetWidth(self)
|
int | GetX(self)
|
int | GetY(self)
|
Rect |
Increases the size of the rectangle. |
bool |
Return True if the point is inside the rect. |
bool |
Returns True if the given rectangle is completely inside this rectangle or touches its boundary. |
bool |
Return True if the point is inside the rect. |
Rect |
Returns the intersectsion of this rectangle and rect. |
bool |
Returns True if the rectangles have a non empty intersection. |
bool | IsEmpty(self)
|
Same as OffsetXY but uses dx,dy from Point | |
Moves the rectangle by the specified offset. | |
Set all rectangle properties. | |
SetBottom(self,
bottom)
| |
SetBottomLeft(self,
p)
| |
SetBottomRight(self,
p)
| |
SetHeight(self,
h)
| |
SetLeft(self,
left)
| |
SetPosition(self,
p)
| |
SetRight(self,
right)
| |
SetSize(self,
s)
| |
SetTop(self,
top)
| |
SetTopLeft(self,
p)
| |
SetTopRight(self,
p)
| |
SetWidth(self,
w)
| |
SetX(self,
x)
| |
SetY(self,
y)
| |
Rect |
Returns the union of this rectangle and rect. |
Property Summary | |
---|---|
Bottom : See GetBottom and SetBottom | |
bottom : GetBottom(self) -> int | |
BottomLeft : See GetBottomLeft and SetBottomLeft | |
BottomRight : See GetBottomRight and SetBottomRight | |
Empty : See IsEmpty | |
Height : See GetHeight and SetHeight | |
height | |
Left : See GetLeft and SetLeft | |
left : GetLeft(self) -> int | |
Position : See GetPosition and SetPosition | |
position : GetPosition(self) -> Point | |
Right : See GetRight and SetRight | |
right : GetRight(self) -> int | |
Size : See GetSize and SetSize | |
size : GetSize(self) -> Size | |
thisown : The membership flag | |
Top : See GetTop and SetTop | |
top : GetTop(self) -> int | |
TopLeft : See GetTopLeft and SetTopLeft | |
TopRight : See GetTopRight and SetTopRight | |
Width : See GetWidth and SetWidth | |
width | |
X : See GetX and SetX | |
x | |
Y : See GetY and SetY | |
y |
Class Variable Summary | |
---|---|
bool |
__safe_for_unpickling__ = True
|
Method Details |
---|
__init__(self,
x=0,
y=0,
width=0,
height=0)
|
__add__(self,
rect)
|
__eq__(self,
other)
|
__iadd__(self, rect)Add the properties of rect to this rectangle, updating this rectangle.
|
__ne__(self, other)Test for inequality of wx.Rect objects.
|
asTuple(*args, **kwargs)asTuple is deprecated, use |
CenterIn(self, r, dir=BOTH)Center this rectangle within the one passed to the method, which is usually, but not necessarily, the larger one.
|
CentreIn(self, r, dir=BOTH)Center this rectangle within the one passed to the method, which is usually, but not necessarily, the larger one.
|
Contains(self, pt)Return True if the point is inside the rect.
|
ContainsRect(self, rect)Returns True if the given rectangle is completely inside this rectangle or touches its boundary.
|
ContainsXY(self, x, y)Return True if the point is inside the rect.
|
Deflate(self, dx, dy)Decrease the rectangle size. This method is the opposite of
|
Get()Return the rectangle properties as a tuple.
|
Inflate(self, dx, dy)Increases the size of the rectangle. The left border is moved farther left and the right border is moved farther right by dx. The upper border is moved farther up and the bottom border is moved farther down by dy. (Note the the width and height of the rectangle thus change by 2*dx and 2*dy, respectively.) If one or both of dx and dy are negative, the opposite happens: the rectangle size decreases in the respective direction. The change is made to the rectangle inplace, if instead you need a copy that is inflated, preserving the original then make the copy first: copy = wx.Rect(*original) copy.Inflate(10,15) Inflating and deflating behaves naturally. Defined more precisely, that means:
|
Inside(self, pt)Return True if the point is inside the rect.
|
InsideRect(self, rect)Returns True if the given rectangle is completely inside this rectangle or touches its boundary.
|
InsideXY(self, x, y)Return True if the point is inside the rect.
|
Intersect(self, rect)Returns the intersectsion of this rectangle and rect.
|
Intersects(self, rect)Returns True if the rectangles have a non empty intersection.
|
Offset(self, pt)Same as
|
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.
|
Set(self, x=0, y=0, width=0, height=0)Set all rectangle properties.
|
Union(self, rect)Returns the union of this rectangle and rect.
|
Property Details |
---|
Bottom |
bottomGetBottom(self) -> int |
BottomLeftSee
|
BottomRightSee
|
EmptySee
|
Height |
Left |
leftGetLeft(self) -> int |
PositionSee
|
positionGetPosition(self) -> Point
|
Right |
rightGetRight(self) -> int |
Size |
sizeGetSize(self) -> Size |
thisownThe membership flag |
Top |
topGetTop(self) -> int |
TopLeftSee
|
TopRightSee
|
Width |
X |
Y |
Class Variable Details |
---|
__safe_for_unpickling__
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:54:51 2009 | http://epydoc.sf.net |