1998-05-20 10:25:30 -04:00
|
|
|
\section{\class{wxRect}}\label{wxrect}
|
|
|
|
|
|
|
|
A class for manipulating rectangles.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
1999-01-24 09:57:09 -05:00
|
|
|
None
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/gdicmn.h>
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxPoint}{wxpoint}, \helpref{wxSize}{wxsize}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2004-09-24 06:57:56 -04:00
|
|
|
\membersection{wxRect::wxRect}\label{wxrectctor}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{}{wxRect}{\void}
|
|
|
|
|
|
|
|
Default constructor.
|
|
|
|
|
1998-06-14 08:11:50 -04:00
|
|
|
\func{}{wxRect}{\param{int}{ x}, \param{int}{ y}, \param{int}{ width}, \param{int}{ height}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Creates a wxRect object from x, y, width and height values.
|
|
|
|
|
|
|
|
\func{}{wxRect}{\param{const wxPoint\&}{ topLeft}, \param{const wxPoint\&}{ bottomRight}}
|
|
|
|
|
|
|
|
Creates a wxRect object from top-left and bottom-right points.
|
|
|
|
|
|
|
|
\func{}{wxRect}{\param{const wxPoint\&}{ pos}, \param{const wxSize\&}{ size}}
|
|
|
|
|
|
|
|
Creates a wxRect object from position and size values.
|
|
|
|
|
2004-11-05 14:54:29 -05:00
|
|
|
\func{}{wxRect}{\param{const wxSize\&}{ size}}
|
|
|
|
|
|
|
|
Creates a wxRect object from size values at the origin.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2004-09-24 06:57:56 -04:00
|
|
|
\membersection{wxRect::x}\label{wxrectx}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{int}{x}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
x coordinate of the top-level corner of the rectangle.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2004-09-24 06:57:56 -04:00
|
|
|
\membersection{wxRect::y}\label{wxrecty}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{int}{y}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
y coordinate of the top-level corner of the rectangle.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2004-09-24 06:57:56 -04:00
|
|
|
\membersection{wxRect::width}\label{wxrectwidth}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{int}{width}
|
|
|
|
|
|
|
|
Width member.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2004-09-24 06:57:56 -04:00
|
|
|
\membersection{wxRect::height}\label{wxrectheight}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{int}{height}
|
|
|
|
|
|
|
|
Height member.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2002-05-20 11:28:12 -04:00
|
|
|
\membersection{wxRect::Deflate}\label{wxrectdeflate}
|
|
|
|
|
|
|
|
\func{void}{Deflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
|
|
|
|
|
|
|
|
\func{void}{Deflate}{\param{wxCoord }{diff}}
|
|
|
|
|
|
|
|
\constfunc{wxRect}{Deflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
|
|
|
|
|
2005-02-04 06:04:43 -05:00
|
|
|
Decrease the rectangle size.
|
2002-05-20 11:28:12 -04:00
|
|
|
|
2005-02-04 06:04:43 -05:00
|
|
|
This method is the opposite from \helpref{Inflate}{wxrectinflate}:
|
|
|
|
Deflate(a, b) is equivalent to Inflate(-a, -b).
|
|
|
|
Please refer to \helpref{Inflate}{wxrectinflate} for full description.
|
2002-05-20 11:28:12 -04:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{Inflate}{wxrectinflate}
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::GetBottom}\label{wxrectgetbottom}
|
|
|
|
|
|
|
|
\constfunc{int}{GetBottom}{\void}
|
|
|
|
|
|
|
|
Gets the bottom point of the rectangle.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::GetHeight}\label{wxrectgetheight}
|
|
|
|
|
|
|
|
\constfunc{int}{GetHeight}{\void}
|
|
|
|
|
|
|
|
Gets the height member.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::GetLeft}\label{wxrectgetleft}
|
|
|
|
|
|
|
|
\constfunc{int}{GetLeft}{\void}
|
|
|
|
|
|
|
|
Gets the left point of the rectangle (the same as \helpref{wxRect::GetX}{wxrectgetx}).
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::GetPosition}\label{wxrectgetposition}
|
|
|
|
|
|
|
|
\constfunc{wxPoint}{GetPosition}{\void}
|
|
|
|
|
|
|
|
Gets the position.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2003-12-11 07:33:11 -05:00
|
|
|
\membersection{wxRect::GetTopLeft}\label{wxrectgettopleft}
|
|
|
|
|
|
|
|
\constfunc{wxPoint}{GetTopLeft}{\void}
|
|
|
|
|
|
|
|
Gets the topleft position of the rectangle. (Same as GetPosition).
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2003-12-11 07:33:11 -05:00
|
|
|
\membersection{wxRect::GetBottomRight}\label{wxrectgetbottomright}
|
|
|
|
|
|
|
|
\constfunc{wxPoint}{GetBottomRight}{\void}
|
|
|
|
|
|
|
|
Gets the the bottom right position. Returns the bottom right point inside the rectangle.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::GetRight}\label{wxrectgetright}
|
|
|
|
|
|
|
|
\constfunc{int}{GetRight}{\void}
|
|
|
|
|
|
|
|
Gets the right point of the rectangle.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::GetSize}\label{wxrectgetsize}
|
|
|
|
|
|
|
|
\constfunc{wxSize}{GetSize}{\void}
|
|
|
|
|
|
|
|
Gets the size.
|
|
|
|
|
2005-02-22 02:15:18 -05:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxRect::SetSize}{wxrectsetsize}
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::GetTop}\label{wxrectgettop}
|
|
|
|
|
|
|
|
\constfunc{int}{GetTop}{\void}
|
|
|
|
|
|
|
|
Gets the top point of the rectangle (the same as \helpref{wxRect::GetY}{wxrectgety}).
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::GetWidth}\label{wxrectgetwidth}
|
|
|
|
|
|
|
|
\constfunc{int}{GetWidth}{\void}
|
|
|
|
|
|
|
|
Gets the width member.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::GetX}\label{wxrectgetx}
|
|
|
|
|
|
|
|
\constfunc{int}{GetX}{\void}
|
|
|
|
|
|
|
|
Gets the x member.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::GetY}\label{wxrectgety}
|
|
|
|
|
|
|
|
\constfunc{int}{GetY}{\void}
|
|
|
|
|
|
|
|
Gets the y member.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2000-02-17 09:06:00 -05:00
|
|
|
\membersection{wxRect::Inflate}\label{wxrectinflate}
|
|
|
|
|
|
|
|
\func{void}{Inflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
|
|
|
|
|
|
|
|
\func{void}{Inflate}{\param{wxCoord }{diff}}
|
|
|
|
|
2002-05-20 11:28:12 -04:00
|
|
|
\constfunc{wxRect}{Inflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
|
|
|
|
|
2005-02-04 06:04:43 -05:00
|
|
|
Increases the size of the rectangle.
|
2000-02-17 09:06:00 -05:00
|
|
|
|
|
|
|
The second form uses the same {\it diff} for both {\it dx} and {\it dy}.
|
|
|
|
|
2002-05-20 11:28:12 -04:00
|
|
|
The first two versions modify the rectangle in place, the last one returns a
|
|
|
|
new rectangle leaving this one unchanged.
|
|
|
|
|
2005-02-04 06:04:43 -05:00
|
|
|
The left border is moved farther left and the right border is moved farther
|
|
|
|
right by {\it dx}. The upper border is moved farther up and the bottom border
|
|
|
|
is moved farther down by {\it dy}. (Note the the width and height of the
|
|
|
|
rectangle thus change by 2*{\it dx} and 2*{\it dy}, respectively.) If one or
|
|
|
|
both of {\it dx} and {\it dy} are negative, the opposite happens: the rectangle
|
|
|
|
size decreases in the respective direction.
|
|
|
|
|
|
|
|
Inflating and deflating behaves ``naturally''. Defined more precisely, that
|
|
|
|
means:
|
|
|
|
\begin{enumerate}
|
|
|
|
\item ``Real'' inflates (that is, {\it dx} and/or {\it dy} >= 0) are not
|
|
|
|
constrained. Thus inflating a rectangle can cause its upper left corner
|
|
|
|
to move into the negative numbers. (the versions prior to 2.5.4 forced
|
|
|
|
the top left coordinate to not fall below (0, 0), which implied a
|
|
|
|
forced move of the rectangle.)
|
|
|
|
|
|
|
|
\item Deflates are clamped to not reduce the width or height of the
|
|
|
|
rectangle below zero. In such cases, the top-left corner is nonetheless
|
|
|
|
handled properly. For example, a rectangle at (10, 10) with size (20,
|
|
|
|
40) that is inflated by (-15, -15) will become located at (20, 25) at
|
|
|
|
size (0, 10). Finally, observe that the width and height are treated
|
|
|
|
independently. In the above example, the width is reduced by 20,
|
|
|
|
whereas the height is reduced by the full 30 (rather than also stopping
|
|
|
|
at 20, when the width reached zero).
|
|
|
|
\end{enumerate}
|
|
|
|
|
2002-05-20 11:28:12 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{Deflate}{wxrectdeflate}
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2004-11-10 14:32:18 -05:00
|
|
|
\membersection{wxRect::Inside}\label{wxrectinside}
|
2002-05-20 11:28:12 -04:00
|
|
|
|
|
|
|
\constfunc{bool}{Inside}{\param{int }{x}, \param{int }{y}}
|
|
|
|
|
|
|
|
\constfunc{bool}{Inside}{\param{const wxPoint\& }{pt}}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if the given point is inside the rectangle (or on its
|
|
|
|
boundary) and {\tt false} otherwise.
|
2002-05-20 11:28:12 -04:00
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2004-11-10 14:32:18 -05:00
|
|
|
\membersection{wxRect::Intersects}\label{wxrectintersects}
|
2002-05-20 11:28:12 -04:00
|
|
|
|
|
|
|
\constfunc{bool}{Intersects}{\param{const wxRect\& }{rect}}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns {\tt true} if this rectangle has a non empty intersection with the
|
|
|
|
rectangle {\it rect} and {\tt false} otherwise.
|
2002-05-20 11:28:12 -04:00
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2005-03-04 13:33:57 -05:00
|
|
|
\membersection{wxRect::IsEmpty}\label{wxrectisempty}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsEmpty}{}
|
|
|
|
|
|
|
|
Returns {\tt true} if this rectangle has a width or height less than or equal to
|
|
|
|
0 and {\tt false} otherwise.
|
|
|
|
|
|
|
|
|
2002-05-20 11:28:12 -04:00
|
|
|
\membersection{wxRect::Offset}\label{wxrectoffset}
|
|
|
|
|
|
|
|
\func{void}{Offset}{\param{wxCoord }{dx}, \param{wxCoord }{dy}}
|
|
|
|
|
|
|
|
\func{void}{Offset}{\param{const wxPoint\& }{pt}}
|
|
|
|
|
|
|
|
Moves the rectangle by the specified offset. If {\it dx} is positive, the
|
|
|
|
rectangle is moved to the right, if {\it dy} is positive, it is moved to the
|
|
|
|
bottom, otherwise it is moved to the left or top respectively.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::SetHeight}\label{wxrectsetheight}
|
|
|
|
|
1998-06-14 08:11:50 -04:00
|
|
|
\func{void}{SetHeight}{\param{int}{ height}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Sets the height.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2005-02-22 02:15:18 -05:00
|
|
|
\membersection{wxRect::SetSize}\label{wxrectsetsize}
|
|
|
|
|
|
|
|
\func{void}{SetSize}{\param{const wxSize\&}{ s}}
|
|
|
|
|
|
|
|
Sets the size.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxRect::GetSize}{wxrectgetsize}
|
|
|
|
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::SetWidth}\label{wxrectsetwidth}
|
|
|
|
|
1998-06-14 08:11:50 -04:00
|
|
|
\func{void}{SetWidth}{\param{int}{ width}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Sets the width.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::SetX}\label{wxrectsetx}
|
|
|
|
|
1998-06-14 08:11:50 -04:00
|
|
|
\func{void}{SetX}{\param{int}{ x}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Sets the x position.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxRect::SetY}\label{wxrectsety}
|
|
|
|
|
1998-06-14 08:11:50 -04:00
|
|
|
\func{void}{SetY}{\param{int}{ y}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Sets the y position.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
|
|
|
\membersection{wxRect::Union}\label{wxrectunion}
|
|
|
|
|
|
|
|
\constfunc{wxRect}{Union}{\param{const wxRect\&}{ rect}}
|
|
|
|
|
|
|
|
\func{wxRect\&}{Union}{\param{const wxRect\&}{ rect}}
|
|
|
|
|
|
|
|
Modifies the rectangle to contain the bounding box of this rectangle and the
|
|
|
|
one passed in as parameter. The const version returns the new rectangle, the
|
|
|
|
other one modifies this rectangle in place.
|
|
|
|
|
|
|
|
|
2004-09-24 06:57:56 -04:00
|
|
|
\membersection{wxRect::operator $=$}\label{wxrectassign}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{operator $=$}{\param{const wxRect\& }{rect}}
|
|
|
|
|
|
|
|
Assignment operator.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2004-09-24 06:57:56 -04:00
|
|
|
\membersection{wxRect::operator $==$}\label{wxrectequal}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{bool}{operator $==$}{\param{const wxRect\& }{rect}}
|
|
|
|
|
|
|
|
Equality operator.
|
|
|
|
|
2004-12-11 18:29:55 -05:00
|
|
|
|
2004-09-24 06:57:56 -04:00
|
|
|
\membersection{wxRect::operator $!=$}\label{wxrectnotequal}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{bool}{operator $!=$}{\param{const wxRect\& }{rect}}
|
|
|
|
|
|
|
|
Inequality operator.
|
|
|
|
|