+ return true;
+
+ case GDK_SCROLL_RIGHT:
+ case GDK_SCROLL_LEFT:
+ {
+ double t = adj_timescale->get_value();
+ double orig_t = t;
+ double start = adj_timescale->get_lower();
+ double end = adj_timescale->get_upper();
+ double lower = adj_bounds->get_lower();
+ double upper = adj_bounds->get_upper();
+ double adj = time_per_tickmark;
+
+ if( event->direction == GDK_SCROLL_RIGHT )
+ {
+ // step forward one tick
+ t += adj;
+
+ // don't go past the end of time
+ if (t > upper)
+ t = upper;
+
+ // if we are already in the right half of the slider
+ if ((t-start)*2 > (end-start))
+ {
+ // if we can't scroll the background left one whole tick, scroll it to the end
+ if (end > upper - (t-orig_t))
+ {
+ adj_timescale->set_lower(upper - (end-start));
+ adj_timescale->set_upper(upper);
+ }
+ // else scroll the background left
+ else
+ {
+ adj_timescale->set_lower(start + (t-orig_t));
+ adj_timescale->set_upper(start + (t-orig_t) + (end-start));
+ }
+ }
+ }
+ else
+ {
+ // step backwards one tick
+ t -= adj;
+
+ // don't go past the start of time
+ if (t < lower)
+ t = lower;
+
+ // if we are already in the left half of the slider
+ if ((t-start)*2 < (end-start))
+ {
+ // if we can't scroll the background right one whole tick, scroll it to the beginning
+ if (start < lower + (orig_t-t))
+ {
+ adj_timescale->set_lower(lower);
+ adj_timescale->set_upper(lower + (end-start));
+ }
+ // else scroll the background right
+ else
+ {
+ adj_timescale->set_lower(start - (orig_t-t));
+ adj_timescale->set_upper(start - (orig_t-t) + (end-start));
+ }
+ }
+ }