correct scrolling of various GTK+ widgets such as GtkFrame (wxStaticBox)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48553 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -302,6 +302,8 @@ MyCanvas::MyCanvas( wxScrolledWindow *parent, MyTopLabels *top, MyRightLabels *r
|
||||
(void)new wxComboBox( this, wxID_ANY, _T("ComboBox I"), wxPoint(0,150), wxSize(100,25));
|
||||
(void)new wxComboBox( this, wxID_ANY, _T("ComboBox II"), wxPoint(200,150), wxSize(100,25));
|
||||
|
||||
(void)new wxStaticBox( this, wxID_ANY, _T("StaticBox"), wxPoint(0,200), wxSize(200,60));
|
||||
|
||||
SetBackgroundColour( wxT("WHEAT") );
|
||||
|
||||
SetCursor( wxCursor( wxCURSOR_IBEAM ) );
|
||||
|
@@ -71,8 +71,6 @@ static void gtk_pizza_forall (GtkContainer *container,
|
||||
|
||||
static void gtk_pizza_allocate_child (GtkPizza *pizza,
|
||||
GtkPizzaChild *child);
|
||||
static void gtk_pizza_adjust_allocations_recurse (GtkWidget *widget,
|
||||
gpointer cb_data);
|
||||
|
||||
static GtkType gtk_pizza_child_type (GtkContainer *container);
|
||||
|
||||
@@ -691,33 +689,16 @@ gtk_pizza_allocate_child (GtkPizza *pizza,
|
||||
gtk_widget_size_allocate (child->widget, &allocation);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_pizza_adjust_allocations_recurse (GtkWidget *widget,
|
||||
gpointer cb_data)
|
||||
{
|
||||
GtkPizzaAdjData *data = cb_data;
|
||||
|
||||
widget->allocation.x += data->dx;
|
||||
widget->allocation.y += data->dy;
|
||||
|
||||
if (GTK_WIDGET_NO_WINDOW (widget) && GTK_IS_CONTAINER (widget))
|
||||
{
|
||||
gtk_container_forall (GTK_CONTAINER (widget),
|
||||
gtk_pizza_adjust_allocations_recurse,
|
||||
cb_data);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_pizza_adjust_allocations (GtkPizza *pizza,
|
||||
gint dx,
|
||||
gint dy)
|
||||
void
|
||||
gtk_pizza_scroll (GtkPizza *pizza, gint dx, gint dy)
|
||||
{
|
||||
GList *tmp_list;
|
||||
GtkPizzaAdjData data;
|
||||
|
||||
data.dx = dx;
|
||||
data.dy = dy;
|
||||
pizza->m_xoffset += dx;
|
||||
pizza->m_yoffset += dy;
|
||||
|
||||
if (pizza->bin_window)
|
||||
gdk_window_scroll( pizza->bin_window, -dx, -dy );
|
||||
|
||||
tmp_list = pizza->children;
|
||||
while (tmp_list)
|
||||
@@ -725,30 +706,12 @@ gtk_pizza_adjust_allocations (GtkPizza *pizza,
|
||||
GtkPizzaChild *child = tmp_list->data;
|
||||
tmp_list = tmp_list->next;
|
||||
|
||||
child->widget->allocation.x += dx;
|
||||
child->widget->allocation.y += dy;
|
||||
|
||||
if (GTK_WIDGET_NO_WINDOW (child->widget) &&
|
||||
GTK_IS_CONTAINER (child->widget))
|
||||
{
|
||||
gtk_container_forall (GTK_CONTAINER (child->widget),
|
||||
gtk_pizza_adjust_allocations_recurse,
|
||||
&data);
|
||||
GtkAllocation alloc = child->widget->allocation;
|
||||
alloc.x -= dx;
|
||||
alloc.y -= dy;
|
||||
gtk_widget_size_allocate( child->widget, &alloc );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_pizza_scroll (GtkPizza *pizza, gint dx, gint dy)
|
||||
{
|
||||
pizza->m_xoffset += dx;
|
||||
pizza->m_yoffset += dy;
|
||||
|
||||
gtk_pizza_adjust_allocations (pizza, -dx, -dy);
|
||||
|
||||
if (pizza->bin_window)
|
||||
gdk_window_scroll( pizza->bin_window, -dx, -dy );
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user