Class | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## multi-item-list

### Class

The class of the multi-item-list control.

### Control

Instance of the `multi-item-list` class. This control is similar to `single-item-list` except that the user may select multiple items, in either continuous ranges or discontinuous ranges. `multi-item-list` and `single-item-list` are together called item-list widgets.

The value property is set to a list of the highlighted items; both sequential and non-sequential list items can be highlighted.

The range property contains all of the entries in the list; items appear in the order you enter them in the range. The items may be any type of object, though for some item types the on-change-test of the widget may need to be changed to a function that will return true for equivalent objects of that type.

The entire range may be set either by passing the :range initarg when calling make-instance to create the widget, or later by calling (setf range). Incremental changes to the range may be made by calling the functions list-widget-add-item, list-widget-remove-item, list-widget-replace-item, and list-widget-move-item.

An application should not destructively modify a list that it has passed as a :range initarg or to (setf range) for an item-list widget, because the widget retains this list object to determine which values are actually new when (setf range) is called again on the widget. To make small changes to the range, the incremental functions mentioned above may be used to avoid consing a new list to pass to (setf range).

The :key initarg to make-instance should be a function of one argument which should return the object to be displayed for each item in the range.

### Navigating and selecting items from the multi-item-list

Continuous ranges are selected by holding down the SHIFT key and clicking on the beginning and end of the range (or each item if desired). Discontinuous ranges are selected by holding down the CTRL key and clicking on each item desired. Or, if a multi-item-list is created with the initarg :simple-click-toggle true, each item is toggled separately with a click, but Shift-click does not, in that case select several items (see simple-click-toggle).

Arrow keys can be used to navigate up and down the length of the list.

### Adding a multi-item-list control to your form

Click the multi-item-list tool on the Component toolbar. Move the mouse cursor to the part of the form where you want to place the control, and click again. The control will appear with colored resizing handles.

### Resizing and moving the control

Controls can only be resized and moved on forms during the design stage; the size and location of everything is fixed on a running form.

Resize the control by clicking the mouse cursor and dragging one of the handles to the new size-point. Release the mouse key when you are satisfied with the new size. Note: resizing the multi-item list won't mean proportional changes in the size of the characters inside the list. Change the font property if you want to change the size of the actual characters displayed.

Move the control by clicking anywhere on it except a resizing handle and dragging it to a new location on the form. Release the mouse key when you are ready to place the control.

### Scrollbars

This control will show a horizontal scrollbar only if its multi-column-p property is true (and the multiple columns extend beyond the width of the control). If a horizontal scrollbar is needed on an `multi-item-list` that does not use multiple columns, an `outline` control could be used instead, using only top-level items in the range and turning off the draw-icons property to simulate an item-list.

### Notes

When list-items exceed the size of the display, a scroll-bar appears on the right side of the box automatically. Scroll bars don't appear when individual list entries are too long to fit in the width of the display, nor does the text wrap.

See About how to get sample code for creating controls in cgide.htm, which explains how to use the IDE to create such code.

A diagram of window and widget classes is shown in Widget and window classes in cgide.htm.

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version