1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxSize documentation
7 %% Copyright: (c) wxTeam
8 %% License: wxWindows license
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11 \section{\class{wxSize
}}\label{wxsize
}
13 A
{\bf wxSize
} is a useful data structure for graphics operations.
14 It simply contains integer
{\it width
} and
{\it height
} members.
16 wxSize is used throughout wxWidgets as well as wxPoint which, although almost
17 equivalent to wxSize, has a different meaning: wxPoint represents a position
18 while wxSize - the size.
20 \pythonnote{wxPython defines aliases for the
{\tt x
} and
{\tt y
} members
21 named
{\tt width
} and
{\tt height
} since it makes much more sense for
25 \wxheading{Derived from
}
29 \wxheading{Include files
}
35 \helpref{wxPoint
}{wxpoint
},
\helpref{wxRealPoint
}{wxrealpoint
}
37 \latexignore{\rtfignore{\wxheading{Members
}}}
40 \membersection{wxSize::wxSize
}\label{wxsizector
}
42 \func{}{wxSize
}{\void}
44 \func{}{wxSize
}{\param{int
}{ width
},
\param{int
}{ height
}}
46 Creates a size object.
50 \membersection{wxSize::DecBy
}\label{wxsizedecby
}
52 \func{void
}{DecBy
}{\param{const wxSize\&
}{size
}}
54 \func{void
}{DecBy
}{\param{int
}{dx
},
\param{int
}{dy
}}
56 \func{void
}{DecBy
}{\param{int
}{d
}}
58 Decreases the size in x- and y- directions
61 \item By
\arg{size.x
} and
\arg{size.y
} for the first overload
62 \item By
\arg{dx
} and
\arg{dy
} for the second one
63 \item By
\arg{d
} and
\arg{d
} for the third one
68 \helpref{IncBy
}{wxsizeincby
}
71 \membersection{wxSize::DecTo
}\label{wxsizedecto
}
73 \func{void
}{DecTo
}{\param{const wxSize\&
}{size
}}
75 Decrements this object so that both of its dimensions are not greater than the
76 corresponding dimensions of the
\arg{size
}.
80 \helpref{IncTo
}{wxsizeincto
}
83 \membersection{wxSize::IsFullySpecified
}\label{wxsizeisfullyspecified
}
85 \constfunc{bool
}{IsFullySpecified
}{\void}
87 Returns
\true if neither of the size object components is equal to $-
1$, which
88 is used as default for the size values in wxWidgets (hence the predefined
89 \texttt{wxDefaultSize
} has both of its components equal to $-
1$).
91 This method is typically used before calling
92 \helpref{SetDefaults
}{wxsizesetdefaults
}.
95 \membersection{wxSize::GetWidth
}\label{wxsizegetwidth
}
97 \constfunc{int
}{GetWidth
}{\void}
99 Gets the width member.
102 \membersection{wxSize::GetHeight
}\label{wxsizegetheight
}
104 \constfunc{int
}{GetHeight
}{\void}
106 Gets the height member.
109 \membersection{wxSize::IncBy
}\label{wxsizeincby
}
111 \func{void
}{IncBy
}{\param{const wxSize\&
}{size
}}
113 \func{void
}{IncBy
}{\param{int
}{dx
},
\param{int
}{dy
}}
115 \func{void
}{IncBy
}{\param{int
}{d
}}
117 Increases the size in x- and y- directions
120 \item By
\arg{size.x
} and
\arg{size.y
} for the first overload
121 \item By
\arg{dx
} and
\arg{dy
} for the second one
122 \item By
\arg{d
} and
\arg{d
} for the third one
127 \helpref{DecBy
}{wxsizedecby
}
130 \membersection{wxSize::IncTo
}\label{wxsizeincto
}
132 \func{void
}{IncTo
}{\param{const wxSize\&
}{size
}}
134 Increments this object so that both of its dimensions are not less than the
135 corresponding dimensions of the
\arg{size
}.
139 \helpref{DecTo
}{wxsizedecto
}
143 \membersection{wxSize::Scale
}\label{wxsizescale
}
145 \func{void
}{Scale
}{\param{float
}{ xscale
},
\param{float
}{ yscale
}}
147 Scales the dimensions of this object by the given factors.
148 If you want to scale both dimensions by the same factor you can also use
149 the
\helpref{operator *=
}{wxsizeoperators
}
153 \membersection{wxSize::Set
}\label{wxsizeset
}
155 \func{void
}{Set
}{\param{int
}{ width
},
\param{int
}{ height
}}
157 Sets the width and height members.
160 \membersection{wxSize::SetDefaults
}\label{wxsizesetdefaults
}
162 \func{void
}{SetDefaults
}{\param{const wxSize\&
}{sizeDefault
}}
164 Combine this size object with another one replacing the default (i.e. equal
165 to $-
1$) components of this object with those of the other. It is typically
168 if ( !size.IsFullySpecified() )
170 size.SetDefaults(GetDefaultSize());
176 \helpref{IsFullySpecified
}{wxsizeisfullyspecified
}
179 \membersection{wxSize::SetHeight
}\label{wxsizesetheight
}
181 \func{void
}{SetHeight
}{\param{int
}{ height
}}
186 \membersection{wxSize::SetWidth
}\label{wxsizesetwidth
}
188 \func{void
}{SetWidth
}{\param{int
}{ width
}}
193 \membersection{Operators
}\label{wxsizeoperators
}
195 \func{void
}{operator $=$
}{\param{const wxSize\&
}{sz
}}
200 \func{bool
}{operator $==$
}{\param{const wxSize\&
}{sz
}}
202 \func{bool
}{operator $!=$
}{\param{const wxSize\&
}{sz
}}
204 \func{wxSize
}{operator $+$
}{\param{const wxSize\&
}{sz
}}
206 \func{wxSize
}{operator $-$
}{\param{const wxSize\&
}{sz
}}
208 \func{wxSize\&
}{operator $+=$
}{\param{const wxSize\&
}{sz
}}
210 \func{wxSize\&
}{operator $-=$
}{\param{const wxSize\&
}{sz
}}
212 Operators for comparison, sum and subtraction between
\helpref{wxSize
}{wxsize
} objects.
215 \func{wxSize
}{operator $/$
}{\param{int
}{factor
}}
217 \func{wxSize
}{operator $*$
}{\param{int
}{factor
}}
219 \func{wxSize\&
}{operator $/=$
}{\param{int
}{factor
}}
221 \func{wxSize\&
}{operator $*=$
}{\param{int
}{factor
}}
223 Operators for division and multiplication between a
\helpref{wxSize
}{wxsize
} object and an integer.