Online documentation, manuals and tutorials
< All Topics
Print

ScrollBar

Description

This Widget can be used with List and Grid Widget for scrolling within large lists that do not fit entirely within said Widgets. If width > height then a horizontal ScrollBar is displayed:

Alt text

… and if width <= height then a vertical ScrollBar is displayed.

Alt text

The horizontal ScrollBar has left and right buttons, and the vertical top and bottom buttons.

This Widget connects to the List or Grid Widget via a variable of type struct:$ScrollbarState which is set in the Data property. The structure struct:$ScrollbarState has these fields:

  • numItems – how many items/elements are in the list
  • itemsPerPage – how many items fit inside the List or Grid Widget.
  • positionIncrement – determines how many items we will move within the list when the left/top button (shift to the left/up) or the right/bottom button (shift to the right/down) is selected.
  • position – the position of the first item/element that is rendered in the list. So within the List or Grid Widget, items from position to position + itemsPerPage will be rendered. position can be in the interval from 0 to numItems – itemsPerPage.

The scrollbar can change its `position’ in the following ways:

  • By selecting the Left/Top button position is decreased by the positionIncrement value.
  • By selecting Right/Bottom button position is increased by positionIncrement value.
  • By moving the thumb position is set to a value in the interval from 0 to numItems - itemsPerPage.
  • If the region between the Left/Top button and the thumb is selected, then the position is reduced by itemsPerPage (AKA “page up”).
  • If the region between the thumb and the Right/Bottom button is selected, then the position is increased by itemsPerPage (AKA “page down”).

Properties

Specific

Data

EXPRESSION (struct:$ScrollbarState)

Set here the name of the struct:$ScrollbarState type variable.

Left button text

String

The text that will be displayed inside the left/top button. Usually a single character from an icons font is used.

Right button text

String

The text that will be displayed inside the right/bottom button. Usually a single character from an icons font is used.

Visible

EXPRESSION (boolean)

If the calculated expression is true then the Widget is visible, and if it is false then the Widget is hidden. It can be left blank, in which case the Widget is always visible.

Examples

  • eez-gui-widgets-demo
Page content