From: Vadim Zeitlin Date: Sun, 22 Jan 2012 00:58:05 +0000 (+0000) Subject: Create wxStaticText with correct label directly in wxTextSizerWrapper. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7e57c9042af301896a64be7762b430aee29e1165?ds=inline Create wxStaticText with correct label directly in wxTextSizerWrapper. This is shorter and arguably more clear than doing it in two steps as we did before and also works in wxUniv, unlike creating wxStaticText with empty label and setting it later. Closes #13858. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/textwrapper.h b/include/wx/textwrapper.h index 8fe58fb13a..56b7fdc2da 100644 --- a/include/wx/textwrapper.h +++ b/include/wx/textwrapper.h @@ -98,9 +98,8 @@ public: protected: virtual wxWindow *OnCreateLine(const wxString& line) { - wxStaticText* const win = new wxStaticText(m_win, wxID_ANY, ""); - win->SetLabelText(line); - return win; + return new wxStaticText(m_win, wxID_ANY, + wxControl::EscapeMnemonics(line)); } virtual void OnOutputLine(const wxString& line)