Allow passing multi-line strings to wxDC::DrawText(), even under MSW.

Native wxMSW wxDC::DrawText() implementation doesn't support multi-line
strings so use the generic wxDC::DrawLabel() code instead. Drawing multi-line
strings now works at least in wxGTK and wxMSW, to be tested for the other
platforms.

Closes #12239.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65058 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-07-23 23:32:52 +00:00
parent 715e4f7e3e
commit a5bb451448
5 changed files with 28 additions and 2 deletions

View File

@@ -1205,6 +1205,12 @@ void wxDC::DrawLabel(const wxString& text,
yUnderscore = 0;
// split the string into lines and draw each of them separately
//
// NB: while wxDC::DrawText() on some platforms supports drawing multi-line
// strings natively, this is not the case for all of them, notably not
// wxMSW which uses this function for multi-line texts, so we may only
// call DrawText() for single-line strings from here to avoid infinite
// recursion.
wxString curLine;
for ( wxString::const_iterator pc = text.begin(); ; ++pc )
{