scrollable
The scrollable class provides an interface to manage properties and actions of scrollable widgets.
Hierarchy
ℹ️ Important
- This class inherit from the
widgetclass - This class is a transition class between the
widgetclass and scrollable more specific classes likeinput,hList,listbox… - Normally, you'll never have to instantiate the **cs.**scrollable class, since instantiation is automatic with a more specialized widget.
- To simplify the distinction between form objects and object type, this documentation uses the term
widgetfor all form objects, whether static (a line, a rectangle…) or not (a button, a subform…). - All functions that return
Thisreturn the current widget object and can include one call after another.
Properties & Functions
Inherited properties and functions are described in the parent classes:
Properties
| Properties | Description | Type | Writable |
|---|---|---|---|
| .horizontalPosition | Position of the horizontal control bar*** | Integer | ✓ |
| .horizontalScrollbar | Status of horizontal control bar. - When reading, returns True if status is Always or Automatic. - When writing, set status to Always. |
Boolean | ✓ |
| .horizontalScrollbarAuto | Automatic mode status of horizontal control bar* | Boolean | ✓ |
| .scroll | The current scroll position(s). | Scroll object if supports horizontal scrolling Integer if not |
x |
| .scrollbars | The current state of the toolbar display. | Scrollbars object |
x |
| .verticalPosition | Position of the vertical control bar. | Integer | ✓ |
| .verticalScrollbar | Status of vertical control bar. - When reading, returns True if status is Always or Automatic. - When writing, set status to Always. |
Boolean | ✓ |
| .verticalScrollbarAuto | Automatic mode status of vertical control bar* | Boolean | ✓ |
Functions
| Function | Action |
|---|---|
| .getScrollbars () → Scrollbars object | Update the scrollbars property & returns the current status. |
.setScrollbars (horizontal* ; vertical* ) →This |
To display or hide the horizontal and vertical scrollbars of the widget |
.setHorizontalScrollbar (display** ) →This |
Show or hide the widget’s horizontal scroll bar |
.setVerticalScrollbar (display** ) →This |
Show or hide the widget’s vertical scroll bar |
.noScrollbar ( ) →This |
To remove horizontal & vertical scrollbar of the widget |
.getScrollPosition () → Scroll object |Integer |
Returns the position of the scroll bars of the widget & update the scroll property. |
.setScrollPosition (vertical {; horizontal***} {; firstPosition }) →This |
Sets the position of the scroll bars of the widget & update the scroll property.The firstPosition parameter allow to isplay of line (and column if the horizontal parameter is passed) in 1st position after scroll |
* Only Image, Hierarchical list and Listbox support automatic scrollbars.
** Could be either a Boolean or an Integer value (0,1 or 2) to access to the automatic mode, where scrollbars are only displayed when necessary..
*** Only Image and Listbox support horizontal position.
Scrollbars object
{
vertical: Integer,
horizontal: Integer,
horizontalAuto: Boolean,
verticalAuto: Boolean
}
Values for horizontal & vertical could be:
= 0: Hide
= 1: Show
= 2: Automatic
Scroll object
{
vertical: (px),
horizontal: (px)
}