Commit 69366efd authored by claes's avatar claes

Problem with initial scrollbar settings fixed

parent 7a60bdc8
/*
* Proview $Id: flow_browwidget_gtk.cpp,v 1.6 2008-02-05 14:59:43 claes Exp $
* Proview $Id: flow_browwidget_gtk.cpp,v 1.7 2008-02-27 15:07:41 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -63,6 +63,7 @@ struct _BrowWidgetGtk {
int scroll_v_upper;
gint scroll_timerid;
flow_sScroll scroll_data;
int scroll_configure;
};
struct _BrowWidgetGtkClass {
......@@ -136,7 +137,8 @@ static gboolean scroll_callback_cb( void *d)
if ( scroll_data->scroll_h_managed) {
((BrowWidgetGtk *)scroll_data->brow)->scroll_h_ignore = 1;
if ( data->window_width != ((BrowWidgetGtk *)scroll_data->brow)->scroll_h_pagesize ||
data->total_width != ((BrowWidgetGtk *)scroll_data->brow)->scroll_h_upper) {
data->total_width != ((BrowWidgetGtk *)scroll_data->brow)->scroll_h_upper ||
((BrowWidgetGtk *)scroll_data->brow)->scroll_configure) {
g_object_set( ((GtkScrollbar *)scroll_data->scroll_h)->range.adjustment,
"upper", (gdouble)data->total_width,
"page-size", (gdouble)data->window_width,
......@@ -158,7 +160,8 @@ static gboolean scroll_callback_cb( void *d)
if ( scroll_data->scroll_v_managed) {
((BrowWidgetGtk *)scroll_data->brow)->scroll_v_ignore = 1;
if ( data->window_height != ((BrowWidgetGtk *)scroll_data->brow)->scroll_v_pagesize ||
data->total_height != ((BrowWidgetGtk *)scroll_data->brow)->scroll_v_upper) {
data->total_height != ((BrowWidgetGtk *)scroll_data->brow)->scroll_v_upper ||
((BrowWidgetGtk *)scroll_data->brow)->scroll_configure) {
g_object_set( ((GtkScrollbar *)scroll_data->scroll_v)->range.adjustment,
"upper", (gdouble)data->total_height,
"page-size", (gdouble)data->window_height,
......@@ -175,6 +178,7 @@ static gboolean scroll_callback_cb( void *d)
((BrowWidgetGtk *)scroll_data->brow)->scroll_v_pagesize = data->window_height;
((BrowWidgetGtk *)scroll_data->brow)->scroll_v_upper = data->total_height;
}
((BrowWidgetGtk *)scroll_data->brow)->scroll_configure = 0;
return FALSE;
}
......@@ -272,6 +276,9 @@ static gboolean browwidgetgtk_event( GtkWidget *flow, GdkEvent *event)
else if ( next)
gdk_event_free( next);
}
else if ( event->type == GDK_CONFIGURE) {
((BrowWidgetGtk *)flow)->scroll_configure = 1;
}
((FlowDrawGtk *)((BrowCtx *)((BrowWidgetGtk *)flow)->brow_ctx)->fdraw)->event_handler( (FlowCtx *)((BrowWidgetGtk *)flow)->brow_ctx, *event);
return TRUE;
......@@ -397,6 +404,7 @@ GtkWidget *scrolledbrowwidgetgtk_new(
w->scroll_v_ignore = 0;
w->scroll_h_value = 0;
w->scroll_v_value = 0;
w->scroll_configure = 0;
w->form = form;
*browwidget = GTK_WIDGET( w);
......@@ -426,6 +434,7 @@ GtkWidget *brownavwidgetgtk_new( GtkWidget *main_brow)
w->scroll_v = 0;
w->scroll_h_ignore = 0;
w->scroll_v_ignore = 0;
w->scroll_configure = 0;
return (GtkWidget *) w;
}
......
/*
* Proview $Id: flow_widget_gtk.cpp,v 1.7 2008-02-05 14:59:43 claes Exp $
* Proview $Id: flow_widget_gtk.cpp,v 1.8 2008-02-27 15:07:41 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -63,6 +63,7 @@ struct _FlowWidgetGtk {
int scroll_v_upper;
gint scroll_timerid;
flow_sScroll scroll_data;
int scroll_configure;
};
struct _FlowWidgetGtkClass {
......@@ -136,7 +137,8 @@ static gboolean scroll_callback_cb( void *d)
if ( scroll_data->scroll_h_managed) {
((FlowWidgetGtk *)scroll_data->flow)->scroll_h_ignore = 1;
if ( data->window_width != ((FlowWidgetGtk *)scroll_data->flow)->scroll_h_pagesize ||
data->total_width != ((FlowWidgetGtk *)scroll_data->flow)->scroll_h_upper) {
data->total_width != ((FlowWidgetGtk *)scroll_data->flow)->scroll_h_upper ||
((FlowWidgetGtk *)scroll_data->flow)->scroll_configure) {
g_object_set( ((GtkScrollbar *)scroll_data->scroll_h)->range.adjustment,
"upper", (gdouble)data->total_width,
"page-size", (gdouble)data->window_width,
......@@ -155,7 +157,8 @@ static gboolean scroll_callback_cb( void *d)
if ( scroll_data->scroll_v_managed) {
((FlowWidgetGtk *)scroll_data->flow)->scroll_v_ignore = 1;
if ( data->window_height != ((FlowWidgetGtk *)scroll_data->flow)->scroll_v_pagesize ||
data->total_height != ((FlowWidgetGtk *)scroll_data->flow)->scroll_v_upper) {
data->total_height != ((FlowWidgetGtk *)scroll_data->flow)->scroll_v_upper ||
((FlowWidgetGtk *)scroll_data->flow)->scroll_configure) {
g_object_set( ((GtkScrollbar *)scroll_data->scroll_v)->range.adjustment,
"upper", (gdouble)data->total_height,
"page-size", (gdouble)data->window_height,
......@@ -173,6 +176,7 @@ static gboolean scroll_callback_cb( void *d)
((FlowWidgetGtk *)scroll_data->flow)->scroll_h_pagesize = data->window_width;
((FlowWidgetGtk *)scroll_data->flow)->scroll_h_upper = data->total_width;
}
((FlowWidgetGtk *)scroll_data->flow)->scroll_configure = 0;
return FALSE;
}
......@@ -264,6 +268,9 @@ static gboolean flowwidgetgtk_event( GtkWidget *flow, GdkEvent *event)
else if ( next)
gdk_event_free( next);
}
else if ( event->type == GDK_CONFIGURE) {
((FlowWidgetGtk *)flow)->scroll_configure = 1;
}
((FlowDrawGtk *)((FlowCtx *)((FlowWidgetGtk *)flow)->flow_ctx)->fdraw)->event_handler( (FlowCtx *)((FlowWidgetGtk *)flow)->flow_ctx, *event);
return TRUE;
......@@ -384,6 +391,9 @@ GtkWidget *scrolledflowwidgetgtk_new(
w->scroll_v = GTK_SCROLLED_WINDOW(form)->vscrollbar;
w->scroll_h_ignore = 0;
w->scroll_v_ignore = 0;
w->scroll_h_value = 0;
w->scroll_v_value = 0;
w->scroll_configure = 0;
w->form = form;
*flowwidget = GTK_WIDGET( w);
......@@ -412,6 +422,9 @@ GtkWidget *flownavwidgetgtk_new( GtkWidget *main_flow)
w->scroll_v = 0;
w->scroll_h_ignore = 0;
w->scroll_v_ignore = 0;
w->scroll_h_value = 0;
w->scroll_v_value = 0;
w->scroll_configure = 0;
return (GtkWidget *) w;
}
......
/*
* Proview $Id: flow_ctx.cpp,v 1.13 2008-01-18 13:55:06 claes Exp $
* Proview $Id: flow_ctx.cpp,v 1.14 2008-02-27 15:07:41 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -1219,6 +1219,7 @@ int FlowCtx::event_handler_nav( flow_eEvent event, int x, int y)
case flow_eEvent_Exposure:
fdraw->get_nav_window_size( this, &nav_window_width, &nav_window_height);
nav_zoom();
change_scrollbar();
break;
case flow_eEvent_ButtonMotion:
if ( nav_rect_movement_active)
......
/*
* Proview $Id: glow_curvewidget_gtk.cpp,v 1.5 2008-02-05 14:59:43 claes Exp $
* Proview $Id: glow_curvewidget_gtk.cpp,v 1.6 2008-02-27 15:07:41 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -67,6 +67,7 @@ struct _CurveWidgetGtk {
int scroll_v_upper;
gint scroll_timerid;
glow_sScroll scroll_data;
int scroll_configure;
};
struct _CurveWidgetGtkClass {
......@@ -138,7 +139,8 @@ static gboolean scroll_callback_cb( void *d)
if ( scroll_data->scroll_v_managed) {
((CurveWidgetGtk *)scroll_data->curve)->scroll_v_ignore = 1;
if ( data->window_height != ((CurveWidgetGtk *)scroll_data->curve)->scroll_v_pagesize ||
data->total_height != ((CurveWidgetGtk *)scroll_data->curve)->scroll_v_upper) {
data->total_height != ((CurveWidgetGtk *)scroll_data->curve)->scroll_v_upper ||
((CurveWidgetGtk *)scroll_data->curve)->scroll_configure) {
g_object_set( ((GtkScrollbar *)scroll_data->scroll_v)->range.adjustment,
"upper", (gdouble)data->total_height,
"page-size", (gdouble)data->window_height,
......@@ -156,6 +158,7 @@ static gboolean scroll_callback_cb( void *d)
((CurveWidgetGtk *)scroll_data->curve)->scroll_h_pagesize = data->window_width;
((CurveWidgetGtk *)scroll_data->curve)->scroll_h_upper = data->total_width;
}
((CurveWidgetGtk *)scroll_data->curve)->scroll_configure = 0;
return FALSE;
#if 0
if ( scroll_data->scroll_h_managed) {
......@@ -278,6 +281,9 @@ static gboolean curvewidgetgtk_event( GtkWidget *glow, GdkEvent *event)
else if ( next)
gdk_event_free( next);
}
else if ( event->type == GDK_CONFIGURE) {
((CurveWidgetGtk *)glow)->scroll_configure = 1;
}
((GlowDrawGtk *)((CurveCtx *)((CurveWidgetGtk *)glow)->curve_ctx)->gdraw)->event_handler( *event);
return TRUE;
......@@ -401,6 +407,9 @@ GtkWidget *scrolledcurvewidgetgtk_new(
w->scroll_v = GTK_SCROLLED_WINDOW(form)->vscrollbar;
w->scroll_h_ignore = 0;
w->scroll_v_ignore = 0;
w->scroll_h_value = 0;
w->scroll_v_value = 0;
w->scroll_configure = 0;
w->form = form;
*curvewidget = GTK_WIDGET( w);
......@@ -429,6 +438,9 @@ GtkWidget *curvenavwidgetgtk_new( GtkWidget *main_curve)
w->scroll_v = 0;
w->scroll_h_ignore = 0;
w->scroll_v_ignore = 0;
w->scroll_h_value = 0;
w->scroll_v_value = 0;
w->scroll_configure = 0;
return (GtkWidget *) w;
}
......
/*
* Proview $Id: glow_growwidget_gtk.cpp,v 1.7 2008-02-05 14:59:43 claes Exp $
* Proview $Id: glow_growwidget_gtk.cpp,v 1.8 2008-02-27 15:07:41 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -65,6 +65,7 @@ struct _GrowWidgetGtk {
int scroll_v_upper;
gint scroll_timerid;
glow_sScroll scroll_data;
int scroll_configure;
};
struct _GrowWidgetGtkClass {
......@@ -139,7 +140,8 @@ static gboolean scroll_callback_cb( void *d)
if ( scroll_data->scroll_h_managed) {
((GrowWidgetGtk *)scroll_data->grow)->scroll_h_ignore = 1;
if ( data->window_width != ((GrowWidgetGtk *)scroll_data->grow)->scroll_h_pagesize ||
data->total_width != ((GrowWidgetGtk *)scroll_data->grow)->scroll_h_upper) {
data->total_width != ((GrowWidgetGtk *)scroll_data->grow)->scroll_h_upper ||
((GrowWidgetGtk *)scroll_data->grow)->scroll_configure) {
g_object_set( ((GtkScrollbar *)scroll_data->scroll_h)->range.adjustment,
"upper", (gdouble)data->total_width,
"page-size", (gdouble)data->window_width,
......@@ -158,7 +160,8 @@ static gboolean scroll_callback_cb( void *d)
if ( scroll_data->scroll_v_managed) {
((GrowWidgetGtk *)scroll_data->grow)->scroll_v_ignore = 1;
if ( data->window_height != ((GrowWidgetGtk *)scroll_data->grow)->scroll_v_pagesize ||
data->total_height != ((GrowWidgetGtk *)scroll_data->grow)->scroll_v_upper) {
data->total_height != ((GrowWidgetGtk *)scroll_data->grow)->scroll_v_upper ||
((GrowWidgetGtk *)scroll_data->grow)->scroll_configure) {
g_object_set( ((GtkScrollbar *)scroll_data->scroll_v)->range.adjustment,
"upper", (gdouble)data->total_height,
"page-size", (gdouble)data->window_height,
......@@ -176,32 +179,8 @@ static gboolean scroll_callback_cb( void *d)
((GrowWidgetGtk *)scroll_data->grow)->scroll_h_pagesize = data->window_width;
((GrowWidgetGtk *)scroll_data->grow)->scroll_h_upper = data->total_width;
}
((GrowWidgetGtk *)scroll_data->grow)->scroll_configure = 0;
return FALSE;
#if 0
if ( scroll_data->scroll_h_managed) {
((GrowWidgetGtk *)scroll_data->grow)->scroll_h_ignore = 1;
g_object_set( ((GtkScrollbar *)scroll_data->scroll_h)->range.adjustment,
"upper", (gdouble)data->total_width,
"page-size", (gdouble)data->window_width,
"value", (gdouble)data->offset_x,
NULL);
gtk_adjustment_changed(
((GtkScrollbar *)scroll_data->scroll_h)->range.adjustment);
((GrowWidgetGtk *)scroll_data->grow)->scroll_h_value = (gdouble)data->offset_x;
}
if ( scroll_data->scroll_v_managed) {
((GrowWidgetGtk *)scroll_data->grow)->scroll_v_ignore = 1;
g_object_set( ((GtkScrollbar *)scroll_data->scroll_v)->range.adjustment,
"upper", (gdouble)data->total_height,
"page-size", (gdouble)data->window_height,
"value", (gdouble)data->offset_y,
NULL);
gtk_adjustment_changed(
((GtkScrollbar *)scroll_data->scroll_v)->range.adjustment);
((GrowWidgetGtk *)scroll_data->grow)->scroll_v_value = (gdouble)data->offset_y;
}
#endif
}
static void scroll_h_action( GtkWidget *w,
......@@ -311,6 +290,9 @@ static gboolean growwidgetgtk_event( GtkWidget *glow, GdkEvent *event)
else if ( next)
gdk_event_free( next);
}
else if ( event->type == GDK_CONFIGURE) {
((GrowWidgetGtk *)glow)->scroll_configure = 1;
}
((GlowDrawGtk *)((GrowCtx *)((GrowWidgetGtk *)glow)->grow_ctx)->gdraw)->event_handler( *event);
return TRUE;
......@@ -425,6 +407,9 @@ GtkWidget *scrolledgrowwidgetgtk_new(
w->scroll_v = GTK_SCROLLED_WINDOW(form)->vscrollbar;
w->scroll_h_ignore = 0;
w->scroll_v_ignore = 0;
w->scroll_h_value = 0;
w->scroll_v_value = 0;
w->scroll_configure = 0;
w->form = form;
*growwidget = GTK_WIDGET( w);
......@@ -453,6 +438,9 @@ GtkWidget *grownavwidgetgtk_new( GtkWidget *main_grow)
w->scroll_v = 0;
w->scroll_h_ignore = 0;
w->scroll_v_ignore = 0;
w->scroll_h_value = 0;
w->scroll_v_value = 0;
w->scroll_configure = 0;
return (GtkWidget *) w;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment