+ virtual void RefreshColumn(size_t column)
+ { RefreshUnit(column); }
+ virtual void RefreshColumns(size_t from, size_t to)
+ { RefreshUnits(from, to); }
+ virtual int HitTest(wxCoord x) const
+ { return wxVarScrollHelperBase::HitTest(x); }
+
+ // accessors
+
+ size_t GetColumnCount() const
+ { return GetUnitCount(); }
+ size_t GetVisibleColumnsBegin() const
+ { return GetVisibleBegin(); }
+ size_t GetVisibleColumnsEnd() const
+ { return GetVisibleEnd(); }
+ bool IsColumnVisible(size_t column) const
+ { return IsVisible(column); }
+
+
+ virtual int GetOrientationTargetSize() const
+ { return GetTargetWindow()->GetClientSize().x; }
+ virtual int GetNonOrientationTargetSize() const
+ { return GetTargetWindow()->GetClientSize().y; }
+ virtual wxOrientation GetOrientation() const { return wxHORIZONTAL; }
+
+protected:
+ // this function must be overridden in the derived class and it should
+ // return the size of the given column in pixels
+ virtual wxCoord OnGetColumnWidth(size_t n) const = 0;
+ wxCoord OnGetUnitSize(size_t n) const { return OnGetColumnWidth(n); }
+
+ virtual void OnGetColumnsWidthHint(size_t WXUNUSED(columnMin),
+ size_t WXUNUSED(columnMax)) const
+ { }
+
+ // 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