+// ============================================================================
+// wxRendererXP implementation
+// ============================================================================
+
+/* static */
+wxRendererNative& wxRendererXP::Get()
+{
+ static wxRendererXP s_rendererXP;
+
+ return s_rendererXP;
+}
+
+// ----------------------------------------------------------------------------
+// splitter drawing
+// ----------------------------------------------------------------------------
+
+// the width of the sash: this is the same as used by Explorer...
+static const wxCoord SASH_WIDTH = 4;
+
+wxSplitterRenderParams
+wxRendererXP::GetSplitterParams(const wxWindow * win)
+{
+ if (win->GetWindowStyle() & wxSP_NO_XP_THEME)
+ return m_rendererNative.GetSplitterParams(win);
+ else
+ return wxSplitterRenderParams(SASH_WIDTH, 0, false);
+}
+
+void
+wxRendererXP::DrawSplitterBorder(wxWindow * win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags)
+{
+ if (win->GetWindowStyle() & wxSP_NO_XP_THEME)
+ {
+ m_rendererNative.DrawSplitterBorder(win, dc, rect, flags);
+ }
+}
+
+void
+wxRendererXP::DrawSplitterSash(wxWindow *win,
+ wxDC& dc,
+ const wxSize& size,
+ wxCoord position,
+ wxOrientation orient,
+ int flags)
+{
+ if ( !win->HasFlag(wxSP_NO_XP_THEME) )
+ {
+ wxUxThemeHandle hTheme(win, L"WINDOW");
+ if ( hTheme )
+ {
+ RECT rect;
+ if ( orient == wxVERTICAL )
+ {
+ rect.left = position;
+ rect.right = position + SASH_WIDTH;
+ rect.top = 0;
+ rect.bottom = size.y;
+ }
+ else // wxHORIZONTAL
+ {
+ rect.left = 0;
+ rect.right = size.x;
+ rect.top = position;
+ rect.bottom = position + SASH_WIDTH;
+ }
+
+ wxUxThemeEngine::Get()->DrawThemeBackground
+ (
+ (WXHTHEME)hTheme,
+ dc.GetHDC(),
+ 29, // WP_DIALOG: dlg background
+ 0, // no particular state
+ &rect,
+ NULL
+ );
+ return;
+ }
+ }
+
+ m_rendererNative.DrawSplitterSash(win, dc, size, position, orient, flags);
+}
+