added IsFalse() to simplify code doing HasOption(very-long-option-name) && !GetOptionInt(the-same-very-long-option-name) elsewhere

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2005-03-23 20:48:50 +00:00
parent 9ddb394878
commit 8de6b9bbb8
2 changed files with 15 additions and 0 deletions

View File

@ -125,6 +125,16 @@ Returns \true if the given option is present. The function is case-insensitive t
\helpref{wxSystemOptions::GetOptionInt}{wxsystemoptionsgetoptionint} \helpref{wxSystemOptions::GetOptionInt}{wxsystemoptionsgetoptionint}
\membersection{wxSystemOptions::IsFalse}\label{wxsystemoptionsisfalse}
\constfunc{bool}{IsFalse}{\param{const wxString\&}{ name}}
Returns \true if the option with the given \arg{name} had been set to $0$
value. This is mostly useful for boolean options for which you can't use
\texttt{GetOptionInt(name) == 0} as this would also be true if the option
hadn't been set at all.
\membersection{wxSystemOptions::SetOption}\label{wxsystemoptionssetoption} \membersection{wxSystemOptions::SetOption}\label{wxsystemoptionssetoption}
\func{void}{SetOption}{\param{const wxString\&}{ name}, \param{const wxString\&}{ value}} \func{void}{SetOption}{\param{const wxString\&}{ name}, \param{const wxString\&}{ value}}

View File

@ -34,6 +34,11 @@ public:
static wxString GetOption(const wxString& name); static wxString GetOption(const wxString& name);
static int GetOptionInt(const wxString& name); static int GetOptionInt(const wxString& name);
static bool HasOption(const wxString& name); static bool HasOption(const wxString& name);
static bool IsFalse(const wxString& name)
{
return HasOption(name) && GetOptionInt(name) == 0;
}
}; };
#if !wxUSE_SYSTEM_OPTIONS #if !wxUSE_SYSTEM_OPTIONS