- // same as the previous ctor but returns status code: true if ok
- //
- // just as with the ctor above, wxVSCROLL and wxHSCROLL styles are always
- // used, there is no need to specify them
- bool Create(wxWindow *parent,
- wxWindowID id = wxID_ANY,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxPanelNameStr)
+ // operators
+
+ void SetRowCount(size_t rowCount) { SetUnitCount(rowCount); }
+ bool ScrollToRow(size_t row) { return DoScrollToUnit(row); }
+
+ virtual bool ScrollRows(int rows)
+ { return DoScrollUnits(rows); }
+ virtual bool ScrollRowPages(int pages)
+ { return DoScrollPages(pages); }
+
+ virtual void RefreshRow(size_t row)
+ { RefreshUnit(row); }
+ virtual void RefreshRows(size_t from, size_t to)
+ { RefreshUnits(from, to); }
+
+ // accessors
+
+ size_t GetRowCount() const { return GetUnitCount(); }
+ size_t GetVisibleRowsBegin() const { return GetVisibleBegin(); }
+ size_t GetVisibleRowsEnd() const { return GetVisibleEnd(); }
+ bool IsRowVisible(size_t row) const { return IsVisible(row); }
+
+ virtual int GetOrientationTargetSize() const
+ { return GetTargetWindow()->GetClientSize().y; }
+ virtual int GetNonOrientationTargetSize() const
+ { return GetTargetWindow()->GetClientSize().x; }
+ virtual wxOrientation GetOrientation() const { return wxVERTICAL; }
+
+protected:
+ // this function must be overridden in the derived class and it should
+ // return the size of the given row in pixels
+ virtual wxCoord OnGetRowHeight(size_t n) const = 0;
+ wxCoord OnGetUnitSize(size_t n) const { return OnGetRowHeight(n); }
+
+ virtual void OnGetRowsHeightHint(size_t WXUNUSED(rowMin),
+ size_t WXUNUSED(rowMax)) const { }
+
+ // forward calls to OnGetRowsHeightHint()
+ virtual void OnGetUnitsSizeHint(size_t unitMin, size_t unitMax) const
+ { OnGetRowsHeightHint(unitMin, unitMax); }
+
+ // again, if not overridden, it will fall back on default method
+ virtual wxCoord EstimateTotalHeight() const
+ { return DoEstimateTotalSize(); }
+
+ // forward calls to EstimateTotalHeight()
+ virtual wxCoord EstimateTotalSize() const { return EstimateTotalHeight(); }
+
+ wxCoord GetRowsHeight(size_t rowMin, size_t rowMax) const
+ { return GetUnitsSize(rowMin, rowMax); }
+};
+
+
+
+// ===========================================================================
+// wxVarHScrollHelper
+// ===========================================================================
+
+// Provides public API functions targeted for horizontal-specific scrolling,
+// wrapping the functionality of wxVarScrollHelperBase.
+
+class WXDLLEXPORT wxVarHScrollHelper : public wxVarScrollHelperBase
+{
+public:
+ // constructors and such
+ // ---------------------
+
+ // ctor must be given the associated window
+ wxVarHScrollHelper(wxWindow *winToScroll)
+ : wxVarScrollHelperBase(winToScroll)