+#if USE_ERASE_RECT
+ // we must erase everything first, otherwise the garbage
+ // from the old sash is left when dragging it
+ gtk_paint_flat_box
+ (
+ win->m_wxwindow->style,
+ GTK_PIZZA(win->m_wxwindow)->bin_window,
+ GTK_STATE_NORMAL,
+ GTK_SHADOW_NONE,
+ NULL,
+ win->m_wxwindow,
+ (char *)"viewportbin", // const_cast
+ erase_rect.x,
+ erase_rect.y,
+ erase_rect.width,
+ erase_rect.height
+ );
+#endif
+
+
+ // leave some margin before sash itself
+ position += SASH_MARGIN / 2;
+
+ // and finally draw it using GTK paint functions
+ typedef void (*GtkPaintLineFunc)(GtkStyle *, GdkWindow *,
+ GtkStateType,
+ GdkRectangle *, GtkWidget *,
+ gchar *,
+ gint, gint, gint);
+
+ GtkPaintLineFunc func = isVert ? gtk_paint_vline : gtk_paint_hline;
+
+ (*func)
+ (
+ win->m_wxwindow->style,
+ GTK_PIZZA(win->m_wxwindow)->bin_window,
+ GTK_STATE_NORMAL,
+ NULL,
+ win->m_wxwindow,
+ (char *)"paned", // const_cast
+ 0, isVert ? size.y : size.x, position + SASH_SIZE / 2 - 1
+ );
+
+ gtk_paint_box
+ (
+ win->m_wxwindow->style,
+ GTK_PIZZA(win->m_wxwindow)->bin_window,
+ GTK_STATE_NORMAL,
+ GTK_SHADOW_OUT,
+ (GdkRectangle*) NULL,
+ win->m_wxwindow,
+ (char *)"paned", // const_cast
+ isVert ? position : size.x - 2*SASH_SIZE,
+ isVert ? size.y - 2*SASH_SIZE : position,
+ SASH_SIZE, SASH_SIZE
+ );
+}
+
+void
+wxRendererGTK::DrawDropArrow(wxWindow *WXUNUSED(win),
+ wxDC& dc,
+ const wxRect& rect,
+ int flags)
+{
+ GtkWidget *button = GetButtonWidget();
+
+ // If we give GTK_PIZZA(win->m_wxwindow)->bin_window as
+ // a window for gtk_paint_xxx function, then it won't
+ // work for wxMemoryDC. So that is why we assume wxDC
+ // is wxWindowDC (wxClientDC, wxMemoryDC and wxPaintDC
+ // are derived from it) and use its m_window.
+ GdkWindow* gdk_window = dc.GetGDKWindow();
+ wxASSERT_MSG( gdk_window,
+ wxT("cannot use wxRendererNative on wxDC of this type") );
+
+ // draw arrow so that there is even space horizontally
+ // on both sides
+ int arrowX = rect.width/4 + 1;
+ int arrowWidth = rect.width - (arrowX*2);
+
+ // scale arrow's height accoording to the width
+ int arrowHeight = rect.width/3;
+ int arrowY = (rect.height-arrowHeight)/2 +
+ ((rect.height-arrowHeight) & 1);
+
+ 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;
+
+ // draw arrow on button
+ gtk_paint_arrow
+ (
+ button->style,
+ gdk_window,
+ state,
+ flags & wxCONTROL_PRESSED ? GTK_SHADOW_IN : GTK_SHADOW_OUT,
+ NULL,
+ button,
+ "arrow",
+ GTK_ARROW_DOWN,
+ FALSE,
+ rect.x + arrowX,
+ rect.y + arrowY,
+ arrowWidth,
+ arrowHeight
+ );