void wxScrollHelper::GetVirtualSize (int *x, int *y) const
{
+ wxSize sz(0, 0);
+ if (m_targetWindow)
+ sz = m_targetWindow->GetClientSize();
+
if ( x )
- *x = m_xScrollPixelsPerLine * m_xScrollLines;
+ {
+ if (m_xScrollPixelsPerLine == 0)
+ *x = sz.x;
+ else
+ *x = m_xScrollPixelsPerLine * m_xScrollLines;
+ }
if ( y )
- *y = m_yScrollPixelsPerLine * m_yScrollLines;
+ {
+ if (m_yScrollPixelsPerLine == 0)
+ *y = sz.y;
+ else
+ *y = m_yScrollPixelsPerLine * m_yScrollLines;
+ }
}
// Where the current view starts from
*y = m_yScrollPosition;
}
-void wxScrollHelper::CalcScrolledPosition(int x, int y, int *xx, int *yy) const
+void wxScrollHelper::DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const
{
if ( xx )
*xx = x - m_xScrollPosition * m_xScrollPixelsPerLine;
*yy = y - m_yScrollPosition * m_yScrollPixelsPerLine;
}
-void wxScrollHelper::CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
+void wxScrollHelper::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
{
if ( xx )
*xx = x + m_xScrollPosition * m_xScrollPixelsPerLine;
GetSizer()->SetDimension(x, y, w, h);
return TRUE;
}
- else
- return wxPanel::Layout(); // fall back to default for LayoutConstraints
+
+ // fall back to default for LayoutConstraints
+ return wxPanel::Layout();
}
void wxGenericScrolledWindow::OnPaint(wxPaintEvent& event)