if (x_pos != -1)
{
+ int old_x = m_xScrollPosition;
m_xScrollPosition = x_pos;
// Calculate page size i.e. number of scroll units you get on the
m_xScrollPosition = wxMax( 0, m_xScrollPosition );
SetScrollPos( wxHORIZONTAL, m_xScrollPosition, TRUE );
+
+ ScrollWindow( (old_x-m_xScrollPosition)*m_xScrollPixelsPerLine, 0 );
}
if (y_pos != -1)
{
+ int old_y = m_yScrollPosition;
m_yScrollPosition = y_pos;
// Calculate page size i.e. number of scroll units you get on the
m_yScrollPosition = wxMax( 0, m_yScrollPosition );
SetScrollPos( wxVERTICAL, m_yScrollPosition, TRUE );
+
+ ScrollWindow( 0, (old_y-m_yScrollPosition)*m_yScrollPixelsPerLine );
}
- // BAD, BAD, can cause event loops if called from OnPaint(). KB.
- // Refresh();
#ifdef __WXMSW__
- // Necessary?
- ::UpdateWindow ((HWND) GetHWND());
+// ::UpdateWindow ((HWND) GetHWND());
+#else
+// Refresh();
#endif
}