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{wxCore
}{librarieslist
}
39 \helpref{wxPoint
}{wxpoint
},
\helpref{wxRealPoint
}{wxrealpoint
}
41 \latexignore{\rtfignore{\wxheading{Members
}}}
44 \membersection{wxSize::wxSize
}\label{wxsizector
}
46 \func{}{wxSize
}{\void}
48 \func{}{wxSize
}{\param{int
}{ width
},
\param{int
}{ height
}}
50 Creates a size object.
54 \membersection{wxSize::DecBy
}\label{wxsizedecby
}
56 \func{void
}{DecBy
}{\param{const wxSize\&
}{size
}}
58 \func{void
}{DecBy
}{\param{int
}{dx
},
\param{int
}{dy
}}
60 \func{void
}{DecBy
}{\param{int
}{d
}}
62 Decreases the size in x- and y- directions
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
72 \helpref{IncBy
}{wxsizeincby
}
75 \membersection{wxSize::DecTo
}\label{wxsizedecto
}
77 \func{void
}{DecTo
}{\param{const wxSize\&
}{size
}}
79 Decrements this object so that both of its dimensions are not greater than the
80 corresponding dimensions of the
\arg{size
}.
84 \helpref{IncTo
}{wxsizeincto
}
87 \membersection{wxSize::IsFullySpecified
}\label{wxsizeisfullyspecified
}
89 \constfunc{bool
}{IsFullySpecified
}{\void}
91 Returns
\true if neither of the size object components is equal to $-
1$, which
92 is used as default for the size values in wxWidgets (hence the predefined
93 \texttt{wxDefaultSize
} has both of its components equal to $-
1$).
95 This method is typically used before calling
96 \helpref{SetDefaults
}{wxsizesetdefaults
}.
99 \membersection{wxSize::GetWidth
}\label{wxsizegetwidth
}
101 \constfunc{int
}{GetWidth
}{\void}
103 Gets the width member.
106 \membersection{wxSize::GetHeight
}\label{wxsizegetheight
}
108 \constfunc{int
}{GetHeight
}{\void}
110 Gets the height member.
113 \membersection{wxSize::IncBy
}\label{wxsizeincby
}
115 \func{void
}{IncBy
}{\param{const wxSize\&
}{size
}}
117 \func{void
}{IncBy
}{\param{int
}{dx
},
\param{int
}{dy
}}
119 \func{void
}{IncBy
}{\param{int
}{d
}}
121 Increases the size in x- and y- directions
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
131 \helpref{DecBy
}{wxsizedecby
}
134 \membersection{wxSize::IncTo
}\label{wxsizeincto
}
136 \func{void
}{IncTo
}{\param{const wxSize\&
}{size
}}
138 Increments this object so that both of its dimensions are not less than the
139 corresponding dimensions of the
\arg{size
}.
143 \helpref{DecTo
}{wxsizedecto
}
147 \membersection{wxSize::Scale
}\label{wxsizescale
}
149 \func{wxSize\&
}{Scale
}{\param{float
}{ xscale
},
\param{float
}{ yscale
}}
151 Scales the dimensions of this object by the given factors.
152 If you want to scale both dimensions by the same factor you can also use
153 the
\helpref{operator *=
}{wxsizeoperators
}
155 Returns a reference to this object (so that you can concatenate other operations in the same line).
158 \membersection{wxSize::Set
}\label{wxsizeset
}
160 \func{void
}{Set
}{\param{int
}{ width
},
\param{int
}{ height
}}
162 Sets the width and height members.
165 \membersection{wxSize::SetDefaults
}\label{wxsizesetdefaults
}
167 \func{void
}{SetDefaults
}{\param{const wxSize\&
}{sizeDefault
}}
169 Combine this size object with another one replacing the default (i.e. equal
170 to $-
1$) components of this object with those of the other. It is typically
173 if ( !size.IsFullySpecified() )
175 size.SetDefaults(GetDefaultSize());
181 \helpref{IsFullySpecified
}{wxsizeisfullyspecified
}
184 \membersection{wxSize::SetHeight
}\label{wxsizesetheight
}
186 \func{void
}{SetHeight
}{\param{int
}{ height
}}
191 \membersection{wxSize::SetWidth
}\label{wxsizesetwidth
}
193 \func{void
}{SetWidth
}{\param{int
}{ width
}}
198 \membersection{Operators
}\label{wxsizeoperators
}
200 \func{void
}{operator $=$
}{\param{const wxSize\&
}{sz
}}
205 \func{bool
}{operator $==$
}{\param{const wxSize\&
}{s1
},
\param{const wxSize\&
}{s2
}}
207 \func{bool
}{operator $!=$
}{\param{const wxSize\&
}{s1
},
\param{const wxSize\&
}{s2
}}
209 \func{wxSize
}{operator $+$
}{\param{const wxSize\&
}{s1
},
\param{const wxSize\&
}{s2
}}
211 \func{wxSize
}{operator $-$
}{\param{const wxSize\&
}{s1
},
\param{const wxSize\&
}{s2
}}
213 \func{wxSize\&
}{operator $+=$
}{\param{const wxSize\&
}{sz
}}
215 \func{wxSize\&
}{operator $-=$
}{\param{const wxSize\&
}{sz
}}
217 Operators for comparison, sum and subtraction between
\helpref{wxSize
}{wxsize
} objects.
220 \func{wxSize
}{operator $/$
}{\param{const wxSize\&
}{sz
},
\param{int
}{factor
}}
222 \func{wxSize
}{operator $*$
}{\param{const wxSize\&
}{sz
},
\param{int
}{factor
}}
224 \func{wxSize
}{operator $*$
}{\param{int
}{factor
},
\param{const wxSize\&
}{sz
}}
226 \func{wxSize\&
}{operator $/=$
}{\param{int
}{factor
}}
228 \func{wxSize\&
}{operator $*=$
}{\param{int
}{factor
}}
230 Operators for division and multiplication between a
\helpref{wxSize
}{wxsize
} object and an integer.