-void wxComboCtrl::OnThemeChange()
-{
- wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
- if ( theme )
- {
- wxUxThemeHandle hTheme(this, L"EDIT");
-
- COLORREF 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
- {
- SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
- SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
- }
-}
-