+void
+wxRendererGTK::DrawItemSelectionRect(wxWindow* win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags )
+{
+ GtkWidget *tree = wxGTKPrivate::GetTreeWidget();
+
+ GdkWindow* gdk_window = wxGetGdkWindowForDC(win, dc);
+ wxASSERT_MSG( gdk_window,
+ wxT("cannot use wxRendererNative on wxDC of this type") );
+
+ int x_diff = 0;
+ if (win->GetLayoutDirection() == wxLayout_RightToLeft)
+ x_diff = rect.width;
+
+ GtkStateType state = GTK_STATE_NORMAL;
+
+ if (flags & wxCONTROL_SELECTED)
+ {
+ // the wxCONTROL_FOCUSED state is deduced
+ // directly from the m_wxwindow by GTK+
+ state = GTK_STATE_SELECTED;
+
+ gtk_paint_flat_box( tree->style, // win->m_widget->style,
+ gdk_window,
+ state,
+ GTK_SHADOW_NONE,
+ NULL,
+ win->m_wxwindow,
+ "cell_even",
+ dc.LogicalToDeviceX(rect.x) - x_diff,
+ dc.LogicalToDeviceY(rect.y),
+ rect.width,
+ rect.height );
+ }
+ else // !wxCONTROL_SELECTED
+ {
+ state = GTK_STATE_NORMAL;
+ }
+
+ if ((flags & wxCONTROL_CURRENT) && (flags & wxCONTROL_FOCUSED))
+ {
+ if (flags & wxCONTROL_SELECTED)
+ state = GTK_STATE_SELECTED;
+
+ gtk_paint_focus( tree->style,
+ gdk_window,
+ state,
+ NULL,
+ win->m_wxwindow,
+ // Detail "treeview" causes warning with GTK+ 2.12 Clearlooks theme:
+ // "... no property named `row-ending-details'"
+ // Using "treeview-middle" would fix the warning, but the right
+ // edge of the focus rect is not getting erased properly either.
+ // Better to not specify this detail unless the drawing is fixed.
+ "",
+ dc.LogicalToDeviceX(rect.x),
+ dc.LogicalToDeviceY(rect.y),
+ rect.width,
+ rect.height );
+ }
+}
+
+void wxRendererGTK::DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags)
+{
+ GdkWindow* gdk_window = wxGetGdkWindowForDC(win, dc);
+ wxASSERT_MSG( gdk_window,
+ wxT("cannot use wxRendererNative on wxDC of this type") );
+
+ GtkStateType state;
+ if (flags & wxCONTROL_SELECTED)
+ state = GTK_STATE_SELECTED;
+ else
+ state = GTK_STATE_NORMAL;
+
+ gtk_paint_focus( win->m_widget->style,
+ gdk_window,
+ state,
+ NULL,
+ win->m_wxwindow,
+ NULL,
+ dc.LogicalToDeviceX(rect.x),
+ dc.LogicalToDeviceY(rect.y),
+ rect.width,
+ rect.height );
+}
+
+// Uses the theme to draw the border and fill for something like a wxTextCtrl
+void wxRendererGTK::DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, int flags)
+{
+ GtkWidget *entry = wxGTKPrivate::GetTextEntryWidget();
+
+ GdkWindow* gdk_window = wxGetGdkWindowForDC(win, dc);
+
+ GtkStateType state = GTK_STATE_NORMAL;
+ if ( flags & wxCONTROL_DISABLED )
+ state = GTK_STATE_INSENSITIVE;