\latexignore{\rtfignore{\wxheading{Members}}}
+
\membersection{wxSize::wxSize}
\func{}{wxSize}{\void}
Creates a size object.
+
\membersection{wxSize::DecTo}\label{wxsizedecto}
\func{wxSize\&}{DecTo}{\param{const wxSize\& }{size}}
\helpref{IncTo}{wxsizeincto}
+\membersection{wxSize::IsFullySpecified}\label{wxsizeisfullyspecified}
+
+\constfunc{IsFullySpecified}{\void}
+
+Returns \true if neither of the size object components is equal to $-1$, which
+is used as default for the size values in wxWindows (hence the predefined
+\texttt{wxDefaultSize} has both of its components equal to $-1$).
+
+This method is typically used before calling
+\helpref{SetDefaults}{wxsizesetdefaults}.
+
+
\membersection{wxSize::GetWidth}\label{wxsizegetwidth}
\constfunc{int}{GetWidth}{\void}
Gets the width member.
+
\membersection{wxSize::GetHeight}\label{wxsizegetheight}
\constfunc{int}{GetHeight}{\void}
Gets the height member.
+
\membersection{wxSize::IncTo}\label{wxsizeincto}
\func{wxSize\&}{IncTo}{\param{const wxSize\& }{size}}
\helpref{DecTo}{wxsizedecto}
+
\membersection{wxSize::Set}\label{wxsizeset}
\func{void}{Set}{\param{int}{ width}, \param{int}{ height}}
Sets the width and height members.
+
+\membersection{wxSize::SetDefaults}\label{wxsizesetdefaults}
+
+\func{void}{SetDefaults}{\param{const wxSize\& }{sizeDefault}}
+
+Combine this size object with another one replacing the default (i.e. equal
+to $-1$) components of this object with those of the other. It is typically
+used like this:
+\begin{verbatim}
+ if ( !size.IsFullySpecified() )
+ {
+ size.SetDefaults(GetDefaultSize());
+ }
+\end{verbatim}
+
+\wxheading{See also}
+
+\helpref{IsFullySpecified}{wxsizeisfullyspecified}
+
+
\membersection{wxSize::SetHeight}\label{wxsizesetheight}
\func{void}{SetHeight}{\param{int}{ height}}
Sets the height.
+
\membersection{wxSize::SetWidth}\label{wxsizesetwidth}
\func{void}{SetWidth}{\param{int}{ width}}
Sets the width.
+
\membersection{wxSize::operator $=$}
\func{void}{operator $=$}{\param{const wxSize\& }{sz}}
wxCURSOR_DEFAULT, // standard X11 cursor
#endif
#ifdef __WXMAC__
- wxCURSOR_COPY_ARROW , // MacOS Theme Plus arrow
+ wxCURSOR_COPY_ARROW , // MacOS Theme Plus arrow
#endif
#ifdef __X__
// Not yet implemented for Windows
// FIXME are these really useful? If they're, we should have += &c as well
wxSize operator+(const wxSize& sz) { return wxSize(x + sz.x, y + sz.y); }
wxSize operator-(const wxSize& sz) { return wxSize(x - sz.x, y - sz.y); }
-
+
void IncTo(const wxSize& sz)
{ if ( sz.x > x ) x = sz.x; if ( sz.y > y ) y = sz.y; }
void DecTo(const wxSize& sz)
int GetWidth() const { return x; }
int GetHeight() const { return y; }
+ bool IsFullySpecified() const { return x != -1 && y != -1; }
+
+ // combine this size with the other one replacing the default (i.e. equal
+ // to -1) components of this object with those of the other
+ void SetDefaults(const wxSize& size)
+ {
+ if ( x == -1 )
+ x = size.x;
+ if ( y == -1 )
+ y = size.y;
+ }
+
// compatibility
int GetX() const { return x; }
int GetY() const { return y; }