PtScrollArea

PtScrollArea — A compact display of a large virtual area.

Synopsis

class PtScrollArea PtContainer
{
    scroll_area_flags;          // flag  (Pt_ARG_SCROLL_AREA_FLAGS)    
    scroll_area_increment_x;    // unsigned short  (Pt_ARG_SCROLL_AREA_INCREMENT_X)    
    scroll_area_increment_y;    // unsigned short  (Pt_ARG_SCROLL_AREA_INCREMENT_Y)    
    scroll_area_max_x;          // unsigned short  (Pt_ARG_SCROLL_AREA_MAX_X)    
    scroll_area_max_y;          // unsigned short  (Pt_ARG_SCROLL_AREA_MAX_Y)    
    scroll_area_pos_x;          // unsigned short  (Pt_ARG_SCROLL_AREA_POS_X)    
    scroll_area_pos_y;          // unsigned short  (Pt_ARG_SCROLL_AREA_POS_Y)    
    scrollbar_x_display;        // unsigned short  (Pt_ARG_SCROLLBAR_X_DISPLAY)    
    scrollbar_x_height;         // unsigned short  (Pt_ARG_SCROLLBAR_X_HEIGHT)    
    scrollbar_y_display;        // unsigned short  (Pt_ARG_SCROLLBAR_Y_DISPLAY)    
    scrollbar_y_width;          // unsigned short  (Pt_ARG_SCROLLBAR_Y_WIDTH)    
}
		

Base Classes

PtWidget <-- PtBasic <-- PtContainer <-- PtScrollArea

Description

This widget is physical window that can display part of what is usually a larger virtual area. Scrollbars are provided for moving non-visible portions of the virtual area into the display area.

[Note]

For detailed information, please refer to PtScrollArea in the Photon documentation.

Instance Variables

scroll_area_flags

This instance variable controls scrolling behavior, and may be a combination of zero or more of the following flags:

ConstantDescription
Pt_SCROLL_AREA_IGNORE_KEYSMakes the scroll area ignore the PgUp, PgDn, Home, End and arrow keys.
Pt_SCROLL_AREA_TRACK_FOCUSEnables auto-scrolling to keep widgets visible when being moved.

scroll_area_increment_x, scroll_area_increment_y

A number specifying the number of pixels to scroll the display in the x or y direction when the scrollbar arrow is clicked. Default is 10.

scroll_area_max_x, scroll_area_max_y

A number specifying the maximum width (x) or height (y) of the widget's virtual display. The visible portion of this area can be specified with the inherited area variable.

scroll_area_pos_x, scroll_area_pos_y

A number of pixels specifying the horizontal (x) or vertical (y) position of the virtual area.

scrollbar_x_display, scrollbar_y_display

These instance variables control the whether horizontal (x) or vertical (y) scrollbars appear. Each variable may have one of the following values:

ConstantDescription
Pt_NEVERNever show the scrollbar.
Pt_ALWAYSAlways show the scrollbar.
Pt_AS_REQUIREDShow the scrollbar when the virtual area is greater than the display area.

scrollbar_x_height, scrollbar_y_width

A number of pixels specifying the scrollbar trough size, which means the trough height for horizontal scrollbars and trough width for vertical scrollbars. The minimum is 6. The default value, 0, sets the size to 15.

Callbacks

The following callbacks are associated with this widget:

CallbackDescription
Pt_CB_SCROLLED_XThis callback is generated when a PtScrollArea widget's horizontal scrollbar is moved.
Pt_CB_SCROLLED_YThis callback is generated when a PtScrollArea widget's vertical scrollbar is moved.