]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't interpret '&' specially in wxTextWrapper.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 18 Oct 2011 21:56:36 +0000 (21:56 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 18 Oct 2011 21:56:36 +0000 (21:56 +0000)
wxTextWrapper is used for the multiline text for which it doesn't make sense
to use mnemonics so don't interpret '&' specially in the text used with it.

Doing this also allows to remove the hack used in wxDialog::CreateTextSizer()
to deal with it that was used so far.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/textwrapper.h
src/common/dlgcmn.cpp

index bf4991f7f45aa912af853d079486132b07903e79..8fe58fb13a6aead2489606ab39c99b14fc5f1589 100644 (file)
@@ -98,7 +98,9 @@ public:
 protected:
     virtual wxWindow *OnCreateLine(const wxString& line)
     {
-        return new wxStaticText(m_win, wxID_ANY, line);
+        wxStaticText* const win = new wxStaticText(m_win, wxID_ANY, "");
+        win->SetLabelText(line);
+        return win;
     }
 
     virtual void OnOutputLine(const wxString& line)
index 6b70e66e97ab4c113ce7392a4cf0ac41da81e175..d95dafd786f832ecaee0351a8096f8840e7a2c0e 100644 (file)
@@ -224,13 +224,7 @@ wxSizer *wxDialogBase::CreateTextSizer(const wxString& message,
         widthMax = wxSystemSettings::GetMetric( wxSYS_SCREEN_X ) - 25;
     }
 
-    // '&' is used as accel mnemonic prefix in the wxWidgets controls but in
-    // the static messages created by CreateTextSizer() (used by wxMessageBox,
-    // for example), we don't want this special meaning, so we need to quote it
-    wxString text(message);
-    text.Replace(wxT("&"), wxT("&&"));
-
-    return wrapper.CreateSizer(text, widthMax);
+    return wrapper.CreateSizer(message, widthMax);
 }
 
 #endif // wxUSE_STATTEXT