X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/42c097b83e20818d1894e9cbf3995d2752a4ba16..679918f93d18cff9fc833be3e4d34b4e57513aac:/src/msw/msgdlg.cpp diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index 829b4a855e..a4c79cc53a 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -201,9 +201,9 @@ void wxMessageDialog::ReplaceStaticWithEdit() // find the static control to replace: normally there are two of them, the // icon and the text itself so search for all of them and ignore the icon // ones - HWND hwndStatic = ::FindWindowEx(GetHwnd(), NULL, _T("STATIC"), NULL); + HWND hwndStatic = ::FindWindowEx(GetHwnd(), NULL, wxT("STATIC"), NULL); if ( ::GetWindowLong(hwndStatic, GWL_STYLE) & SS_ICON ) - hwndStatic = ::FindWindowEx(GetHwnd(), hwndStatic, _T("STATIC"), NULL); + hwndStatic = ::FindWindowEx(GetHwnd(), hwndStatic, wxT("STATIC"), NULL); if ( !hwndStatic ) { @@ -246,11 +246,12 @@ void wxMessageDialog::ReplaceStaticWithEdit() // ignored by the static control but result in extra lines and hence extra // scrollbar position in the edit one wxString text(wxGetWindowText(hwndStatic)); - for ( wxString::iterator i = text.end() - 1; i != text.begin(); --i ) + for ( wxString::reverse_iterator i = text.rbegin(); i != text.rend(); ++i ) { if ( *i != '\n' ) { - text.erase(i + 1, text.end()); + // found last non-newline char, remove everything after it and stop + text.erase(i.base() + 1, text.end()); break; } } @@ -258,7 +259,7 @@ void wxMessageDialog::ReplaceStaticWithEdit() // do create the new control HWND hwndEdit = ::CreateWindow ( - _T("EDIT"), + wxT("EDIT"), wxTextBuffer::Translate(text).wx_str(), WS_CHILD | WS_VSCROLL | WS_VISIBLE | ES_MULTILINE | ES_READONLY | ES_AUTOVSCROLL, @@ -266,7 +267,7 @@ void wxMessageDialog::ReplaceStaticWithEdit() rc.right - rc.left, rc.bottom - rc.top, GetHwnd(), NULL, - wxhInstance, + wxGetInstance(), NULL ); @@ -506,6 +507,7 @@ int wxMessageDialog::ShowModal() } } + // set the icon style if (wxStyle & wxICON_EXCLAMATION) msStyle |= MB_ICONEXCLAMATION; else if (wxStyle & wxICON_HAND) @@ -514,6 +516,8 @@ int wxMessageDialog::ShowModal() msStyle |= MB_ICONINFORMATION; else if (wxStyle & wxICON_QUESTION) msStyle |= MB_ICONQUESTION; + else if (!(wxStyle & wxICON_NONE)) + msStyle |= wxStyle & wxYES ? MB_ICONQUESTION : MB_ICONINFORMATION; if ( wxStyle & wxSTAY_ON_TOP ) msStyle |= MB_TOPMOST; @@ -557,7 +561,7 @@ int wxMessageDialog::ShowModal() switch (msAns) { default: - wxFAIL_MSG(_T("unexpected ::MessageBox() return code")); + wxFAIL_MSG(wxT("unexpected ::MessageBox() return code")); // fall through case IDCANCEL: