Config Library: 4.6 Object Class Reference: PrefDynamicListClass

Up: GEOS SDK TechDocs | Up | Prev: 4.5 PrefBooleanGroupClass | Next: 4.7 TitledGlyphClass

Objects of PrefDynamicListClass act like GenDynamicList objects, but with the intelligence to write their data to the .INI file. Developers will generally not use this class directory, but instead will subclass, intercepting the following messages:

MSG_PREF_DYNAMIC_LIST_BUILD_ARRAY
To build the data structures which will be used when later supplying monikers
MSG_PREF_ITEM_GROUP_GET_ITEM_MONIKER
To supply the moniker for a requested item on demand
MSG_PREF_DYNAMIC_LIST_FIND_ITEM
To find a given item when passed its moniker.

By handling these three messages, the developer will have a dynamic list that can properly load and save its selection and will scroll to the correct item in response to keyboard input.

The load and save mechanism is currently only configured for exclusive dynamic lists.

MSG_PREF_DYNAMIC_LIST_BUILD_ARRAY

void MSG_PREF_DYNAMIC_LIST_BUILD_ARRAY();

The PrefDynamicList sends itself this message in response to MSG_PREF_INIT.

Source: Self.

Destination: Self.

Interception: The subclasser should create an array of item strings, ideally sorted.

MSG_PREF_DYNAMIC_LIST_FIND_ITEM

 Boolean MSG_PREF_DYNAMIC_LIST_FIND_ITEM(
        word 		*itemPtr,
        const char 		*str,
        Boolean 		ignoreCase);

This message finds an item given a moniker. It is normally used in the context of loading options.

Source: Self.

Destination: Self.

Parameters: itemPtr Pointer to space in which to return a word.

str
String to search for.
ignoreCase
Flag requesting a case-insensitive search.

Return: Returns true (i.e. non-zero) if an item was found with a moniker matching the passed string; itmPtr will have been filled with the number of the matching item. If no such item was found, the message will return false (i.e. zero) and itmPtr will point to the first item after the requested item.


Up: GEOS SDK TechDocs | Up | Prev: 4.5 PrefBooleanGroupClass | Next: 4.7 TitledGlyphClass