void gtk_pizza_set_yoffset (GtkPizza *pizza, gint yoffset);
+WXDLLIMPEXP_CORE
+gint gtk_pizza_get_rtl_offset (GtkPizza *pizza);
+
WXDLLIMPEXP_CORE
void gtk_pizza_set_shadow_type (GtkPizza *pizza,
GtkMyShadowType type);
else
state = GTK_STATE_NORMAL;
+ int x_diff = 0;
+ if (win->GetLayoutDirection() == wxLayout_RightToLeft)
+ x_diff = rect.width;
+
// VZ: I don't know how to get the size of the expander so as to centre it
// in the given rectangle, +2/3 below is just what looks good here...
gtk_paint_expander
NULL,
tree,
"treeview",
- dc.LogicalToDeviceX(rect.x) + 2,
+ dc.LogicalToDeviceX(rect.x) + 2 - x_diff,
dc.LogicalToDeviceY(rect.y) + 3,
flags & wxCONTROL_EXPANDED ? GTK_EXPANDER_EXPANDED
: GTK_EXPANDER_COLLAPSED
// do something
}
+gint gtk_pizza_get_rtl_offset (GtkPizza *pizza)
+{
+ gint width;
+
+ g_return_val_if_fail ( (pizza != NULL), 0 );
+ g_return_val_if_fail ( (GTK_IS_PIZZA (pizza)), 0 );
+
+ if (!pizza->bin_window) return 0;
+
+ gdk_window_get_geometry( pizza->bin_window, NULL, NULL, &width, NULL, NULL );
+
+ return width;
+}
+
+
static void
gtk_pizza_scroll_set_adjustments (GtkPizza *pizza,
GtkAdjustment *hadj,
event.m_y = (wxCoord)gdk_event->y - pt.y;
if ((win->m_wxwindow) && (win->GetLayoutDirection() == wxLayout_RightToLeft))
- event.m_x = GTK_PIZZA(win->m_wxwindow)->m_width - event.m_x;
+ {
+ // origin in the upper right corner
+ int virtual_width = win->GetVirtualSize().x;
+ int window_width = gtk_pizza_get_rtl_offset( GTK_PIZZA(win->m_wxwindow) );
+ event.m_x = wxMax( virtual_width, window_width ) - event.m_x;
+ }
event.SetEventObject( win );
event.SetId( win->GetId() );