added and documented wxSize::IsFullySpecified() and SetDefaults()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26614 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -26,6 +26,7 @@ None
|
|||||||
|
|
||||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxSize::wxSize}
|
\membersection{wxSize::wxSize}
|
||||||
|
|
||||||
\func{}{wxSize}{\void}
|
\func{}{wxSize}{\void}
|
||||||
@@ -35,6 +36,7 @@ None
|
|||||||
Creates a size object.
|
Creates a size object.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxSize::DecTo}\label{wxsizedecto}
|
\membersection{wxSize::DecTo}\label{wxsizedecto}
|
||||||
|
|
||||||
\func{wxSize\&}{DecTo}{\param{const wxSize\& }{size}}
|
\func{wxSize\&}{DecTo}{\param{const wxSize\& }{size}}
|
||||||
@@ -47,12 +49,25 @@ corresponding dimensions of the \arg{size}.
|
|||||||
\helpref{IncTo}{wxsizeincto}
|
\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}
|
\membersection{wxSize::GetWidth}\label{wxsizegetwidth}
|
||||||
|
|
||||||
\constfunc{int}{GetWidth}{\void}
|
\constfunc{int}{GetWidth}{\void}
|
||||||
|
|
||||||
Gets the width member.
|
Gets the width member.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxSize::GetHeight}\label{wxsizegetheight}
|
\membersection{wxSize::GetHeight}\label{wxsizegetheight}
|
||||||
|
|
||||||
\constfunc{int}{GetHeight}{\void}
|
\constfunc{int}{GetHeight}{\void}
|
||||||
@@ -60,6 +75,7 @@ Gets the width member.
|
|||||||
Gets the height member.
|
Gets the height member.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxSize::IncTo}\label{wxsizeincto}
|
\membersection{wxSize::IncTo}\label{wxsizeincto}
|
||||||
|
|
||||||
\func{wxSize\&}{IncTo}{\param{const wxSize\& }{size}}
|
\func{wxSize\&}{IncTo}{\param{const wxSize\& }{size}}
|
||||||
@@ -72,24 +88,47 @@ corresponding dimensions of the \arg{size}.
|
|||||||
\helpref{DecTo}{wxsizedecto}
|
\helpref{DecTo}{wxsizedecto}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\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}}
|
||||||
|
|
||||||
Sets the width and height members.
|
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}
|
\membersection{wxSize::SetHeight}\label{wxsizesetheight}
|
||||||
|
|
||||||
\func{void}{SetHeight}{\param{int}{ height}}
|
\func{void}{SetHeight}{\param{int}{ height}}
|
||||||
|
|
||||||
Sets the height.
|
Sets the height.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxSize::SetWidth}\label{wxsizesetwidth}
|
\membersection{wxSize::SetWidth}\label{wxsizesetwidth}
|
||||||
|
|
||||||
\func{void}{SetWidth}{\param{int}{ width}}
|
\func{void}{SetWidth}{\param{int}{ width}}
|
||||||
|
|
||||||
Sets the width.
|
Sets the width.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxSize::operator $=$}
|
\membersection{wxSize::operator $=$}
|
||||||
|
|
||||||
\func{void}{operator $=$}{\param{const wxSize\& }{sz}}
|
\func{void}{operator $=$}{\param{const wxSize\& }{sz}}
|
||||||
|
@@ -228,6 +228,18 @@ public:
|
|||||||
int GetWidth() const { return x; }
|
int GetWidth() const { return x; }
|
||||||
int GetHeight() const { return y; }
|
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
|
// compatibility
|
||||||
int GetX() const { return x; }
|
int GetX() const { return x; }
|
||||||
int GetY() const { return y; }
|
int GetY() const { return y; }
|
||||||
|
Reference in New Issue
Block a user