added SetLabelText() and EscapeMnemonics()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -53,9 +53,6 @@ public:
|
||||
// get the control alignment (left/right/centre, top/bottom/centre)
|
||||
int GetAlignment() const { return m_windowStyle & wxALIGN_MASK; }
|
||||
|
||||
// get just the text of the label, without mnemonic characters ('&')
|
||||
wxString GetLabelText() const { return GetLabelText(GetLabel()); }
|
||||
|
||||
virtual void SetLabel(const wxString& label)
|
||||
{
|
||||
m_labelOrig = label;
|
||||
@@ -72,6 +69,14 @@ public:
|
||||
return m_labelOrig;
|
||||
}
|
||||
|
||||
// get just the text of the label, without mnemonic characters ('&')
|
||||
wxString GetLabelText() const { return GetLabelText(GetLabel()); }
|
||||
|
||||
void SetLabelText(const wxString& text)
|
||||
{
|
||||
return SetLabel(EscapeMnemonics(text));
|
||||
}
|
||||
|
||||
// static utilities:
|
||||
|
||||
// replaces parts of the string with ellipsis if needed
|
||||
@@ -84,6 +89,9 @@ public:
|
||||
// removes the mnemonics characters
|
||||
static wxString RemoveMnemonics(const wxString& str);
|
||||
|
||||
// escapes (by doubling them) the mnemonics
|
||||
static wxString EscapeMnemonics(const wxString& str);
|
||||
|
||||
// return the accel index in the string or -1 if none and puts the modified
|
||||
// string into second parameter if non NULL
|
||||
static int FindAccelIndex(const wxString& label,
|
||||
|
Reference in New Issue
Block a user