| Allegro CL version 10.0 Unrevised from 9.0 to 10.0. 9.0 version |
The class of the single-item-list
control. multi-item-list
and
single-item-list
are together
called item-list widgets.
An instance of the single-item-list
class. A list box
highlighting a single item in its window. The list is navigable from
the keyboard via the arrow keys. HOME and END keys take users to the
top and bottom of the list, respectively.
The value field
is set to the item selected by the user, and is shown highlighted in
the list. If no item is highlighted, the value field is set to nil
. 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 range property holds the list of items to be displayed; 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).
Click the single-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.
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 single 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.
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 a single-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.
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 9.0 page.
Created 2015.5.21.
| Allegro CL version 10.0 Unrevised from 9.0 to 10.0. 9.0 version |