AddListControl

>>-anAdvancedControl~AddListControl(--id--,--+---------------+--,--x,--y-->
                                             +-attributeName-+

>--,--cx--,--cy--+--------------------------------+--)-------------------><
                 |       +-------------------+    |
                 |       V                   |    |
                 +-,--"----+-ICON----------+-+--"-+
                           +-SMALLICON-----+
                           +-LIST----------+
                           +-REPORT--------+
                           +-ALIGNLEFT-----+
                           +-ALIGNTOP------+
                           +-AUTOARRANGE---+
                           +-ASCENDING-----+
                           +-DESCENDING----+
                           +-EDIT----------+
                           +-HSCROLL-------+
                           +-VSCROLL-------+
                           +-NOSCROLL------+
                           +-NOHEADER------+
                           +-NOSORTHEADER--+
                           +-NOWRAP--------+
                           +-SINGLESEL-----+
                           +-SHOWSELALWAYS-+
                           +-SHAREIMAGES---+
                           +-GROUP---------+
                           +-HIDDEN--------+
                           +-NOTAB---------+
                           +-NOBORDER------+


The AddListControl method adds a list view to the dialog and connects it with a data attribute. For further information on list view controls, refer to ListControl Class.

Arguments:

The arguments are:

id

A unique identifier assigned to the control. You need the ID to refer to this control in other methods.

attributeName

The name of the data attribute associated with the dialog item. See ConnectTreeControl to get information on what happens when this argument is omitted.

x, y

The position of the upper left corner of the control relative to the dialog, in dialog units.

cx, xy

The width and height of the dialog item, in dialog units.

options

This argument determines the behavior and style of the dialog item and can be one or more of the following, separated by blanks:

ICON

Use the icon view. Each item appears as a full-sized icon with a label below it. The user can drag the items to any location in the list view control.

SMALLICON

Use the small-icon view. Each item appears as a small icon with a label to the right of it. The user can drag the items to any location in the list view control.

LIST

Use the list view. Each item appears as a small icon with a label to the right of it. Items are arranged in columns and cannot be moved by the user.

REPORT

Use the report view. Each item appears on a separate line with information arranged in columns. The leftmost column contains the small icon and label, and subsequent columns contain subitems.

ALIGNLEFT

In icon and small-icon views, the items are left-aligned.

ALIGNTOP

In icon and small-icon views, the items are aligned with the top of the control.

AUTOARRANGE

In icon and small-icon views, the icons are always automatically arranged.

ASCENDING

Sorts items by item text in ascending order.

DESCENDING

Sorts items by item text in descending order.

EDIT

The list view allows the user to edit the list view items. To store the edited text, you must connect a method to the ENDEDIT notification or you connect the DEFAULTEDIT event handler (see ConnectTreeNotify).

HSCROLL

The list view supports a horizontal scroll bar.

VSCROLL

The list view supports a vertical scroll bar.

NOSCROLL

Disables scrolling.

NOHEADER

No column header is displayed in the report view. By default, columns have headers in the report view.

NOSORTHEADER

Specifies that column headers do not work like buttons. This option is useful if clicking a header in the report view does not carry out an action.

NOWRAP

Displays item text on a single line in the icon view. By default, the item text can wrap in the icon view.

SINGLESEL

Allows only one item to be selected at a time. By default, several items can be selected.

SHOWSELALWAYS

Specifies that a selected item remains selected when the list view loses focus.

DEFAULTEDIT

Connects the notification that label editing has been started and ended with a predefined event-handling method. This method extracts the newly entered text from the notification and modifies the item of which the label was edited. If this event is not connected you must provide your own event-handling method and connect it with the BEGINEDIT and ENDEDIT events. Otherwise, the edited text is lost and the item remains unchanged.

SHAREIMAGES

The control does not take ownership of the image lists assigned to it. This option enables an image list to be used with several list controls.

GROUP

Specifies the first control of a group of control in which the user can move from one control to the next with the arrow keys.

HIDDEN

The control is initially hidden.

NOTAB

The tab key cannot be used to move to this control.

NOBORDER

No border is drawn around the control.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

The following example creates a list view at position x=100 and y=80 and with a size of width=40 and height=120. The list view with ID 555 is a report view with items sorted in ascending order. It supports item editing and column headers do not behave like buttons. Its data is associated with attribute EMPLOYEES.

MyDialog~AddListControl(555, "EMPLOYEES", 100, 80, 40, 120, ,
"REPORT ASCENDING EDIT NOSORTHEADER")