return height;
}
-size_t wxVScrolledWindow::FindFirstFromBottom(size_t lineLast)
+size_t wxVScrolledWindow::FindFirstFromBottom(size_t lineLast, bool full)
{
const wxCoord hWindow = GetClientSize().y;
if ( h > hWindow )
{
- lineFirst++;
+ // for this line to be fully visible we need to go one line
+ // down, but if it is enough for it to be only partly visible then
+ // this line will do as well
+ if ( full )
+ {
+ lineFirst++;
+ }
break;
}
count/2 + NUM_LINES_TO_SAMPLE/2);
// use the height of the lines we looked as the average
- m_heightTotal = ((float)m_heightTotal / (3*NUM_LINES_TO_SAMPLE)) *
- m_lineMax;
+ m_heightTotal = (wxCoord)
+ (((float)m_heightTotal / (3*NUM_LINES_TO_SAMPLE)) * m_lineMax);
}
RefreshRect(rect);
}
+void wxVScrolledWindow::RefreshAll()
+{
+ UpdateScrollbar();
+
+ Refresh();
+}
+
int wxVScrolledWindow::HitTest(wxCoord WXUNUSED(x), wxCoord y) const
{
const size_t lineMax = GetLastVisibleLine();
// determine the real first line to scroll to: we shouldn't scroll beyond
// the end
- size_t lineFirstLast = FindFirstFromBottom(m_lineMax - 1);
+ size_t lineFirstLast = FindFirstFromBottom(m_lineMax - 1, true);
if ( line > lineFirstLast )
line = lineFirstLast;
}
ScrollToLine(lineFirstNew);
+
+#ifdef __WXMAC__
+ Update();
+#endif // __WXMAC__
}