]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/ownerdrw.cpp
Fixed toolbar crash for MinGW/Cygwin
[wxWidgets.git] / src / msw / ownerdrw.cpp
index 364d175a89368eac751ee757a602345e760e4c8f..37ea1f8b81a7a34c9b1f5a191961ccdb1a771a18 100644 (file)
@@ -190,12 +190,30 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc,
     }
 
     HFONT hPrevFont = (HFONT) ::SelectObject(hdc, hfont);
-    DrawState(hdc, NULL, NULL,
+   
+
+#if wxUSE_UNICODE_MSLU
+       if ( wxGetOsVersion() == wxWIN95 /* using unicows.dll */ )
+       {
+               // VS: There's yet another bug in MSLU: DrawStateW behaves
+               //     like if it was expecting char*, not wchar_t* input.
+               //     We have to use DrawStateA explicitly.
+               DrawStateA(hdc, NULL, NULL,
+                                  (LPARAM)(const char*)m_strName.mb_str(wxConvLocal),
+                                  m_strName.length(),
+                   x, rc.y, rc.GetWidth(), rc.GetHeight(),
+                   DST_PREFIXTEXT | 
+                                          (st & wxODDisabled ? DSS_DISABLED : 0));
+       }
+       else
+#else
+       DrawState(hdc, NULL, NULL,
               (LPARAM)m_strName.c_str(), m_strName.length(),
               x, rc.y, rc.GetWidth(), rc.GetHeight(),
               DST_PREFIXTEXT | (st & wxODDisabled ? DSS_DISABLED : 0));
+#endif
 
-    if ( !m_strAccel.empty() )
+        if ( !m_strAccel.empty() )
     {
         RECT r;
         r.top = rc.GetTop();