+wxSize
+wxRendererGTK::GetCheckBoxSize(wxWindow *WXUNUSED(win))
+{
+ gint indicator_size, indicator_spacing;
+ gtk_widget_style_get(wxGTKPrivate::GetCheckButtonWidget(),
+ "indicator_size", &indicator_size,
+ "indicator_spacing", &indicator_spacing,
+ NULL);
+
+ int size = indicator_size + indicator_spacing * 2;
+ return wxSize(size, size);
+}
+
+void
+wxRendererGTK::DrawCheckBox(wxWindow *WXUNUSED(win),
+ wxDC& dc,
+ const wxRect& rect,
+ int flags )
+{
+ GtkWidget *button = wxGTKPrivate::GetCheckButtonWidget();
+
+ GdkWindow* gdk_window = NULL;
+#if wxUSE_NEW_DC
+ wxDCImpl *impl = dc.GetImpl();
+ wxGTKDCImpl *gtk_impl = wxDynamicCast( impl, wxGTKDCImpl );
+ if (gtk_impl)
+ gdk_window = gtk_impl->GetGDKWindow();
+#else
+ gdk_window = dc.GetGDKWindow();
+#endif
+ wxASSERT_MSG( gdk_window,
+ wxT("cannot use wxRendererNative on wxDC of this type") );
+
+ gint indicator_size, indicator_spacing;
+ gtk_widget_style_get(button,
+ "indicator_size", &indicator_size,
+ "indicator_spacing", &indicator_spacing,
+ NULL);
+
+ GtkStateType state;
+
+ if ( flags & wxCONTROL_PRESSED )
+ state = GTK_STATE_ACTIVE;
+ else if ( flags & wxCONTROL_DISABLED )
+ state = GTK_STATE_INSENSITIVE;
+ else if ( flags & wxCONTROL_CURRENT )
+ state = GTK_STATE_PRELIGHT;
+ else
+ state = GTK_STATE_NORMAL;
+
+ gtk_paint_check
+ (
+ button->style,
+ gdk_window,
+ state,
+ flags & wxCONTROL_CHECKED ? GTK_SHADOW_IN : GTK_SHADOW_OUT,
+ NULL,
+ button,
+ "cellcheck",
+ dc.LogicalToDeviceX(rect.x) + indicator_spacing,
+ dc.LogicalToDeviceY(rect.y) + indicator_spacing,
+ indicator_size, indicator_size
+ );
+}
+
+void
+wxRendererGTK::DrawPushButton(wxWindow *WXUNUSED(win),
+ wxDC& dc,
+ const wxRect& rect,
+ int flags)
+{
+ GtkWidget *button = wxGTKPrivate::GetButtonWidget();
+
+ GdkWindow* gdk_window = NULL;
+#if wxUSE_NEW_DC
+ wxDCImpl *impl = dc.GetImpl();
+ wxGTKDCImpl *gtk_impl = wxDynamicCast( impl, wxGTKDCImpl );
+ if (gtk_impl)
+ gdk_window = gtk_impl->GetGDKWindow();
+#else
+ gdk_window = dc.GetGDKWindow();
+#endif
+ wxASSERT_MSG( gdk_window,
+ wxT("cannot use wxRendererNative on wxDC of this type") );