class LM_TextList

The LM_TextList class provides a scrollable list of text items. To create a new text list, you would use the following function:


LM_TextList LM.GUI.TextList(width, heigh, msg)

Creates a new LM_TextList object that can then be added to a dialog or toolbar.

Return value (LM_TextList): the newly-created text list
width (int): width in pixels
height (int): height in pixels
msg (int): the message value to send when the user clicks on an item in the list

Member Functions

int CountItems()

Returns the number of entries in the list.

Return value (int): the number of entries in the list

string GetItem(id)

Returns the string value of an item in the list.

Return value (string): the string value of an item in the list
id (int): the number of the entry (starting with 0 for the first item)

void AddItem(label)

Adds a new text item to the list. The new item appears at the end of the list.

Return value: none
label (string): the text string to add to the list

void AddItemAlphabetically(label)

Adds a new text item to the list. The new item is inserted alphabetically into the list.

Return value: none
label (string): the text string to add to the list

void RemoveItem(id)

Removes an item from the list.

Return value: none
id (int): the number of the entry to remove (starting with 0 for the first item)

void SetSelItem(id)

Selects an item in the list.

Return value: none
id (int): the number of the entry (starting with 0 for the first item)

bool SetSelItem(label)

Selects an item in the list. Instead of selecting the item by number, the item that matches the supplied string is selected.

Return value (bool): true if the item exists and is selected, false if the item cannot be found
label (string): a string matching the item you wish to select

int SelItem()

Returns the id number of the currently selected item (starting with 0 for the first item).

Return value (int): the id number of the currently selected item

string SelItemLabel()

Returns the text string associated with the currently selected item.

Return value (string): the text string associated with the currently selected item

void SetItemLabel(id, label)

Changes the text string associated with an entry in the list.

Return value: none
id (int): the number of the entry (starting with 0 for the first item)
label (string): the new text string to replace that entry in the list
class LM_TextList : public LM_BaseWidget {
  int32 CountItems();
  const char *GetItem(int32 id);
  void AddItem(const char *label, bool redraw = true);
  void AddItemAlphabetically(const char *label, bool redraw = true);
  void RemoveItem(int32 id, bool redraw = true);
  void SetSelItem(int32 id, bool redraw = true);
  bool SetSelItem(const char *label, bool redraw = true);
  int32 SelItem();
  const char *SelItemLabel();
  void SetItemLabel(int32 id, const char *label);
};