-
- // Calculate page size i.e. number of scroll units you get on the
- // current client window
- int noPagePositions = (int) ( (w/(double)m_xScrollPixelsPerLine) + 0.5 );
- if (noPagePositions < 1) noPagePositions = 1;
-
- // Correct position if greater than extent of canvas minus
- // the visible portion of it or if below zero
- m_xScrollPosition = wxMin( m_xScrollLines-noPagePositions, m_xScrollPosition );
- m_xScrollPosition = wxMax( 0, m_xScrollPosition );
-
- if (old_x != m_xScrollPosition) {
- m_targetWindow->ScrollWindow( (old_x-m_xScrollPosition)*m_xScrollPixelsPerLine, 0 );
- }
+ m_hAdjust->value = x_pos;
+
+ m_targetWindow->ScrollWindow( (old_x-m_xScrollPosition)*m_xScrollPixelsPerLine, 0 );
+
+ gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "value_changed" );