This class provides functions wrapping the wx.VarScrollHelperBase class, targeted for horizontal-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.HScrolledWindow rather than from here directly.
See also
wx.HScrolledWindow, wx.HVScrolledWindow, wx.VScrolledWindow
wx.HScrolledWindow, wx.VarHVScrollHelper
Constructor taking the target window to be scrolled by this helper class. |
|
This class forwards calls from |
|
Returns the number of columns the target window contains. |
|
Returns the index of the first visible column based on the scroll position. |
|
Returns the index of the last visible column based on the scroll position. |
|
Returns |
|
This function must be overridden in the derived class, and should return the width of the given column in pixels. |
|
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. |
|
Triggers a refresh for just the given column’s area of the window if it’s visible. |
|
Triggers a refresh for the area between the specified range of columns given (inclusively). |
|
Scroll by the specified number of pages which may be positive (to scroll right) or negative (to scroll left). |
|
Scroll by the specified number of columns which may be positive (to scroll right) or negative (to scroll left). |
|
Scroll to the specified column. |
|
Set the number of columns the window contains. |
See |
|
wx.
VarHScrollHelper
(VarScrollHelperBase)¶Possible constructors:
VarHScrollHelper(winToScroll)
This class provides functions wrapping the VarScrollHelperBase class, targeted for horizontal-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) –
EstimateTotalWidth
(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.
GetColumnCount
(self)¶Returns the number of columns the target window contains.
int
See also
GetVisibleColumnsBegin
(self)¶Returns the index of the first visible column based on the scroll position.
int
GetVisibleColumnsEnd
(self)¶Returns the index of the last visible column based on the scroll position.
This includes the last column even if it is only partially visible.
int
IsColumnVisible
(self, column)¶Returns True
if the given column is currently visible (even if only partially visible) or False
otherwise.
column (int) –
bool
OnGetColumnWidth
(self, column)¶This function must be overridden in the derived class, and should return the width of the given column in pixels.
column (int) –
wx.Coord
OnGetColumnsWidthHint
(self, columnMin, columnMax)¶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 columnMin is inclusive, while columnMax is exclusive.
columnMin (int) –
columnMax (int) –
RefreshColumn
(self, column)¶Triggers a refresh for just the given column’s area of the window if it’s visible.
column (int) –
RefreshColumns
(self, from_, to_)¶Triggers a refresh for the area between the specified range of columns given (inclusively).
from_ (int) –
to_ (int) –
ScrollColumnPages
(self, pages)¶Scroll by the specified number of pages which may be positive (to scroll right) or negative (to scroll left).
pages (int) –
bool
ScrollColumns
(self, columns)¶Scroll by the specified number of columns which may be positive (to scroll right) or negative (to scroll left).
columns (int) –
bool
True
if the window was scrolled, False
otherwise (for example, if we’re trying to scroll right but we are already showing the last column).
ScrollToColumn
(self, column)¶Scroll to the specified column.
It will become the first visible column in the window.
column (int) –
bool
True
if we scrolled the window, False
if nothing was done.
SetColumnCount
(self, columnCount)¶Set the number of columns the window contains.
The derived class must provide the widths for all columns with indices up to the one given here in it’s OnGetColumnWidth
implementation.
columnCount (int) –
See also
ColumnCount
¶See GetColumnCount
and SetColumnCount
VisibleColumnsBegin
¶VisibleColumnsEnd
¶