PtScrollbar

PtScrollbar — A sliding handle for navigating a scroll area.

Synopsis

class PtScrollbar PtBasic
{
    increment;          // long  (Pt_ARG_INCREMENT)    
    maximum;            // integer  (Pt_ARG_MAXIMUM)    
    min_slider_size;    // integer  (Pt_ARG_MIN_SLIDER_SIZE)    
    minimum;            // integer  (Pt_ARG_MINIMUM)    
    orientation;        // flags  (Pt_ARG_ORIENTATION)    
    page_increment;     // integer  (Pt_ARG_PAGE_INCREMENT)    
    scroll_position;    // integer  (Pt_ARG_SCROLL_POSITION)    
    scrollbar_flags;    // flag  (Pt_ARG_SCROLLBAR_FLAGS)    
    slider_size;        // integer  (Pt_ARG_SLIDER_SIZE)    
}
		

Base Classes

PtWidget <-- PtBasic <-- PtScrollbar

Description

This widget is a vertical or horizontal scrollbar with a handle that slides in a trough to set and show the position of the scroll area over the virtual area of a PtScrollArea widget. The scrollbar has arrow buttons at either end to move the handle.

The scrollbar trough represents a range of values, which is divided into integer increments. These increments are the unit of measure for the size, position, and movement of the handle. The number of increments is determined by the difference between the maximum and minimum variables.

[Note]

For additional information, please refer to PtScrollbar in the Photon documentation.

Instance Variables

increment

A number specifying the number of increments to move the handle when an arrow button is pressed. Default is 1.

maximum

An integer specifying the highest increment number, at the end of the scrollbar range. Default is 19. The total number of increments is calculated by subtracting the minimum value from this value.

min_slider_size

An integer specifying the minimum size (in pixels) that the handle is allowed to become. Default is 5 pixels.

minimum

An integer specifying the lowest increment number, at the beginning of the scrollbar range. Default is 0. The total number of increments is calculated by subtracting this value from the maximum value.

orientation

This instance variable determines the horizontal/vertical orientation of the scrollbar, and may have one of the following values:

ConstantDescription
Pt_HORIZONTALThe scrollbar is oriented horizontally.
Pt_VERTICALThe scrollbar is oriented vertically. This is the default.

page_increment

An integer that specifies the number of increments the handle moves when the trough is clicked. Default is -1, which causes the handle to move the distance of its own length.

scroll_position

An integer specifying the position of the top of the handle in the range.

scrollbar_flags

This instance variable specifies several scrollbar characteristics, and may be a combination of zero or more of the following flags:

ConstantDescription
Pt_SCROLLBAR_HORIZONTALChange the scrollbar from vertical to horizontal.
Pt_SCROLLBAR_SHOW_ARROWSShow arrow buttons at both ends of the scrollbar.
Pt_SCROLLBAR_INVERTEDInvert the scrolling mechanism: max/min or left/right.
Pt_SCROLLBAR_FOCUSEDRender the scrollbar as if it had focus, even when it doesn't.

slider_size

An integer specifying the number of increments to size the handle. Default is 20.

Callbacks

The following callbacks are associated with this widget:

CallbackDescription
Pt_CB_SCROLL_MOVEThis callback is generated when the scroll position changes.

Associated Classes

PtScrollbarCallback, PtCallbackInfo