This class provides functions wrapping the wx.VarScrollHelperBase class, targeted for vertical-specific scrolling.
Like wx.VarScrollHelperBase, this class is mostly only useful to those classes built into wxWidgets deriving from here, and this documentation is mostly only provided for referencing the functions provided by this class. You will likely want to derive your window from wx.VScrolledWindow rather than from here directly.
See also
wx.HScrolledWindow, wx.HVScrolledWindow, wx.VScrolledWindow
wx.VarHVScrollHelper, wx.VScrolledWindow
Constructor taking the target window to be scrolled by this helper class. |
|
This class forwards calls from |
|
Returns the number of rows the target window contains. |
|
Returns the index of the first visible row based on the scroll position. |
|
Returns the index of the last visible row based on the scroll position. |
|
Returns |
|
This function must be overridden in the derived class, and should return the height of the given row in pixels. |
|
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. |
|
Triggers a refresh for just the given row’s area of the window if it’s visible. |
|
Triggers a refresh for the area between the specified range of rows given (inclusively). |
|
Scroll by the specified number of pages which may be positive (to scroll down) or negative (to scroll up). |
|
Scroll by the specified number of rows which may be positive (to scroll down) or negative (to scroll up). |
|
Scroll to the specified row. |
|
Set the number of rows the window contains. |
See |
|
wx.
VarVScrollHelper
(VarScrollHelperBase)¶Possible constructors:
VarVScrollHelper(winToScroll)
This class provides functions wrapping the VarScrollHelperBase class, targeted for vertical-specific scrolling.
__init__
(self, winToScroll)¶Constructor taking the target window to be scrolled by this helper class.
This will attach scroll event handlers to the target window to catch and handle scroll events appropriately.
winToScroll (wx.Window) –
EstimateTotalHeight
(self)¶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 wx.HVScrolledWindow derived class.
wx.Coord
Note
This function will not be called if EstimateTotalSize
is overridden in your derived class.
GetRowCount
(self)¶Returns the number of rows the target window contains.
int
See also
GetVisibleRowsBegin
(self)¶Returns the index of the first visible row based on the scroll position.
int
GetVisibleRowsEnd
(self)¶Returns the index of the last visible row based on the scroll position.
This includes the last row even if it is only partially visible.
int
IsRowVisible
(self, row)¶Returns True
if the given row is currently visible (even if only partially visible) or False
otherwise.
row (int) –
bool
OnGetRowHeight
(self, row)¶This function must be overridden in the derived class, and should return the height of the given row in pixels.
row (int) –
wx.Coord
OnGetRowsHeightHint
(self, rowMin, rowMax)¶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 rowMin is inclusive, while rowMax is exclusive.
rowMin (int) –
rowMax (int) –
RefreshRow
(self, row)¶Triggers a refresh for just the given row’s area of the window if it’s visible.
row (int) –
RefreshRows
(self, from_, to_)¶Triggers a refresh for the area between the specified range of rows given (inclusively).
from_ (int) –
to_ (int) –
ScrollRowPages
(self, pages)¶Scroll by the specified number of pages which may be positive (to scroll down) or negative (to scroll up).
pages (int) –
bool
ScrollRows
(self, rows)¶Scroll by the specified number of rows which may be positive (to scroll down) or negative (to scroll up).
rows (int) –
bool
True
if the window was scrolled, False
otherwise (for example, if we’re trying to scroll down but we are already showing the last row).
ScrollToRow
(self, row)¶Scroll to the specified row.
It will become the first visible row in the window.
row (int) –
bool
True
if we scrolled the window, False
if nothing was done.
SetRowCount
(self, rowCount)¶Set the number of rows the window contains.
The derived class must provide the heights for all rows with indices up to the one given here in it’s OnGetRowHeight
implementation.
rowCount (int) –
See also
RowCount
¶See GetRowCount
and SetRowCount
VisibleRowsBegin
¶VisibleRowsEnd
¶