Next Previous Up Top Contents Index

8.11 DUIM-Gadgets Module

<list-control>

Open abstract instantiable class

Summary

The class of list controls.

Superclasses

<collection-gadget> <action-gadget>

Init-keywords

icon-function:
An instance of type <function>.

view:
An instance of type <list-control-view>. Default value: #"list".

borders:
An instance of type one-of(#f, #"none", #"flat", #"sunken", #"raised", #"ridge", #"groove", #"input", #"output"). Default value: #f.

scroll-bars:
An instance of type one-of(#f, #"none", #"horizontal", #"vertical", #"both", #"dynamic"). Default value: #"both".

popup-menu-callback:

An instance of type <function>.

key-press-callback:

An instance of type false-or(<command>, <function>).

Library

duim-gadgets

Module

duim-gadgets

Description

The class of list controls. These are controls that can list items in a number of different ways, using a richer format than the <list-box> class. Examples of list controls are the main panels in the Windows Explorer, or the Macintosh Finder. List controls can also be seen in the standard Windows 95 Open File dialog box.

Figure 8.20 A list control

The icon-function: init-keyword lets you specify a function to supply icons for display in the control. The function is called with the item that needs an icon as its argument, and it should return an instance of <image> as its result. Typically, you might want to define an icon function that returns a different icon for each kind of item in the control. For example, if the control is used to display the files and directories on a hard disk, you would want to return the appropriate icon for each registered file type.

The view: init-keyword can be used to specify the way in which the items in the list box are displayed. There are three options, corresponding to the view options that will be familiar to most users of GUI-based operating systems.

The borders: init-keyword lets you specify a border around the list control. If specified, a border of the appropriate type is drawn around the gadget.

The scroll-bars: init-keyword lets you specify the presence of scroll bars around the gadget. By default, both horizontal and vertical scroll bars are created. You can also force the creation of only horizontal or vertical scroll bars, or you can create scroll bars dynamically: that is, have them created only if necessary, dependent on the size of the gadget. If scroll-bars: is #f, no scroll bars are added to the gadget.

You can use the popup-menu-callback: init-keyword to specify a context-sensitive menu to display for one or more selected items in the list control. In Windows 95, for instance, such a context-sensitive menu can be displayed by right-clicking on any item or group of selected items in the list control.

The key-press-callback: init-keyword lets you specify a key-press callback. This type of callback is invoked whenever a key on the keyboard is pressed while the gadget has focus. See gadget-key-press-callback, page 567, for a fuller description of key-press callbacks.

Internally, this class maps into the Windows list view control.

Operations

add-item find-item list-control-view list-control-view-setter make-item remove-item

See also

add-item, page 528

list-control-view, page 607

make-item, page 609

remove-item, page 636


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index