// 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 )
{
// 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;
}
}
// 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,
rc.right - rc.left, rc.bottom - rc.top,
GetHwnd(),
NULL,
- wxhInstance,
+ wxGetInstance(),
NULL
);
}
}
+ // set the icon style
if (wxStyle & wxICON_EXCLAMATION)
msStyle |= MB_ICONEXCLAMATION;
else if (wxStyle & wxICON_HAND)
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;
switch (msAns)
{
default:
- wxFAIL_MSG(_T("unexpected ::MessageBox() return code"));
+ wxFAIL_MSG(wxT("unexpected ::MessageBox() return code"));
// fall through
case IDCANCEL: