[Previous] [Contents] [Index] [Next]

PtGenListItem_t

PtGenList item structure

Synopsis:

typedef struct Pt_genlist_item {
     unsigned flags;
     PhDim_t size;
     PtGenListItem_t *next, *prev;
     } PtGenListItem_t;

Description:

This data structure describes an item in a PtGenList widget.


Note: Applications should view this as a read-only structure; subclasses usually define ways to modify PtGenListItem_t members.

The members include at least:

flags
The following flags describe the state of the item:
Pt_LIST_ITEM_SELECTED
This item is selected.
Pt_LIST_ITEM_CURRENT
This item is the current item.
Pt_LIST_ITEM_DAMAGED
This item should be redrawn.
Pt_LIST_ITEM_ABOVE
This item is above the visible range of items. Use the Pt_ARG_TOP_ITEM_POS resource to scroll the list.
Pt_LIST_ITEM_BELOW
This item is below the visible range of items. Use the Pt_ARG_TOP_ITEM_POS resource to scroll the list.

The Pt_LIST_ITEM_USED_FLAGS macro defines the flags used by the PtGenList widget. The remaining bits are available for the child class.

It's safe to set item flags before adding the item to a widget - when you add the item to a widget, the widget sets most of the flags to a correct value without even looking at the current value. The following flags are preserved if they don't conflict with the current state of the widget:

Pt_LIST_ITEM_SELECTED
Preserved unless the selection mode is Pt_SINGLE_MODE and another item is already selected.
Pt_LIST_ITEM_CURRENT
Preserved unless there's already a current item in the widget.

Don't modify the flags directly after the item is in a list; they're set and cleared by the convenience functions.

size
Width and height of the item. If the widget has columns, the widths of the items are ignored.
next, prev
The widget uses these links to find the next and previous items in the list.

Classification:

Photon

See also:

PtGenList, PtGenTree, PtGenTreeItem_t, PtList, PtTreeItem_t

Building Custom Widgets


[Previous] [Contents] [Index] [Next]