X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/551266a969c28562e73c96941f2c7d83fa3eb282..850e47aa3c20c22ff650e80e92e7795a66431863:/interface/wx/vscroll.h diff --git a/interface/wx/vscroll.h b/interface/wx/vscroll.h index fd087d9d22..b7c9b1029a 100644 --- a/interface/wx/vscroll.h +++ b/interface/wx/vscroll.h @@ -74,21 +74,6 @@ public: */ void EnablePhysicalScrolling(bool scrolling = true); - /** - When the number of scroll units change, we try to estimate the total - size of all units when the full window size is needed (i.e. to - calculate the scrollbar thumb size). This is a rather expensive - operation in terms of unit access, so if the user code may estimate the - average size better or faster than we do, it should override this - function to implement its own logic. This function should return the - best guess for the total virtual window size. - - @note Although returning a totally wrong value would still work, it - risks resulting in very strange scrollbar behaviour so this - function should really try to make the best guess possible. - */ - virtual wxCoord EstimateTotalSize() const; - /** This function needs to be overridden in the in the derived class to return the window size with respect to the opposing orientation. If @@ -96,13 +81,13 @@ public: @see GetOrientationTargetSize() */ - virtual int GetNonOrientationTargetSize() const; + virtual int GetNonOrientationTargetSize() const = 0; /** This function need to be overridden to return the orientation that this helper is working with, either @c wxHORIZONTAL or @c wxVERTICAL. */ - virtual wxOrientation GetOrientation() const; + virtual wxOrientation GetOrientation() const = 0; /** This function needs to be overridden in the in the derived class to @@ -112,7 +97,7 @@ public: @see GetNonOrientationTargetSize() */ - virtual int GetOrientationTargetSize() const; + virtual int GetOrientationTargetSize() const = 0; /** This function will return the target window this helper class is @@ -141,23 +126,6 @@ public: */ bool IsVisible(size_t unit) const; - /** - This function doesn't have to be overridden but it may be useful to do - so if calculating the units' sizes is a relatively expensive operation - as it gives your code a chance to calculate several of them at once and - cache the result if necessary. - - OnGetUnitsSizeHint() is normally called just before OnGetUnitSize() but - you shouldn't rely on the latter being called for all units in the - interval specified here. It is also possible that OnGetUnitSize() will - be called for units outside of this interval, so this is really just a - hint, not a promise. - - Finally, note that @a unitMin is inclusive, while @a unitMax is - exclusive. - */ - virtual void OnGetUnitsSizeHint(size_t unitMin, size_t unitMax) const; - /** Recalculate all parameters and repaint all units. */ @@ -188,11 +156,43 @@ public: protected: + /** + This function doesn't have to be overridden but it may be useful to do + so if calculating the units' sizes is a relatively expensive operation + as it gives your code a chance to calculate several of them at once and + cache the result if necessary. + + OnGetUnitsSizeHint() is normally called just before OnGetUnitSize() but + you shouldn't rely on the latter being called for all units in the + interval specified here. It is also possible that OnGetUnitSize() will + be called for units outside of this interval, so this is really just a + hint, not a promise. + + Finally, note that @a unitMin is inclusive, while @a unitMax is + exclusive. + */ + virtual void OnGetUnitsSizeHint(size_t unitMin, size_t unitMax) const; + + /** + When the number of scroll units change, we try to estimate the total + size of all units when the full window size is needed (i.e. to + calculate the scrollbar thumb size). This is a rather expensive + operation in terms of unit access, so if the user code may estimate the + average size better or faster than we do, it should override this + function to implement its own logic. This function should return the + best guess for the total virtual window size. + + @note Although returning a totally wrong value would still work, it + risks resulting in very strange scrollbar behaviour so this + function should really try to make the best guess possible. + */ + virtual wxCoord EstimateTotalSize() const; + /** This function must be overridden in the derived class, and should return the size of the given unit in pixels. */ - virtual wxCoord OnGetUnitSize(size_t unit) const; + virtual wxCoord OnGetUnitSize(size_t unit) const = 0; }; @@ -224,17 +224,6 @@ public: */ wxVarVScrollHelper(wxWindow* winToScroll); - /** - This class forwards calls from EstimateTotalSize() to this function so - derived classes can override either just the height or the width - estimation, or just estimate both differently if desired in any - wxHVScrolledWindow derived class. - - @note This function will not be called if EstimateTotalSize() is - overridden in your derived class. - */ - virtual wxCoord EstimateTotalHeight() const; - /** Returns the number of rows the target window contains. @@ -260,23 +249,6 @@ public: */ bool IsRowVisible(size_t row) const; - /** - This function doesn't have to be overridden but it may be useful to do - so if calculating the rows' sizes is a relatively expensive operation - as it gives your code a chance to calculate several of them at once and - cache the result if necessary. - - OnGetRowsHeightHint() is normally called just before OnGetRowHeight() - but you shouldn't rely on the latter being called for all rows in the - interval specified here. It is also possible that OnGetRowHeight() will - be called for units outside of this interval, so this is really just a - hint, not a promise. - - Finally, note that @a rowMin is inclusive, while @a rowMax is - exclusive. - */ - virtual void OnGetRowsHeightHint(size_t rowMin, size_t rowMax) const; - /** Triggers a refresh for just the given row's area of the window if it's visible. @@ -324,11 +296,39 @@ public: protected: + /** + This function doesn't have to be overridden but it may be useful to do + so if calculating the rows' sizes is a relatively expensive operation + as it gives your code a chance to calculate several of them at once and + cache the result if necessary. + + OnGetRowsHeightHint() is normally called just before OnGetRowHeight() + but you shouldn't rely on the latter being called for all rows in the + interval specified here. It is also possible that OnGetRowHeight() will + be called for units outside of this interval, so this is really just a + hint, not a promise. + + Finally, note that @a rowMin is inclusive, while @a rowMax is + exclusive. + */ + virtual void OnGetRowsHeightHint(size_t rowMin, size_t rowMax) const; + + /** + This class forwards calls from EstimateTotalSize() to this function so + derived classes can override either just the height or the width + estimation, or just estimate both differently if desired in any + wxHVScrolledWindow derived class. + + @note This function will not be called if EstimateTotalSize() is + overridden in your derived class. + */ + virtual wxCoord EstimateTotalHeight() const; + /** This function must be overridden in the derived class, and should return the height of the given row in pixels. */ - virtual wxCoord OnGetRowHeight(size_t row) const; + virtual wxCoord OnGetRowHeight(size_t row) const = 0; }; @@ -360,17 +360,6 @@ public: */ wxVarHScrollHelper(wxWindow* winToScroll); - /** - This class forwards calls from EstimateTotalSize() to this function so - derived classes can override either just the height or the width - estimation, or just estimate both differently if desired in any - wxHVScrolledWindow derived class. - - @note This function will not be called if EstimateTotalSize() is - overridden in your derived class. - */ - virtual wxCoord EstimateTotalWidth() const; - /** Returns the number of columns the target window contains. @@ -397,24 +386,6 @@ public: */ bool IsColumnVisible(size_t column) const; - /** - This function doesn't have to be overridden but it may be useful to do - so if calculating the columns' sizes is a relatively expensive - operation as it gives your code a chance to calculate several of them - at once and cache the result if necessary. - - OnGetColumnsWidthHint() is normally called just before - OnGetColumnWidth() but you shouldn't rely on the latter being called - for all columns in the interval specified here. It is also possible - that OnGetColumnWidth() will be called for units outside of this - interval, so this is really just a hint, not a promise. - - Finally, note that @a columnMin is inclusive, while @a columnMax is - exclusive. - */ - virtual void OnGetColumnsWidthHint(size_t columnMin, - size_t columnMax) const; - /** Triggers a refresh for just the given column's area of the window if it's visible. @@ -462,11 +433,40 @@ public: protected: + /** + This class forwards calls from EstimateTotalSize() to this function so + derived classes can override either just the height or the width + estimation, or just estimate both differently if desired in any + wxHVScrolledWindow derived class. + + @note This function will not be called if EstimateTotalSize() is + overridden in your derived class. + */ + virtual wxCoord EstimateTotalWidth() const; + + /** + This function doesn't have to be overridden but it may be useful to do + so if calculating the columns' sizes is a relatively expensive + operation as it gives your code a chance to calculate several of them + at once and cache the result if necessary. + + OnGetColumnsWidthHint() is normally called just before + OnGetColumnWidth() but you shouldn't rely on the latter being called + for all columns in the interval specified here. It is also possible + that OnGetColumnWidth() will be called for units outside of this + interval, so this is really just a hint, not a promise. + + Finally, note that @a columnMin is inclusive, while @a columnMax is + exclusive. + */ + virtual void OnGetColumnsWidthHint(size_t columnMin, + size_t columnMax) const; + /** This function must be overridden in the derived class, and should return the width of the given column in pixels. */ - virtual wxCoord OnGetColumnWidth(size_t column) const; + virtual wxCoord OnGetColumnWidth(size_t column) const = 0; }; @@ -629,7 +629,7 @@ public: shifted so the first visible row always appears at the point (0, 0) in physical as well as logical coordinates. - @section wxWidgets 2.8 Compatibility Functions + @section vscrolledwindow_compat wxWidgets 2.8 Compatibility Functions The following functions provide backwards compatibility for applications originally built using wxVScrolledWindow in 2.6 or 2.8. Originally,