+}
+
+wxRect wxStatusBarGeneric::GetSizeGripRect() const
+{
+ int width, height;
+ wxWindow::DoGetClientSize(&width, &height);
+
+ if (GetLayoutDirection() == wxLayout_RightToLeft)
+ return wxRect(2, 2, height-2, height-4);
+ else
+ return wxRect(width-height-2, 2, height-2, height-4);
+}
+
+// ----------------------------------------------------------------------------
+// wxStatusBarGeneric - event handlers
+// ----------------------------------------------------------------------------
+
+void wxStatusBarGeneric::OnPaint(wxPaintEvent& WXUNUSED(event) )
+{
+ wxPaintDC dc(this);
+
+#ifdef __WXGTK20__
+ // Draw grip first
+ if ( ShowsSizeGrip() )
+ {
+ const wxRect& rc = GetSizeGripRect();
+#ifdef __WXGTK3__
+ GtkWidget* toplevel = gtk_widget_get_toplevel(m_widget);
+ GdkRectangle rect;
+ if (toplevel && (!gtk_window_get_resize_grip_area(GTK_WINDOW(toplevel), &rect) ||
+ rect.width == 0 || rect.height == 0))
+ {
+ GtkStyleContext* sc = gtk_widget_get_style_context(toplevel);
+ gtk_style_context_save(sc);
+ gtk_style_context_add_class(sc, GTK_STYLE_CLASS_GRIP);
+ GtkJunctionSides sides = GTK_JUNCTION_CORNER_BOTTOMRIGHT;
+ if (GetLayoutDirection() == wxLayout_RightToLeft)
+ sides = GTK_JUNCTION_CORNER_BOTTOMLEFT;
+ gtk_style_context_set_junction_sides(sc, sides);
+ gtk_render_handle(sc,
+ static_cast<cairo_t*>(dc.GetImpl()->GetCairoContext()),
+ rc.x, rc.y, rc.width, rc.height);
+ gtk_style_context_restore(sc);
+ }
+#else
+ GdkWindowEdge edge =
+ GetLayoutDirection() == wxLayout_RightToLeft ? GDK_WINDOW_EDGE_SOUTH_WEST :
+ GDK_WINDOW_EDGE_SOUTH_EAST;
+ gtk_paint_resize_grip(gtk_widget_get_style(m_widget),
+ GTKGetDrawingWindow(),
+ gtk_widget_get_state(m_widget),
+ NULL,
+ m_widget,
+ "statusbar",
+ edge,
+ rc.x, rc.y, rc.width, rc.height );
+#endif