Next Previous Up Top Contents Index

8.11 DUIM-Gadgets Module

<table-control>

Open abstract instantiable class

Summary

The class of table controls.

Superclasses

<collection-gadget> <action-gadget>

Init-keywords

headings:
An instance of type limited(<sequence>, of: <string>).

generators:
An instance of type limited(<sequence>, of: <function>).

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

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>).

widths:
An instance of type limited(<sequence>, of: <integer>).

Library

duim-gadgets

Module

duim-gadgets

Description

The class of table controls.

Figure 8.39 A table control

The view: init-keyword can be used to specify how the items in the table control are displayed. See <table-control-view>, page 669, for more details.

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

The scroll-bars: init-keyword defined the scroll bar behavior for 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 table 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. In a table control, a key-press callback might be used as a quick way to select an item in the control. See gadget-key-press-callback, page 567, for a fuller description of key-press callbacks.

The headings: and generators: init-keywords can be used to specify the titles of each column in the control, and a sequence of functions that are used to generate the contents of each column. The headings should be a sequence of strings, and the generators should be a sequence of functions.

The first item in the sequence of headings is used as the title for the first column, the second is used as the title of the second column, and so on. Similarly, the first function in the sequence of generators is invoked on each item in the control, thereby generating the contents of the first column, the second is used to generate the contents of the second column by invoking it on each item in the control, and so on. This is illustrated in Figure 8.40.

Figure 8.40 Defining column headings and contents in table controls

If you do not specify both of these init-keywords, you must supply columns for the table control, using the <table-column> class.

The widths: init-keyword lets you specify the width of each column in the table control. It takes a sequence of integers, each of which represents the width, in pixels, of the respective column in the control. Note that there must be as many widths as there are columns.

Internally, this class maps into the Windows list view control with LVS-REPORT style.

Operations

add-column remove-column table-control-view table-control-view-setter

See also

<table-column>, page 665

<table-control-view>, page 669


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index