]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/msgdlg.cpp
Fixed VC6 compilation - wxAny(const wxVariant&) ctor required a specific 'template<>')
[wxWidgets.git] / src / msw / msgdlg.cpp
index 829b4a855e008b321436849616b2dfd19c386a25..feddca75214a8eba9c69b9d419456d73ad06be27 100644 (file)
@@ -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,14 +507,25 @@ int wxMessageDialog::ShowModal()
         }
     }
 
-    if (wxStyle & wxICON_EXCLAMATION)
-        msStyle |= MB_ICONEXCLAMATION;
-    else if (wxStyle & wxICON_HAND)
-        msStyle |= MB_ICONHAND;
-    else if (wxStyle & wxICON_INFORMATION)
-        msStyle |= MB_ICONINFORMATION;
-    else if (wxStyle & wxICON_QUESTION)
-        msStyle |= MB_ICONQUESTION;
+    // set the icon style
+    switch ( GetEffectiveIcon() )
+    {
+        case wxICON_ERROR:
+            msStyle |= MB_ICONHAND;
+            break;
+
+        case wxICON_WARNING:
+            msStyle |= MB_ICONEXCLAMATION;
+            break;
+
+        case wxICON_QUESTION:
+            msStyle |= MB_ICONQUESTION;
+            break;
+
+        case wxICON_INFORMATION:
+            msStyle |= MB_ICONINFORMATION;
+            break;
+    }
 
     if ( wxStyle & wxSTAY_ON_TOP )
         msStyle |= MB_TOPMOST;
@@ -557,7 +569,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: