added the static function GetLabelText() to wxStaticText which was mentioned in the docs but not implemented; also fixed the return type documented for wxControl::GetLabel*() functions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -35,7 +35,7 @@ Simulates the effect of the user issuing a command to the item. See \helpref{wxC
|
|||||||
|
|
||||||
\membersection{wxControl::GetLabel}\label{wxcontrolgetlabel}
|
\membersection{wxControl::GetLabel}\label{wxcontrolgetlabel}
|
||||||
|
|
||||||
\constfunc{const wxString\&}{GetLabel}{\void}
|
\constfunc{wxString}{GetLabel}{\void}
|
||||||
|
|
||||||
Returns the control's text.
|
Returns the control's text.
|
||||||
|
|
||||||
@@ -48,10 +48,10 @@ undesired.
|
|||||||
|
|
||||||
\constfunc{const wxString\&}{GetLabelText}{\void}
|
\constfunc{const wxString\&}{GetLabelText}{\void}
|
||||||
|
|
||||||
\func{static const wxString\&}{GetLabelText}{\param{const wxString\& }{label}}
|
\func{static wxString}{GetLabelText}{\param{const wxString\& }{label}}
|
||||||
|
|
||||||
Returns the control's label or the given \arg{label} string for the static
|
Returns the control's label, or the given \arg{label} string for the static
|
||||||
version without the mnemonics characters.
|
version, without the mnemonics characters.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxControl::SetLabel}\label{wxcontrolsetlabel}
|
\membersection{wxControl::SetLabel}\label{wxcontrolsetlabel}
|
||||||
|
@@ -106,12 +106,15 @@ label text is needed.
|
|||||||
|
|
||||||
\membersection{wxStaticText::GetLabelText}\label{wxstatictextgetlabeltext}
|
\membersection{wxStaticText::GetLabelText}\label{wxstatictextgetlabeltext}
|
||||||
|
|
||||||
\constfunc{const wxString\&}{GetLabelText}{\void}
|
\constfunc{wxString}{GetLabelText}{\void}
|
||||||
|
|
||||||
Returns the control's label or the given \arg{label} string for the static
|
\func{static wxString}{GetLabelText}{\param{const wxString\& }{label}}
|
||||||
version without the mnemonics characters (if any) and without the markup
|
|
||||||
(if the control has \texttt{wxST\_MARKUP} style).
|
|
||||||
|
|
||||||
|
The first form returns the control's label without the mnemonics characters (if any)
|
||||||
|
and without the markup (if the control has \texttt{wxST\_MARKUP} style).
|
||||||
|
|
||||||
|
The second (static) version returns the given \arg{label} string without the mnemonics
|
||||||
|
characters (if any) and without the markup.
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxStaticText::SetLabel}\label{wxstatictextsetlabel}
|
\membersection{wxStaticText::SetLabel}\label{wxstatictextsetlabel}
|
||||||
|
@@ -58,6 +58,9 @@ public:
|
|||||||
|
|
||||||
// public utilities (symmetric to those in wxControl about mnemonics):
|
// public utilities (symmetric to those in wxControl about mnemonics):
|
||||||
|
|
||||||
|
// get the string without mnemonic characters ('&') and without markup
|
||||||
|
static wxString GetLabelText(const wxString& label);
|
||||||
|
|
||||||
// removes the markup accepted by wxStaticText when wxST_MARKUP is used,
|
// removes the markup accepted by wxStaticText when wxST_MARKUP is used,
|
||||||
// and then returns the cleaned string
|
// and then returns the cleaned string
|
||||||
static wxString RemoveMarkup(const wxString& str);
|
static wxString RemoveMarkup(const wxString& str);
|
||||||
|
@@ -154,6 +154,14 @@ wxString wxStaticTextBase::GetLabelText() const
|
|||||||
return RemoveMnemonics(ret);
|
return RemoveMnemonics(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*static*/
|
||||||
|
wxString wxStaticTextBase::GetLabelText(const wxString& label)
|
||||||
|
{
|
||||||
|
// remove markup
|
||||||
|
wxString ret = RemoveMarkup(label);
|
||||||
|
return RemoveMnemonics(ret);
|
||||||
|
}
|
||||||
|
|
||||||
/*static*/
|
/*static*/
|
||||||
wxString wxStaticTextBase::RemoveMarkup(const wxString& text)
|
wxString wxStaticTextBase::RemoveMarkup(const wxString& text)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user