NAME
Prima::Widget::GroupScroller - optional automatic scroll bars
DESCRIPTION
The class is used for widgets that contain optional scroll bars and provides means for their management. The class is the descendant of Prima::IntIndents and adjusts its indents property when scrollbars are shown, hidden, or borderWidth is changed.
The class does not provide range selection for the scrollbars; the descendant classes must implement that.
The descendant classes must follow the following guidelines:
A class may provide
borderWidth,hScroll,vScroll,autoHScroll, andautoVScrollproperty keys in profile_default() .A class' init() method must call the
setup_indentsmethodIf a class overrides the
autoHScrollandautoVScrollproperties, these must be set to 0 before the initialization.If a class needs to overload one of the
borderWidth,hScroll,vScroll,autoHScroll, andautoVScrollproperties, it is mandatory to call the inherited properties.A class must implement the scroll bar notification callbacks:
HScroll_ChangeandVScroll_Change.A class must not use the reserved variable names, which are:
{borderWidth} - internal borderWidth storage {hScroll} - internal hScroll value storage {vScroll} - internal vScroll value storage {hScrollBar} - pointer to the horizontal scroll bar {vScrollBar} - pointer to the vertical scroll bar {bone} - rectangular widget between the scrollbars {autoHScroll} - internal autoHScroll value storage {autoVScroll} - internal autoVScroll value storageThe reserved method names:
set_h_scroll set_v_scroll insert_bone setup_indents reset_indents borderWidth autoHScroll autoVScroll hScroll vScrollThe reserved widget names:
HScroll VScroll Bone
Properties
- autoHScroll BOOLEAN
-
Selects if the horizontal scrollbar is to be shown and hidden dynamically, depending on the widget layout.
- autoVScroll BOOLEAN
-
Selects if the vertical scrollbar is to be shown and hidden dynamically, depending on the widget layout.
- borderWidth INTEGER
-
Width of the border around the widget.
Depends on the
skinproperty. - hScroll BOOLEAN
-
Selects if the horizontal scrollbar is visible. If it is,
{hScrollBar}points to it. - vScroll BOOLEAN
-
Selects if the vertical scrollbar is visible. If it is,
{vScrollBar}points to it. - scrollBarClass STRING = Prima::ScrollBar
-
A create-only property that allows to change the scrollbar class
- hScrollBarProfile, vScrollBarProfile HASH
-
Create-only properties that allows to adjust the scrollbar parameters when the scrollbars are created
Methods
- setup_indents
-
The method is never called directly; it should be called whenever the widget layout is changed so that its indents are affected. The method is a request to recalculate indents, depending on the new widget layout.
The method is not reentrant; to receive this callback and update the widget layout that in turn can result in more
setup_indentscalls, overloadreset_indents. - reset_indents
-
Called after
setup_indentsupdates the internal widget layout, to give a chance to follow up the layout changes. Does not do anything by default.
AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>.