From: Vadim Zeitlin Date: Sun, 24 Sep 2006 11:08:51 +0000 (+0000) Subject: added wxSize::IncBy() and DecBy() methods X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2335974794f0f95aa7a538de40294d34467327a1?hp=57b5c44a4f7686efc98ad3bbec201017fb45e1d3 added wxSize::IncBy() and DecBy() methods git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/changes.txt b/docs/changes.txt index d73fca8361..e073c2e317 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -62,8 +62,11 @@ All: 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 wxSize::IncBy() and DecBy() methods wxMSW: diff --git a/docs/latex/wx/size.tex b/docs/latex/wx/size.tex index cbffe75fd1..36647ec510 100644 --- a/docs/latex/wx/size.tex +++ b/docs/latex/wx/size.tex @@ -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} \func{void}{DecTo}{\param{const wxSize\& }{size}} @@ -85,6 +106,26 @@ Gets the width 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} diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 8a9d5df822..bc3efb2c50 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -229,6 +229,15 @@ public: void DecTo(const wxSize& sz) { 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) { x = (int)(x*xscale); y = (int)(y*yscale); }