+}
+
+int wxVarScrollHelperBase::DoCalcScrolledPosition(int coord) const
+{
+ return coord - GetScrollOffset();
+}
+
+int wxVarScrollHelperBase::DoCalcUnscrolledPosition(int coord) const
+{
+ return coord + GetScrollOffset();
+}
+
+#if wxUSE_MOUSEWHEEL
+
+void wxVarScrollHelperBase::HandleOnMouseWheel(wxMouseEvent& event)
+{
+ // we only want to process wheel events for vertical implementations.
+ // There is no way to determine wheel orientation (and on MSW horizontal
+ // wheel rotation just fakes scroll events, rather than sending a MOUSEWHEEL
+ // event).
+ if ( GetOrientation() != wxVERTICAL )
+ return;
+
+ m_sumWheelRotation += event.GetWheelRotation();
+ int delta = event.GetWheelDelta();
+
+ // how much to scroll this time
+ int units_to_scroll = -(m_sumWheelRotation/delta);
+ if ( !units_to_scroll )
+ return;
+
+ m_sumWheelRotation += units_to_scroll*delta;
+
+ if ( !event.IsPageScroll() )
+ DoScrollUnits( units_to_scroll*event.GetLinesPerAction() );
+ else // scroll pages instead of units
+ DoScrollPages( units_to_scroll );
+}
+
+#endif // wxUSE_MOUSEWHEEL
+
+
+// ============================================================================
+// wxVarHVScrollHelper implementation
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// wxVarHVScrollHelper operations
+// ----------------------------------------------------------------------------
+
+void wxVarHVScrollHelper::SetRowColumnCount(size_t rowCount, size_t columnCount)
+{
+ SetRowCount(rowCount);
+ SetColumnCount(columnCount);
+}
+
+bool wxVarHVScrollHelper::ScrollToRowColumn(size_t row, size_t column)
+{
+ bool result = false;
+ result |= ScrollToRow(row);
+ result |= ScrollToColumn(column);
+ return result;
+}
+
+void wxVarHVScrollHelper::RefreshRowColumn(size_t row, size_t column)
+{
+ // is this unit visible?
+ if ( !IsRowVisible(row) || !IsColumnVisible(column) )
+ {
+ // no, it is useless to do anything
+ return;
+ }
+
+ // calculate the rect occupied by this cell on screen
+ wxRect v_rect, h_rect;
+ v_rect.height = OnGetRowHeight(row);
+ h_rect.width = OnGetColumnWidth(column);
+
+ size_t n;
+
+ for ( n = GetVisibleRowsBegin(); n < row; n++ )