X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/392751754e224616f01ce454830177b7a2b24b2b..8b2858410444b111cb192d1539ef6c76209091fd:/docs/latex/wx/rect.tex diff --git a/docs/latex/wx/rect.tex b/docs/latex/wx/rect.tex index 3a55f65f9b..30cba05bf7 100644 --- a/docs/latex/wx/rect.tex +++ b/docs/latex/wx/rect.tex @@ -16,6 +16,7 @@ None \latexignore{\rtfignore{\wxheading{Members}}} + \membersection{wxRect::wxRect}\label{wxrectctor} \func{}{wxRect}{\void} @@ -34,30 +35,39 @@ Creates a wxRect object from top-left and bottom-right points. Creates a wxRect object from position and size values. +\func{}{wxRect}{\param{const wxSize\&}{ size}} + +Creates a wxRect object from size values at the origin. + + \membersection{wxRect::x}\label{wxrectx} \member{int}{x} x coordinate of the top-level corner of the rectangle. + \membersection{wxRect::y}\label{wxrecty} \member{int}{y} y coordinate of the top-level corner of the rectangle. + \membersection{wxRect::width}\label{wxrectwidth} \member{int}{width} Width member. + \membersection{wxRect::height}\label{wxrectheight} \member{int}{height} Height member. + \membersection{wxRect::Deflate}\label{wxrectdeflate} \func{void}{Deflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}} @@ -66,54 +76,58 @@ Height member. \constfunc{wxRect}{Deflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}} -Decrease the rectangle size by {\it dx} in x direction and {\it dy} in y -direction. Both (or one of) parameters may be negative to increase the -rectngle size. This method is the opposite of \helpref{Inflate}{wxrectinflate}. +Decrease the rectangle size. -The second form uses the same {\it diff} for both {\it dx} and {\it dy}. - -The first two versions modify the rectangle in place, the last one returns a -new rectangle leaving this one unchanged. +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. \wxheading{See also} \helpref{Inflate}{wxrectinflate} + \membersection{wxRect::GetBottom}\label{wxrectgetbottom} \constfunc{int}{GetBottom}{\void} Gets the bottom point of the rectangle. + \membersection{wxRect::GetHeight}\label{wxrectgetheight} \constfunc{int}{GetHeight}{\void} Gets the height member. + \membersection{wxRect::GetLeft}\label{wxrectgetleft} \constfunc{int}{GetLeft}{\void} Gets the left point of the rectangle (the same as \helpref{wxRect::GetX}{wxrectgetx}). + \membersection{wxRect::GetPosition}\label{wxrectgetposition} \constfunc{wxPoint}{GetPosition}{\void} Gets the position. + \membersection{wxRect::GetTopLeft}\label{wxrectgettopleft} \constfunc{wxPoint}{GetTopLeft}{\void} Gets the topleft position of the rectangle. (Same as GetPosition). + \membersection{wxRect::GetBottomRight}\label{wxrectgetbottomright} \constfunc{wxPoint}{GetBottomRight}{\void} -Gets the the bottom right position. Returns the bottom right point inside the rectangle. +Gets the bottom right position. Returns the bottom right point inside the rectangle. + \membersection{wxRect::GetRight}\label{wxrectgetright} @@ -121,36 +135,46 @@ Gets the the bottom right position. Returns the bottom right point inside the re Gets the right point of the rectangle. + \membersection{wxRect::GetSize}\label{wxrectgetsize} \constfunc{wxSize}{GetSize}{\void} Gets the size. +\wxheading{See also} + +\helpref{wxRect::SetSize}{wxrectsetsize} + + \membersection{wxRect::GetTop}\label{wxrectgettop} \constfunc{int}{GetTop}{\void} Gets the top point of the rectangle (the same as \helpref{wxRect::GetY}{wxrectgety}). + \membersection{wxRect::GetWidth}\label{wxrectgetwidth} \constfunc{int}{GetWidth}{\void} Gets the width member. + \membersection{wxRect::GetX}\label{wxrectgetx} \constfunc{int}{GetX}{\void} Gets the x member. + \membersection{wxRect::GetY}\label{wxrectgety} \constfunc{int}{GetY}{\void} Gets the y member. + \membersection{wxRect::Inflate}\label{wxrectinflate} \func{void}{Inflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}} @@ -159,20 +183,45 @@ Gets the y member. \constfunc{wxRect}{Inflate}{\param{wxCoord }{dx}, \param{wxCoord }{dy}} -Increase the rectangle size by {\it dx} in x direction and {\it dy} in y -direction. Both (or one of) parameters may be negative to decrease the -rectangle size. +Increases the size of the rectangle. The second form uses the same {\it diff} for both {\it dx} and {\it dy}. The first two versions modify the rectangle in place, the last one returns a new rectangle leaving this one unchanged. +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} + \wxheading{See also} \helpref{Deflate}{wxrectdeflate} -\membersection{wxRect:Inside}\label{wxrectinside} + +\membersection{wxRect::Inside}\label{wxrectinside} \constfunc{bool}{Inside}{\param{int }{x}, \param{int }{y}} @@ -181,13 +230,23 @@ new rectangle leaving this one unchanged. Returns {\tt true} if the given point is inside the rectangle (or on its boundary) and {\tt false} otherwise. -\membersection{wxRect:Intersects}\label{wxrectintersects} + +\membersection{wxRect::Intersects}\label{wxrectintersects} \constfunc{bool}{Intersects}{\param{const wxRect\& }{rect}} Returns {\tt true} if this rectangle has a non empty intersection with the rectangle {\it rect} and {\tt false} otherwise. + +\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. + + \membersection{wxRect::Offset}\label{wxrectoffset} \func{void}{Offset}{\param{wxCoord }{dx}, \param{wxCoord }{dy}} @@ -198,42 +257,71 @@ 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. + \membersection{wxRect::SetHeight}\label{wxrectsetheight} \func{void}{SetHeight}{\param{int}{ height}} Sets the height. + +\membersection{wxRect::SetSize}\label{wxrectsetsize} + +\func{void}{SetSize}{\param{const wxSize\&}{ s}} + +Sets the size. + +\wxheading{See also} + +\helpref{wxRect::GetSize}{wxrectgetsize} + + \membersection{wxRect::SetWidth}\label{wxrectsetwidth} \func{void}{SetWidth}{\param{int}{ width}} Sets the width. + \membersection{wxRect::SetX}\label{wxrectsetx} \func{void}{SetX}{\param{int}{ x}} Sets the x position. + \membersection{wxRect::SetY}\label{wxrectsety} \func{void}{SetY}{\param{int}{ y}} Sets the y position. + +\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. + + \membersection{wxRect::operator $=$}\label{wxrectassign} \func{void}{operator $=$}{\param{const wxRect\& }{rect}} Assignment operator. + \membersection{wxRect::operator $==$}\label{wxrectequal} \func{bool}{operator $==$}{\param{const wxRect\& }{rect}} Equality operator. + \membersection{wxRect::operator $!=$}\label{wxrectnotequal} \func{bool}{operator $!=$}{\param{const wxRect\& }{rect}}