int noUnitsX, int noUnitsY,
int xPos, int yPos, bool noRefresh )
{
+ // Update any invalidates areas before the get moved/scrolled.
+ Update();
+
int old_x = m_xScrollPixelsPerLine * m_xScrollPosition;
int old_y = m_yScrollPixelsPerLine * m_yScrollPosition;
void wxScrolledWindow::AdjustScrollbars()
{
+ // Update any invalidates areas before the get moved/scrolled.
+ Update();
+
int w, h;
m_targetWindow->GetClientSize( &w, &h );
int nScrollInc = CalcScrollInc(event);
if (nScrollInc == 0) return;
+ // Update any invalidates areas before the get moved/scrolled.
+ Update();
+
if (orient == wxHORIZONTAL)
{
int newPos = m_xScrollPosition + nScrollInc;
if (((x_pos == -1) || (x_pos == m_xScrollPosition)) &&
((y_pos == -1) || (y_pos == m_yScrollPosition))) return;
+ // Update any invalidates areas before the get moved/scrolled.
+ Update();
+
if ((x_pos != -1) && (m_xScrollPixelsPerLine))
{
int max = (int)(m_hAdjust->upper - m_hAdjust->page_size + 0.5);
if (y_pos == m_yScrollPosition)
return;
+ // Update any invalidates areas before the get moved/scrolled.
+ Update();
+
GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget);
GtkRange *range = GTK_RANGE(scrolledWindow->vscrollbar);
if (x_pos == m_xScrollPosition)
return;
+ // Update any invalidates areas before the get moved/scrolled.
+ Update();
+
GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget);
GtkRange *range = GTK_RANGE(scrolledWindow->hscrollbar);
return nScrollInc;
}
-void wxScrolledWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
+void wxScrolledWindow::SetScrollPos( int orient, int pos, bool refresh )
{
wxCHECK_RET( m_widget != NULL, wxT("invalid window") );
wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") );
+ // Update any invalidates areas before the get moved/scrolled.
+ // We ignore the refresh parameter here because it is meant
+ // to control the behaviour AFTER scrolling happens.
+ Update();
+
if (orient == wxHORIZONTAL)
{
int max = (int)(m_hAdjust->upper - m_hAdjust->page_size + 0.5);
wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") );
+ // No scrolling requested.
if ((dx == 0) && (dy == 0)) return;
+
+#if 1
m_clipPaintRegion = TRUE;
+
gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
+
m_clipPaintRegion = FALSE;
-/*
+#else
+
if (m_children.GetCount() > 0)
{
gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
gdk_gc_unref( m_scrollGC );
}
-*/
+#endif
}
// Find the wxWindow at the current mouse position, also returning the mouse
int noUnitsX, int noUnitsY,
int xPos, int yPos, bool noRefresh )
{
+ // Update any invalidates areas before the get moved/scrolled.
+ Update();
+
int old_x = m_xScrollPixelsPerLine * m_xScrollPosition;
int old_y = m_yScrollPixelsPerLine * m_yScrollPosition;
void wxScrolledWindow::AdjustScrollbars()
{
+ // Update any invalidates areas before the get moved/scrolled.
+ Update();
+
int w, h;
m_targetWindow->GetClientSize( &w, &h );
int nScrollInc = CalcScrollInc(event);
if (nScrollInc == 0) return;
+ // Update any invalidates areas before the get moved/scrolled.
+ Update();
+
if (orient == wxHORIZONTAL)
{
int newPos = m_xScrollPosition + nScrollInc;
if (((x_pos == -1) || (x_pos == m_xScrollPosition)) &&
((y_pos == -1) || (y_pos == m_yScrollPosition))) return;
+ // Update any invalidates areas before the get moved/scrolled.
+ Update();
+
if ((x_pos != -1) && (m_xScrollPixelsPerLine))
{
int max = (int)(m_hAdjust->upper - m_hAdjust->page_size + 0.5);
if (y_pos == m_yScrollPosition)
return;
+ // Update any invalidates areas before the get moved/scrolled.
+ Update();
+
GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget);
GtkRange *range = GTK_RANGE(scrolledWindow->vscrollbar);
if (x_pos == m_xScrollPosition)
return;
+ // Update any invalidates areas before the get moved/scrolled.
+ Update();
+
GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget);
GtkRange *range = GTK_RANGE(scrolledWindow->hscrollbar);
return nScrollInc;
}
-void wxScrolledWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
+void wxScrolledWindow::SetScrollPos( int orient, int pos, bool refresh )
{
wxCHECK_RET( m_widget != NULL, wxT("invalid window") );
wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") );
+ // Update any invalidates areas before the get moved/scrolled.
+ // We ignore the refresh parameter here because it is meant
+ // to control the behaviour AFTER scrolling happens.
+ Update();
+
if (orient == wxHORIZONTAL)
{
int max = (int)(m_hAdjust->upper - m_hAdjust->page_size + 0.5);
wxCHECK_RET( m_wxwindow != NULL, wxT("window needs client area for scrolling") );
+ // No scrolling requested.
if ((dx == 0) && (dy == 0)) return;
+
+#if 1
m_clipPaintRegion = TRUE;
+
gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
+
m_clipPaintRegion = FALSE;
-/*
+#else
+
if (m_children.GetCount() > 0)
{
gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
gdk_gc_unref( m_scrollGC );
}
-*/
+#endif
}
// Find the wxWindow at the current mouse position, also returning the mouse