Scroll to navigation

Prima::Widget::GroupScroller(3) User Contributed Perl Documentation Prima::Widget::GroupScroller(3)

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 maintenance. The class is the descendant of Prima::IntIndents, and adjusts the indents property when scrollbars are shown or hidden, or borderWidth is changed.

The class does not provide range selection for the scrollbars; the descentant classes must implement that.

The descendant classes must follow the guidelines:

  • A class must provide "borderWidth", "hScroll", and "vScroll" property keys in profile_default() . A class may provide "autoHScroll" and "autoVScroll" property keys in profile_default() .
  • A class' init() method must set "{borderWidth}", "{hScroll}", and "{vScroll}" variables to 0 before the initialization, call "setup_indents" method, and then assign the properties from the object profile.

    If a class provides "autoHScroll" and "autoVScroll" properties, these must be set to 0 before the initialization.

  • If a class needs to overload one of "borderWidth", "hScroll", "vScroll", "autoHScroll", and "autoVScroll" properties, it is mandatory to call the inherited properties.
  • A class must implement the scroll bar notification callbacks: "HScroll_Change" and "VScroll_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 storage
        

    The reserved method names:

            set_h_scroll
            set_v_scroll
            insert_bone
            setup_indents
            reset_indents
            borderWidth
            autoHScroll
            autoVScroll
            hScroll
            vScroll
        

    The reserved widget names:

            HScroll
            VScroll
            Bone
        

Properties

Selects if the horizontal scrollbar is to be shown and hidden dynamically, depending on the widget layout.
Selects if the vertical scrollbar is to be shown and hidden dynamically, depending on the widget layout.
Width of 3d-shade border around the widget.

Recommended default value: 2

Selects if the horizontal scrollbar is visible. If it is, "{hScrollBar}" points to it.
Selects if the vertical scrollbar is visible. If it is, "{vScrollBar}" points to it.
Create-only property that allows to change scrollbar class
Create-only property that allows to change scrollbar parameters when it is being created

Methods

The method is never called directly; it should be called whenever widget layout is changed so that indents are affected. The method is a request to recalculate indents, depending on the widget layout.

The method is not reentrant; to receive this callback and update the widget layout, that in turn can result in more "setup_indents" calls, overload "reset_indents" .

Called after "setup_indents" is called and internal widget layout is updated, to give a chance to follow-up the layout changes.

AUTHOR

Dmitry Karasik, <dmitry@karasik.eu.org>.

SEE ALSO

Prima, Prima::Lists, Prima::Edit

2023-09-05 perl v5.26.1