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:
parent
9ddb394878
commit
8de6b9bbb8
@ -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}}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user