]> git.saurik.com Git - wxWidgets.git/commitdiff
fix wxComboCtrl colours under Windows Vista (patch 1710006)
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 11 May 2007 22:54:29 +0000 (22:54 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 11 May 2007 22:54:29 +0000 (22:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45983 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/msw/combo.cpp

index 2ba5b299c29e4dc7d0791b8cefcf4c92e7e79e8f..b2627a29e71ccf59d7e4515304ed8f5ec029eb16 100644 (file)
@@ -175,6 +175,7 @@ wxMSW:
 - Fixed bug in wxThread::Wait() in console applications introduced in 2.8.3
 - Support right-aligned/centered owner drawn items in wxListCtrl (troelsk)
 - Compilation fixed with WXWIN_COMPATIBILITY_2_6==0
+- Fix wxComboCtrl colours under Windows Vista (Kolya Kosenko)
 
 wxGTK:
 
index c02a3ee3453dd70ef7fee9edff26464b455a546c..6ffbb31861b19771f222bdfec4522969bcc0696d 100644 (file)
@@ -219,13 +219,20 @@ void wxComboCtrl::OnThemeChange()
     wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
     if ( theme )
     {
-        wxUxThemeHandle hTheme(this, L"COMBOBOX");
+        wxUxThemeHandle hTheme(this, L"EDIT");
 
         COLORREF col;
-        theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_NORMAL,TMT_FILLCOLOR,&col);
-        SetBackgroundColour(wxRGBToColour(col));
-        theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_NORMAL,TMT_TEXTCOLOR,&col);
-        SetForegroundColour(wxRGBToColour(col));
+        HRESULT hr = theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_NORMAL,TMT_FILLCOLOR,&col);
+        if ( FAILED(hr) )
+            wxLogApiError(_T("GetThemeColor(EDIT, EP_EDITTEXT, ETS_NORMAL, TMT_FILLCOLOR)"), hr);
+        else
+            SetBackgroundColour(wxRGBToColour(col));
+
+        hr = theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_NORMAL,TMT_TEXTCOLOR,&col);
+        if ( FAILED(hr) )
+            wxLogApiError(_T("GetThemeColor(EDIT, EP_EDITTEXT, ETS_NORMAL, TMT_TEXTCOLOR)"), hr);
+        else
+            SetForegroundColour(wxRGBToColour(col));
     }
     else
     {