*linesPerPage = 0;
}
- // ensure that the scroll position is always in valid range
- if ( *pos > *lines )
- *pos = *lines;
-
GtkAdjustment* adj = range->adjustment;
adj->step_increment = 1;
adj->page_increment =
adj->page_size = page_size;
gtk_range_set_range(range, 0, upper);
+
+ // ensure that the scroll position is always in valid range
+ if (*pos > *lines)
+ *pos = *lines;
}
void wxScrollHelperNative::AdjustScrollbars()
{
- // this flag indicates which window has the scrollbars
- m_win->m_hasScrolling = m_xScrollPixelsPerLine != 0 ||
- m_yScrollPixelsPerLine != 0;
-
int vw, vh;
- m_targetWindow->GetVirtualSize( &vw, &vh );
+ m_targetWindow->GetVirtualSize(&vw, &vh);
+
+ int w, h;
+ const wxSize availSize = GetSizeAvailableForScrollTarget(
+ m_win->GetSize() - m_win->GetWindowBorderSize());
+ if ( availSize.x >= vw && availSize.y >= vh )
+ {
+ w = availSize.x;
+ h = availSize.y;
+
+ // we know that the scrollbars will be removed
+ DoAdjustHScrollbar(w, vw);
+ DoAdjustVScrollbar(h, vh);
+
+ return;
+ }
- int w;
m_targetWindow->GetClientSize(&w, NULL);
DoAdjustHScrollbar(w, vw);
- int h;
m_targetWindow->GetClientSize(NULL, &h);
DoAdjustVScrollbar(h, vh);