[ 1518434 ] wxSize::Scale with wxScale and wxPoint operators documented
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40257 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,3 +1,13 @@
|
|||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
%% Name: point.tex
|
||||||
|
%% Purpose: wxPoint documentation
|
||||||
|
%% Author: wxTeam
|
||||||
|
%% Created:
|
||||||
|
%% RCS-ID: $Id$
|
||||||
|
%% Copyright: (c) wxTeam
|
||||||
|
%% License: wxWindows license
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
\section{\class{wxPoint}}\label{wxpoint}
|
\section{\class{wxPoint}}\label{wxpoint}
|
||||||
|
|
||||||
A {\bf wxPoint} is a useful data structure for graphics operations.
|
A {\bf wxPoint} is a useful data structure for graphics operations.
|
||||||
@@ -39,16 +49,35 @@ x member.
|
|||||||
|
|
||||||
y member.
|
y member.
|
||||||
|
|
||||||
\membersection{wxPoint::operator $==$}\label{wxpointequal}
|
\membersection{Operators}\label{wxpointoperators}
|
||||||
|
|
||||||
|
\func{void}{operator $=$}{\param{const wxPoint\& }{pt}}
|
||||||
|
|
||||||
|
Assignment operator.
|
||||||
|
|
||||||
|
|
||||||
\func{bool}{operator $==$}{\param{const wxPoint\& }{pt}}
|
\func{bool}{operator $==$}{\param{const wxPoint\& }{pt}}
|
||||||
|
|
||||||
Equality operator: returns \true if two points are the same.
|
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxPoint::operator $!=$}\label{wxpointnotequal}
|
|
||||||
|
|
||||||
\func{bool}{operator $!=$}{\param{const wxPoint\& }{pt}}
|
\func{bool}{operator $!=$}{\param{const wxPoint\& }{pt}}
|
||||||
|
|
||||||
Inequality operator: returns \true if two points are different.
|
\func{wxPoint}{operator $+$}{\param{const wxPoint\& }{pt}}
|
||||||
|
|
||||||
|
\func{wxPoint}{operator $-$}{\param{const wxPoint\& }{pt}}
|
||||||
|
|
||||||
|
\func{wxPoint\&}{operator $+=$}{\param{const wxPoint\& }{pt}}
|
||||||
|
|
||||||
|
\func{wxPoint\&}{operator $-=$}{\param{const wxPoint\& }{pt}}
|
||||||
|
|
||||||
|
Operators for comparison, sum and subtraction between \helpref{wxPoint}{wxpoint} objects.
|
||||||
|
|
||||||
|
|
||||||
|
\func{wxPoint}{operator $+$}{\param{const wxSize\& }{sz}}
|
||||||
|
|
||||||
|
\func{wxPoint}{operator $-$}{\param{const wxSize\& }{sz}}
|
||||||
|
|
||||||
|
\func{wxPoint\&}{operator $+=$}{\param{const wxSize\& }{sz}}
|
||||||
|
|
||||||
|
\func{wxPoint\&}{operator $-=$}{\param{const wxSize\& }{sz}}
|
||||||
|
|
||||||
|
Operators for sum and subtraction between a \helpref{wxPoint}{wxpoint} object and a
|
||||||
|
\helpref{wxSize}{wxsize} object.
|
||||||
|
@@ -1,3 +1,13 @@
|
|||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
%% Name: size.tex
|
||||||
|
%% Purpose: wxSize documentation
|
||||||
|
%% Author: wxTeam
|
||||||
|
%% Created:
|
||||||
|
%% RCS-ID: $Id$
|
||||||
|
%% Copyright: (c) wxTeam
|
||||||
|
%% License: wxWindows license
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
\section{\class{wxSize}}\label{wxsize}
|
\section{\class{wxSize}}\label{wxsize}
|
||||||
|
|
||||||
A {\bf wxSize} is a useful data structure for graphics operations.
|
A {\bf wxSize} is a useful data structure for graphics operations.
|
||||||
@@ -54,10 +64,10 @@ corresponding dimensions of the \arg{size}.
|
|||||||
\constfunc{bool}{IsFullySpecified}{\void}
|
\constfunc{bool}{IsFullySpecified}{\void}
|
||||||
|
|
||||||
Returns \true if neither of the size object components is equal to $-1$, which
|
Returns \true if neither of the size object components is equal to $-1$, which
|
||||||
is used as default for the size values in wxWidgets (hence the predefined
|
is used as default for the size values in wxWidgets (hence the predefined
|
||||||
\texttt{wxDefaultSize} has both of its components equal to $-1$).
|
\texttt{wxDefaultSize} has both of its components equal to $-1$).
|
||||||
|
|
||||||
This method is typically used before calling
|
This method is typically used before calling
|
||||||
\helpref{SetDefaults}{wxsizesetdefaults}.
|
\helpref{SetDefaults}{wxsizesetdefaults}.
|
||||||
|
|
||||||
|
|
||||||
@@ -89,6 +99,16 @@ corresponding dimensions of the \arg{size}.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\membersection{wxSize::Scale}\label{wxsizescale}
|
||||||
|
|
||||||
|
\func{void}{Scale}{\param{float}{ xscale}, \param{float}{ yscale}}
|
||||||
|
|
||||||
|
Scales the dimensions of this object by the given factors.
|
||||||
|
If you want to scale both dimensions by the same factor you can also use
|
||||||
|
the \helpref{operator *=}{wxsizeoperators}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxSize::Set}\label{wxsizeset}
|
\membersection{wxSize::Set}\label{wxsizeset}
|
||||||
|
|
||||||
\func{void}{Set}{\param{int}{ width}, \param{int}{ height}}
|
\func{void}{Set}{\param{int}{ width}, \param{int}{ height}}
|
||||||
@@ -129,10 +149,34 @@ Sets the height.
|
|||||||
Sets the width.
|
Sets the width.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxSize::operator $=$}\label{wxsizeassign}
|
\membersection{Operators}\label{wxsizeoperators}
|
||||||
|
|
||||||
\func{void}{operator $=$}{\param{const wxSize\& }{sz}}
|
\func{void}{operator $=$}{\param{const wxSize\& }{sz}}
|
||||||
|
|
||||||
Assignment operator.
|
Assignment operator.
|
||||||
|
|
||||||
|
|
||||||
|
\func{bool}{operator $==$}{\param{const wxSize\& }{sz}}
|
||||||
|
|
||||||
|
\func{bool}{operator $!=$}{\param{const wxSize\& }{sz}}
|
||||||
|
|
||||||
|
\func{wxSize}{operator $+$}{\param{const wxSize\& }{sz}}
|
||||||
|
|
||||||
|
\func{wxSize}{operator $-$}{\param{const wxSize\& }{sz}}
|
||||||
|
|
||||||
|
\func{wxSize\&}{operator $+=$}{\param{const wxSize\& }{sz}}
|
||||||
|
|
||||||
|
\func{wxSize\&}{operator $-=$}{\param{const wxSize\& }{sz}}
|
||||||
|
|
||||||
|
Operators for comparison, sum and subtraction between \helpref{wxSize}{wxsize} objects.
|
||||||
|
|
||||||
|
|
||||||
|
\func{wxSize}{operator $/$}{\param{int }{factor}}
|
||||||
|
|
||||||
|
\func{wxSize}{operator $*$}{\param{int }{factor}}
|
||||||
|
|
||||||
|
\func{wxSize\&}{operator $/=$}{\param{int }{factor}}
|
||||||
|
|
||||||
|
\func{wxSize\&}{operator $*=$}{\param{int }{factor}}
|
||||||
|
|
||||||
|
Operators for division and multiplication between a \helpref{wxSize}{wxsize} object and an integer.
|
||||||
|
@@ -229,6 +229,9 @@ 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 Scale(float xscale, float yscale)
|
||||||
|
{ x = (int)(x*xscale); y = (int)(y*yscale); }
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
void Set(int xx, int yy) { x = xx; y = yy; }
|
void Set(int xx, int yy) { x = xx; y = yy; }
|
||||||
void SetWidth(int w) { x = w; }
|
void SetWidth(int w) { x = w; }
|
||||||
|
Reference in New Issue
Block a user