PtGenList

Gamma/Photon: Using Gamma™ with the Photon microGUIŽ, Version 4.0
Prev |  | Next

# `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.

| 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:

  Constant | Description
  --- | ---
  `Pt_LIST_SCROLLBAR_NEVER` | Scrollbar Never
  `Pt_LIST_SCROLLBAR_ALWAYS` | A scrollbar is always displayed.
  `Pt_LIST_SCROLLBAR_AS_REQUIRED` | A scrollbar is only displayed when required.
  `Pt_LIST_INACTIVE` | Inactivates the list.
  `Pt_LIST_NON_SELECT` | Restricts the list to read-only.
  `Pt_LIST_SNAP` | Snaps the list to fit the number of items.
  `Pt_LIST_BALLOON_NEVER` | Internal informational bit.
  `Pt_LIST_SHOW_BALLOON` | Shows list balloons.
  `Pt_LIST_BALLOON_AS_REQUIRED` | Shows list balloons if list is clipped.
  `Pt_LIST_BALLOON_REGISTERED` | Internal informational bit.
  `Pt_LIST_SCROLLBAR_GETS_FOCUS` | Gives focus to the scrollbar.
  `Pt_LIST_NOBLIT` | Prevents 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:

  Constant | Description
  --- | ---
  `Pt_SINGLE_MODE` | Allows selection of one item by clicking on it.
  `Pt_MULTIPLE_MODE` | Allows selection of multiple items by clicking on them. A second click releases a selected item.
  `Pt_BROWSE_MODE` | Allows selection of one item by clicking on it, or dragging down and releasing. This is the default.
  `Pt_EXTENDED_MODE` | Allows selection of a range of items with Shift-click, or multiple disjoint items with Ctrl-click.
  `Pt_RANGE_MODE` | Allows 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:

  Constant | Description
  --- | ---
  `Pt_SELECTION_MODE_MULTIPLE` | Allows multiple items to be selected independently.
  `Pt_SELECTION_MODE_RANGE` | Allows selection of a range of items.
  `Pt_SELECTION_MODE_SINGLE` | Allows selection of a single item.
  `Pt_SELECTION_MODE_NONE` | Selection is done by callback.
  `Pt_SELECTION_MODE_NOSCROLL` | Prevents scrolling during drag operations.
  `Pt_SELECTION_MODE_NOMOVE` | Holds the item still during drag operations.
  `Pt_SELECTION_MODE_NOREST` | Maintains the existing state if the mouse button is released outside the widget.
  `Pt_SELECTION_MODE_AUTO` | Selection is done by keyboard, unless the Ctrl key is used.
  `Pt_SELECTION_MODE_NOCLEAR` | In `Pt_SELECTION_MODE`, doesn't clear existing selection when new selection is made.
  `Pt_SELECTION_MODE_TOGGLE` | For `Pt_SINGLE_MODE` and `Pt_MULTIPLE_MODE`, mouse clicks toggle select/unselect.
  `Pt_SELECTION_MODE_NOFOCUS` | For `Pt_SELECTION_MODE_AUTO`, the current item is not automatically selected when the widget gets focus.
  `Pt_SELECTION_MODE_COMPOSE_FLAG` | Internal informational bit.
  `Pt_SELECTION_MODE_COMPOSE_MASK` | Internal 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`.

Prev | Home | Next
`PtGauge` | Up | `PtGenTree`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.