added wxSize::IncBy() and DecBy() methods
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -62,8 +62,11 @@ All:
|
|||||||
|
|
||||||
All (GUI):
|
All (GUI):
|
||||||
|
|
||||||
- Support for right-to-left text layout (Diaa Sami during Google Summer of Code)
|
- Support for right-to-left text layout
|
||||||
|
(started by Diaa Sami during Google Summer of Code, with a lot of help from
|
||||||
|
Tim Kosse and others)
|
||||||
- Added wxID_PAGE_SETUP standard id
|
- Added wxID_PAGE_SETUP standard id
|
||||||
|
- Added wxSize::IncBy() and DecBy() methods
|
||||||
|
|
||||||
wxMSW:
|
wxMSW:
|
||||||
|
|
||||||
|
@@ -47,6 +47,27 @@ Creates a size object.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\membersection{wxSize::DecBy}\label{wxsizedecby}
|
||||||
|
|
||||||
|
\func{void}{DecBy}{\param{const wxSize\& }{size}}
|
||||||
|
|
||||||
|
\func{void}{DecBy}{\param{int }{dx}, \param{int }{dy}}
|
||||||
|
|
||||||
|
\func{void}{DecBy}{\param{int }{d}}
|
||||||
|
|
||||||
|
Decreases the size in x- and y- directions
|
||||||
|
|
||||||
|
\begin{enumerate}
|
||||||
|
\item By \arg{size.x} and \arg{size.y} for the first overload
|
||||||
|
\item By \arg{dx} and \arg{dy} for the second one
|
||||||
|
\item By \arg{d} and \arg{d} for the third one
|
||||||
|
\end{enumerate}
|
||||||
|
|
||||||
|
\wxheading{See also}
|
||||||
|
|
||||||
|
\helpref{IncBy}{wxsizeincby}
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxSize::DecTo}\label{wxsizedecto}
|
\membersection{wxSize::DecTo}\label{wxsizedecto}
|
||||||
|
|
||||||
\func{void}{DecTo}{\param{const wxSize\& }{size}}
|
\func{void}{DecTo}{\param{const wxSize\& }{size}}
|
||||||
@@ -85,6 +106,26 @@ Gets the width member.
|
|||||||
Gets the height member.
|
Gets the height member.
|
||||||
|
|
||||||
|
|
||||||
|
\membersection{wxSize::IncBy}\label{wxsizeincby}
|
||||||
|
|
||||||
|
\func{void}{IncBy}{\param{const wxSize\& }{size}}
|
||||||
|
|
||||||
|
\func{void}{IncBy}{\param{int }{dx}, \param{int }{dy}}
|
||||||
|
|
||||||
|
\func{void}{IncBy}{\param{int }{d}}
|
||||||
|
|
||||||
|
Increases the size in x- and y- directions
|
||||||
|
|
||||||
|
\begin{enumerate}
|
||||||
|
\item By \arg{size.x} and \arg{size.y} for the first overload
|
||||||
|
\item By \arg{dx} and \arg{dy} for the second one
|
||||||
|
\item By \arg{d} and \arg{d} for the third one
|
||||||
|
\end{enumerate}
|
||||||
|
|
||||||
|
\wxheading{See also}
|
||||||
|
|
||||||
|
\helpref{DecBy}{wxsizedecby}
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxSize::IncTo}\label{wxsizeincto}
|
\membersection{wxSize::IncTo}\label{wxsizeincto}
|
||||||
|
|
||||||
|
@@ -229,6 +229,15 @@ public:
|
|||||||
void DecTo(const wxSize& sz)
|
void DecTo(const wxSize& sz)
|
||||||
{ if ( sz.x < x ) x = sz.x; if ( sz.y < y ) y = sz.y; }
|
{ if ( sz.x < x ) x = sz.x; if ( sz.y < y ) y = sz.y; }
|
||||||
|
|
||||||
|
void IncBy(int dx, int dy) { x += dx; y += dy; }
|
||||||
|
void IncBy(const wxSize& sz) { IncBy(sz.x, sz.y); }
|
||||||
|
void IncBy(int d) { IncBy(d, d); }
|
||||||
|
|
||||||
|
void DecBy(int dx, int dy) { IncBy(-dx, -dy); }
|
||||||
|
void DecBy(const wxSize& sz) { DecBy(sz.x, sz.y); }
|
||||||
|
void DecBy(int d) { DecBy(d, d); }
|
||||||
|
|
||||||
|
|
||||||
void Scale(float xscale, float yscale)
|
void Scale(float xscale, float yscale)
|
||||||
{ x = (int)(x*xscale); y = (int)(y*yscale); }
|
{ x = (int)(x*xscale); y = (int)(y*yscale); }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user