X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3a74a290a9fcfafd93fd1a23e6857ad60836cb9d..71abf17edb285a2a028b473e723cd52f79d1fb29:/interface/wx/vscroll.h diff --git a/interface/wx/vscroll.h b/interface/wx/vscroll.h index a7164bad09..75c8a736a9 100644 --- a/interface/wx/vscroll.h +++ b/interface/wx/vscroll.h @@ -3,7 +3,7 @@ // Purpose: interface of wxVarHScrollHelper // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -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 @@ -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,6 +156,38 @@ 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. @@ -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,6 +296,34 @@ 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. @@ -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,6 +433,35 @@ 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. @@ -715,7 +715,7 @@ public: const wxString& name = wxPanelNameStr); /** - Same as the non-default constuctor, but returns a status code: @true if + Same as the non-default constructor, but returns a status code: @true if ok, @false if the window couldn't be created. Just as with the constructor, the @c wxVSCROLL style is always used, @@ -791,7 +791,7 @@ public: const wxString& name = wxPanelNameStr); /** - Same as the non-default constuctor, but returns a status code: @true if + Same as the non-default constructor, but returns a status code: @true if ok, @false if the window couldn't be created. Just as with the constructor, the @c wxHSCROLL style is always used, @@ -868,7 +868,7 @@ public: const wxString& name = wxPanelNameStr); /** - Same as the non-default constuctor, but returns a status code: @true if + Same as the non-default constructor, but returns a status code: @true if ok, @false if the window couldn't be created. Just as with the constructor, the @c wxHSCROLL and @c wxVSCROLL styles