+// Uses the theme to draw the border and fill for something like a wxTextCtrl
+void wxRendererXP::DrawTextCtrl(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags)
+{
+ wxUxThemeHandle hTheme(win, L"EDIT");
+ if ( !hTheme )
+ {
+ m_rendererNative.DrawTextCtrl(win,dc,rect,flags);
+ return;
+ }
+
+ wxColour fill;
+ wxColour bdr;
+ COLORREF cref;
+
+ wxUxThemeEngine::Get()->GetThemeColor(hTheme, EP_EDITTEXT,
+ ETS_NORMAL, TMT_FILLCOLOR, &cref);
+ fill = wxRGBToColour(cref);
+
+ int etsState;
+ if ( flags & wxCONTROL_DISABLED )
+ etsState = ETS_DISABLED;
+ else
+ etsState = ETS_NORMAL;
+
+ wxUxThemeEngine::Get()->GetThemeColor(hTheme, EP_EDITTEXT,
+ etsState, TMT_BORDERCOLOR, &cref);
+ bdr = wxRGBToColour(cref);
+
+ dc.SetPen( bdr );
+ dc.SetBrush( fill );
+ dc.DrawRectangle(rect);
+}
+