+ // forward calls to OnGetColumnsWidthHint()
+ virtual void OnGetUnitsSizeHint(size_t unitMin, size_t unitMax) const
+ { return OnGetColumnsWidthHint(unitMin, unitMax); }
+
+ // again, if not overridden, it will fall back on default method
+ virtual wxCoord EstimateTotalWidth() const { return DoEstimateTotalSize(); }
+
+ // forward calls to EstimateTotalWidth()
+ virtual wxCoord EstimateTotalSize() const { return EstimateTotalWidth(); }
+
+ wxCoord GetColumnsWidth(size_t columnMin, size_t columnMax) const
+ { return GetUnitsSize(columnMin, columnMax); }
+};
+
+
+
+// ===========================================================================
+// wxVarHVScrollHelper
+// ===========================================================================
+
+// Provides public API functions targeted at functions with similar names in
+// both wxVScrollHelper and wxHScrollHelper so class scope doesn't need to be
+// specified (since we are using multiple inheritance). It also provides
+// functions to make changing values for both orientations at the same time
+// easier.
+
+class WXDLLEXPORT wxVarHVScrollHelper : public wxVarVScrollHelper,
+ public wxVarHScrollHelper
+{
+public:
+ // constructors and such
+ // ---------------------
+
+ // ctor must be given the associated window
+ wxVarHVScrollHelper(wxWindow *winToScroll)
+ : wxVarVScrollHelper(winToScroll), wxVarHScrollHelper(winToScroll) { }
+
+ // operators
+ // ---------
+
+ // set the number of units the window contains for each axis: the derived
+ // class must provide the widths and heights for all units with indices up
+ // to each of the one given here in its OnGetColumnWidth() and
+ // OnGetRowHeight()
+ void SetRowColumnCount(size_t rowCount, size_t columnCount);
+
+
+ // with physical scrolling on, the device origin is changed properly when
+ // a wxPaintDC is prepared, children are actually moved and laid out
+ // properly, and the contents of the window (pixels) are actually moved
+ void EnablePhysicalScrolling(bool vscrolling = true, bool hscrolling = true)
+ {
+ wxVarVScrollHelper::EnablePhysicalScrolling(vscrolling);
+ wxVarHScrollHelper::EnablePhysicalScrolling(hscrolling);
+ }
+
+ // scroll to the specified row/column: it will become the first visible
+ // cell in the window
+ //
+ // return true if we scrolled the window, false if nothing was done
+ bool ScrollToRowColumn(size_t row, size_t column);
+ bool ScrollToRowColumn(const wxPosition &pos)
+ { return ScrollToRowColumn(pos.GetRow(), pos.GetColumn()); }
+
+ // redraw the specified cell
+ virtual void RefreshRowColumn(size_t row, size_t column);
+ virtual void RefreshRowColumn(const wxPosition &pos)
+ { RefreshRowColumn(pos.GetRow(), pos.GetColumn()); }
+
+ // redraw the specified regions (inclusive). If the target window for
+ // both orientations is the same the rectangle of cells is refreshed; if
+ // the target windows differ the entire client size opposite the
+ // orientation direction is refreshed between the specified limits
+ virtual void RefreshRowsColumns(size_t fromRow, size_t toRow,
+ size_t fromColumn, size_t toColumn);
+ virtual void RefreshRowsColumns(const wxPosition& from,
+ const wxPosition& to)
+ {
+ RefreshRowsColumns(from.GetRow(), to.GetRow(),
+ from.GetColumn(), to.GetColumn());
+ }
+
+ // Override wxPanel::HitTest to use our version
+ virtual wxPosition HitTest(wxCoord x, wxCoord y) const;
+ virtual wxPosition HitTest(const wxPoint &pos) const
+ { return HitTest(pos.x, pos.y); }
+
+ // change the DC origin according to the scroll position. To properly
+ // forward calls to wxWindow::Layout use WX_FORWARD_TO_SCROLL_HELPER()
+ // derived class. We use this version to call both base classes'
+ // DoPrepareDC()
+ virtual void DoPrepareDC(wxDC& dc);
+
+ // replacement implementation of wxWindow::Layout virtual method. To
+ // properly forward calls to wxWindow::Layout use
+ // WX_FORWARD_TO_SCROLL_HELPER() derived class. We use this version to
+ // call both base classes' ScrollLayout()
+ bool ScrollLayout();