+void
+wxRendererXP::DrawTitleBarBitmap(wxWindow *win,
+ wxDC& dc,
+ const wxRect& rect,
+ wxTitleBarButton button,
+ int flags)
+{
+ wxUxThemeHandle hTheme(win, L"WINDOW");
+ if ( !hTheme )
+ {
+ m_rendererNative.DrawTitleBarBitmap(win, dc, rect, button, flags);
+ return;
+ }
+
+ int part;
+ switch ( button )
+ {
+ case wxTITLEBAR_BUTTON_CLOSE:
+ part = WP_CLOSEBUTTON;
+ break;
+
+ case wxTITLEBAR_BUTTON_MAXIMIZE:
+ part = WP_MAXBUTTON;
+ break;
+
+ case wxTITLEBAR_BUTTON_ICONIZE:
+ part = WP_MINBUTTON;
+ break;
+
+ case wxTITLEBAR_BUTTON_RESTORE:
+ part = WP_RESTOREBUTTON;
+ break;
+
+ case wxTITLEBAR_BUTTON_HELP:
+ part = WP_HELPBUTTON;
+ break;
+
+ default:
+ wxFAIL_MSG( "unsupported title bar button" );
+ return;
+ }
+
+ DoDrawButtonLike(hTheme, part, dc, rect, flags);
+}
+
+// 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);