Window Arguments Specific for List Windows

W_LISTW_CHOICESTRING

All choice strings have to be set either in the same W_SET_WINDOW_ARGS call or in separate successive calls. No other W_xx() function can intervene. When used in W_SET_WINDOW_ARGS returns the string in the currently selected item.

W_LISTW_NUMOFCHOICES

Gets the number of choices in a list window.

W_LISTW_ORDINALVALUE

Sets or gets the ordinal number (the first is 0) of the selected item in a W_SELECTION list window.

If nothing is selected, then the ordinal number is -1.

W_LISTW_MSVALUE

Gets or sets a string of digits 0 and 1. "0" in a given position means that the corresponding item is not selected. "1" means that it is selected.

W_LISTW_CALLBACK

Sets the flag that enables or disables a list window to notify about events.

The following arguments are only valid for multi-column list windows.

W_LISTW_MODE

Sets the mode of a multi-column list window. This can be one of the following:

W_LISTW_MODE_REPORT

W_LISTW_MODE_ICONS

In report mode, each item in the list can have multiple columns. In icons mode, only the icon of an item and the text from the first column are displayed.

W_LISTW_COLUMNS

Sets the number of columns in the list. Single-column and multi-column list behave differently; either this argument or W_LISTW_MODE must be specified when the list is crated if multi-colum functionality is required.

W_LISTW_INSERTROWS

In a multi-column list, inserts the specified number of rows at the current position. Rows must be inserted before they can be used.

W_LISTW_DELETEROWS

In a multi-column list, deletes the specified number of rows starting from the current position. If the value of this argument is -1, all rows are deleted. This can be used to empty a list before inserting new values.

Notice that setting W_LISTW_DELETEROWS with the value -1 does not change the active row. Thus, to make the list window empty and ready for adding new rows to the beginning of the list, set the active row to 0 first:

Copy
W_SET_WINDOW_ARGS(Listw_h, W_LISTW_ROW, 0);
W_SET_WINDOW_ARGS(Listw_h, W_LISTW_DELETEROWS, -1);

W_LISTW_ROW

Sets the active list row.

W_LISTW_COLUMN

Sets the active list column.

W_LISTW_STRING

Sets the string displayed in the current row and column.

W_LISTW_ICON

Sets the icon displayed in the current list row. The icon file specified in this argument must be found in one of the icon directories.

W_LISTW_STATEICON

Sets the state icon displayed in the current list row. Each row can have two icons; usually, the normal icon identifies the item and the state icon displays its state. The icon file specified in this argument must be found in one of the icon directories.

W_LISTW_INDENT

Sets the amount of indent used in the current list row.

W_LISTW_ITEMID

Sets or gets the item id of the current row. This is an application-specified value that can be used to identify items instead of row indices. To get the item id of the selected row, first set the current row with W_LISTW_ROW and then read W_LISTW_ITEMID.

W_LISTW_FINDID

This argument finds the row with the specified item id and makes this the active row. You can then read W_LISTW_ROW to get the index of the row.

W_LISTW_HEADER

Sets the string displayed in the current list column.

W_LISTW_COLUMNWIDTH

Sets the width, in pixels, of the current list column. If the value is -1, the width of the column is set according to the widest of the items currently in the column.

W_LISTW_COLUMNALIGN

Sets the alignment of items in the current list column. Possible values are:

W_LISTW_ALIGN_LEFT

W_LISTW_ALIGN_CENTER

W_LISTW_ALIGN_RIGHT

W_LISTW_ITEMTYPE

Sets the type of items in the current column. This affects the way items are sorted when W_LISTW_SORT is used.

W_LISTW_SORT

Sorts list items according to the active column. This argument can have the following values:

0 - sort in descending order

1 - sort in ascending order