PtGenList

PtGenList — A parent class for list and tree widget resources.

Synopsis

class PtGenList PtContainer
{
    balloon_color;           // color  (Pt_ARG_BALLOON_COLOR)    
    balloon_fill_color;      // color  (Pt_ARG_BALLOON_FILL_COLOR)    
    list_flags;              // flag  (Pt_ARG_LIST_FLAGS)    
    list_font;               // string  (Pt_ARG_LIST_FONT)    
    list_item_count;         // unsigned short  (Pt_ARG_LIST_ITEM_COUNT)    
    list_scroll_rate;        // short  (Pt_ARG_LIST_SCROLL_RATE)    
    list_sel_count;          // unsigned short  (Pt_ARG_LIST_SEL_COUNT)    
    list_total_height;       // unsigned short  (Pt_ARG_LIST_TOTAL_HEIGHT)    
    scrollbar_width;         // unsigned short  (Pt_ARG_SCROLLBAR_WIDTH)    
    selection_fill_color;    // color  (Pt_ARG_SELECTION_FILL_COLOR)    
    selection_mode;          // unsigned short  (Pt_ARG_SELECTION_MODE)    
    selection_text_color;    // color  (Pt_ARG_SELECTION_TEXT_COLOR)    
    top_item_pos;            // unsigned short  (Pt_ARG_TOP_ITEM_POS)    
    visible_count;           // unsigned short  (Pt_ARG_VISIBLE_COUNT)    
}
		

Base Classes

PtWidget <-- PtBasic <-- PtContainer <-- PtGenList

Derived Classes

PtGenTree, PtList

Description

This class serves as a parent class of resources for list widgets, and is not normally instantiated.

[Note]

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

Instance Variables

balloon_color

A number specifying the balloon's text color. Default is 0xc814 (green).

balloon_fill_color

A number specifying the balloon's background fill color. Default is 0xc814 (green).

list_flags

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

ConstantDescription
Pt_LIST_SCROLLBAR_NEVERScrollbar Never
Pt_LIST_SCROLLBAR_ALWAYSA scrollbar is always displayed.
Pt_LIST_SCROLLBAR_AS_REQUIREDA scrollbar is only displayed when required.
Pt_LIST_INACTIVEInactivates the list.
Pt_LIST_NON_SELECTRestricts the list to read-only.
Pt_LIST_SNAPSnaps the list to fit the number of items.
Pt_LIST_BALLOON_NEVERInternal informational bit.
Pt_LIST_SHOW_BALLOONShows list balloons.
Pt_LIST_BALLOON_AS_REQUIREDShows list balloons if list is clipped.
Pt_LIST_BALLOON_REGISTEREDInternal informational bit.
Pt_LIST_SCROLLBAR_GETS_FOCUSGives focus to the scrollbar.
Pt_LIST_NOBLITPrevents flushing and blitting when Pt_ARG_TOP_ITEM_POS changes.

list_font

A string specifying the font used for list items. Default is "helv12".

list_item_count

A number specifying the number of items in the list.

list_scroll_rate

A number specifying the rate of scrolling. Default is 2. Set it to 1 to scroll faster, set it higher to scroll slower.

list_sel_count

A read-only number of list items.

list_total_height

A read-only number indicating the total height in pixels of all list items.

scrollbar_width

A number of pixels specifying the width of the scrollbar. Default is 15. When set to 0, the default is used as well.

selection_fill_color

A number specifying the fill color for selected items. Default is 0xff (blue).

selection_mode

A constant specifying the way items are chosen from the list, with mouse or keyboard. If a mouse is not used, the Up and Down arrows on the numeric keypad move the selection highlight, and pressing the Enter key makes the selection.

This instance variable may have one of the following values:

ConstantDescription
Pt_SINGLE_MODEAllows selection of one item by clicking on it.
Pt_MULTIPLE_MODEAllows selection of multiple items by clicking on them. A second click releases a selected item.
Pt_BROWSE_MODEAllows selection of one item by clicking on it, or dragging down and releasing. This is the default.
Pt_EXTENDED_MODEAllows selection of a range of items with Shift-click, or multiple disjoint items with Ctrl-click.
Pt_RANGE_MODEAllows selection of a range of items by dragging from the first to the last; the list will scroll.

In addition to the constant above, this instance variable may also have zero or more of the following flags:

ConstantDescription
Pt_SELECTION_MODE_MULTIPLEAllows multiple items to be selected independently.
Pt_SELECTION_MODE_RANGEAllows selection of a range of items.
Pt_SELECTION_MODE_SINGLEAllows selection of a single item.
Pt_SELECTION_MODE_NONESelection is done by callback.
Pt_SELECTION_MODE_NOSCROLLPrevents scrolling during drag operations.
Pt_SELECTION_MODE_NOMOVEHolds the item still during drag operations.
Pt_SELECTION_MODE_NORESTMaintains the existing state if the mouse button is released outside the widget.
Pt_SELECTION_MODE_AUTOSelection is done by keyboard, unless the Ctrl key is used.
Pt_SELECTION_MODE_NOCLEARIn Pt_SELECTION_MODE, doesn't clear existing selection when new selection is made.
Pt_SELECTION_MODE_TOGGLEFor Pt_SINGLE_MODE and Pt_MULTIPLE_MODE, mouse clicks toggle select/unselect.
Pt_SELECTION_MODE_NOFOCUSFor Pt_SELECTION_MODE_AUTO, the current item is not automatically selected when the widget gets focus.
Pt_SELECTION_MODE_COMPOSE_FLAGInternal informational bit.
Pt_SELECTION_MODE_COMPOSE_MASKInternal informational bit.

selection_text_color

A number specifying the color of text for selected items. Default is 0xffffff (white).

top_item_pos

An integer specifying the index number of the item to appear at the top of the list. (Items are numbered consecutively, starting at one.) Default is 1, the first item.

visible_count

A read-only number indicating the number of currently visible items. Default is 0.