]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/size.tex
Added EVT_MOVE_START, EVT_MOVE_END (wxMSW only for now)
[wxWidgets.git] / docs / latex / wx / size.tex
... / ...
CommitLineData
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: size.tex
3%% Purpose: wxSize documentation
4%% Author: wxTeam
5%% Created:
6%% RCS-ID: $Id$
7%% Copyright: (c) wxTeam
8%% License: wxWindows license
9%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
11\section{\class{wxSize}}\label{wxsize}
12
13A {\bf wxSize} is a useful data structure for graphics operations.
14It simply contains integer {\it width} and {\it height} members.
15
16wxSize is used throughout wxWidgets as well as wxPoint which, although almost
17equivalent to wxSize, has a different meaning: wxPoint represents a position
18while wxSize - the size.
19
20\pythonnote{wxPython defines aliases for the {\tt x} and {\tt y} members
21named {\tt width} and {\tt height} since it makes much more sense for
22sizes.
23}
24
25\wxheading{Derived from}
26
27None
28
29\wxheading{Include files}
30
31<wx/gdicmn.h>
32
33\wxheading{Library}
34
35\helpref{wxCore}{librarieslist}
36
37\wxheading{See also}
38
39\helpref{wxPoint}{wxpoint}, \helpref{wxRealPoint}{wxrealpoint}
40
41\latexignore{\rtfignore{\wxheading{Members}}}
42
43
44\membersection{wxSize::wxSize}\label{wxsizector}
45
46\func{}{wxSize}{\void}
47
48\func{}{wxSize}{\param{int}{ width}, \param{int}{ height}}
49
50Creates a size object.
51
52
53
54\membersection{wxSize::DecBy}\label{wxsizedecby}
55
56\func{void}{DecBy}{\param{const wxSize\& }{size}}
57
58\func{void}{DecBy}{\param{int }{dx}, \param{int }{dy}}
59
60\func{void}{DecBy}{\param{int }{d}}
61
62Decreases the size in x- and y- directions
63
64\begin{enumerate}
65 \item By \arg{size.x} and \arg{size.y} for the first overload
66 \item By \arg{dx} and \arg{dy} for the second one
67 \item By \arg{d} and \arg{d} for the third one
68\end{enumerate}
69
70\wxheading{See also}
71
72\helpref{IncBy}{wxsizeincby}
73
74
75\membersection{wxSize::DecTo}\label{wxsizedecto}
76
77\func{void}{DecTo}{\param{const wxSize\& }{size}}
78
79Decrements this object so that both of its dimensions are not greater than the
80corresponding dimensions of the \arg{size}.
81
82\wxheading{See also}
83
84\helpref{IncTo}{wxsizeincto}
85
86
87\membersection{wxSize::IsFullySpecified}\label{wxsizeisfullyspecified}
88
89\constfunc{bool}{IsFullySpecified}{\void}
90
91Returns \true if neither of the size object components is equal to $-1$, which
92is used as default for the size values in wxWidgets (hence the predefined
93\texttt{wxDefaultSize} has both of its components equal to $-1$).
94
95This method is typically used before calling
96\helpref{SetDefaults}{wxsizesetdefaults}.
97
98
99\membersection{wxSize::GetWidth}\label{wxsizegetwidth}
100
101\constfunc{int}{GetWidth}{\void}
102
103Gets the width member.
104
105
106\membersection{wxSize::GetHeight}\label{wxsizegetheight}
107
108\constfunc{int}{GetHeight}{\void}
109
110Gets the height member.
111
112
113\membersection{wxSize::IncBy}\label{wxsizeincby}
114
115\func{void}{IncBy}{\param{const wxSize\& }{size}}
116
117\func{void}{IncBy}{\param{int }{dx}, \param{int }{dy}}
118
119\func{void}{IncBy}{\param{int }{d}}
120
121Increases the size in x- and y- directions
122
123\begin{enumerate}
124 \item By \arg{size.x} and \arg{size.y} for the first overload
125 \item By \arg{dx} and \arg{dy} for the second one
126 \item By \arg{d} and \arg{d} for the third one
127\end{enumerate}
128
129\wxheading{See also}
130
131\helpref{DecBy}{wxsizedecby}
132
133
134\membersection{wxSize::IncTo}\label{wxsizeincto}
135
136\func{void}{IncTo}{\param{const wxSize\& }{size}}
137
138Increments this object so that both of its dimensions are not less than the
139corresponding dimensions of the \arg{size}.
140
141\wxheading{See also}
142
143\helpref{DecTo}{wxsizedecto}
144
145
146
147\membersection{wxSize::Scale}\label{wxsizescale}
148
149\func{wxSize\&}{Scale}{\param{float}{ xscale}, \param{float}{ yscale}}
150
151Scales the dimensions of this object by the given factors.
152If you want to scale both dimensions by the same factor you can also use
153the \helpref{operator *=}{wxsizeoperators}
154
155Returns a reference to this object (so that you can concatenate other operations in the same line).
156
157
158\membersection{wxSize::Set}\label{wxsizeset}
159
160\func{void}{Set}{\param{int}{ width}, \param{int}{ height}}
161
162Sets the width and height members.
163
164
165\membersection{wxSize::SetDefaults}\label{wxsizesetdefaults}
166
167\func{void}{SetDefaults}{\param{const wxSize\& }{sizeDefault}}
168
169Combine this size object with another one replacing the default (i.e. equal
170to $-1$) components of this object with those of the other. It is typically
171used like this:
172\begin{verbatim}
173 if ( !size.IsFullySpecified() )
174 {
175 size.SetDefaults(GetDefaultSize());
176 }
177\end{verbatim}
178
179\wxheading{See also}
180
181\helpref{IsFullySpecified}{wxsizeisfullyspecified}
182
183
184\membersection{wxSize::SetHeight}\label{wxsizesetheight}
185
186\func{void}{SetHeight}{\param{int}{ height}}
187
188Sets the height.
189
190
191\membersection{wxSize::SetWidth}\label{wxsizesetwidth}
192
193\func{void}{SetWidth}{\param{int}{ width}}
194
195Sets the width.
196
197
198\membersection{Operators}\label{wxsizeoperators}
199
200\func{void}{operator $=$}{\param{const wxSize\& }{sz}}
201
202Assignment operator.
203
204
205\func{bool}{operator $==$}{\param{const wxSize\& }{s1}, \param{const wxSize\& }{s2}}
206
207\func{bool}{operator $!=$}{\param{const wxSize\& }{s1}, \param{const wxSize\& }{s2}}
208
209\func{wxSize}{operator $+$}{\param{const wxSize\& }{s1}, \param{const wxSize\& }{s2}}
210
211\func{wxSize}{operator $-$}{\param{const wxSize\& }{s1}, \param{const wxSize\& }{s2}}
212
213\func{wxSize\&}{operator $+=$}{\param{const wxSize\& }{sz}}
214
215\func{wxSize\&}{operator $-=$}{\param{const wxSize\& }{sz}}
216
217Operators for comparison, sum and subtraction between \helpref{wxSize}{wxsize} objects.
218
219
220\func{wxSize}{operator $/$}{\param{const wxSize\& }{sz}, \param{int }{factor}}
221
222\func{wxSize}{operator $*$}{\param{const wxSize\& }{sz}, \param{int }{factor}}
223
224\func{wxSize}{operator $*$}{\param{int }{factor}, \param{const wxSize\& }{sz}}
225
226\func{wxSize\&}{operator $/=$}{\param{int }{factor}}
227
228\func{wxSize\&}{operator $*=$}{\param{int }{factor}}
229
230Operators for division and multiplication between a \helpref{wxSize}{wxsize} object and an integer.
231