Next Previous Up Top Contents Index

8.11 DUIM-Gadgets Module

<tab-control>

Open abstract instantiable class

Summary

The class of tab controls.

Superclasses

<value-gadget>

Init-keywords

pages:
An instance of type limited(<sequence>, of: <page>).

current-page:
An instance of type false-or(<sheet>).

key-press-callback:

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

Library

duim-gadgets

Module

duim-gadgets

Description

The class of tab controls. These controls let you implement a multi-page environment in a window or dialog. Each page in a tab control has its own associated layout of sheets and gadgets, and an accompanying tab (usually displayed at the top of the page, rather like the tab dividers commonly used in a filing cabinet. Each page in a tab control can be displayed by clicking on the appropriate tab.

Figure 8.37 A tab control

The pages: init-keyword is used to define the pages that the tab control contains. Each page in the tab control is an instance of the class <page>.

The current-page: init-keyword specifies which tab is visible when the tab control is first displayed.

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 tab control, a key-press callback might be used as a quick way to display each page in the tab control. See gadget-key-press-callback, page 567, for a fuller description of key-press callbacks.

The gadget-id of a tab control is particularly useful, because it is returned by gadget-value.

Internally, this class maps into the Windows tab control.

Operations

tab-control-current-page tab-control-current-page-setter tab-control-labels tab-control-pages
tab-control-pages-setter

Example

The following example creates a tab control that has two pages. The first page contains a button, and the second page contains a list.

contain(make(<tab-control>, 
             pages: 
               vector(make(<tab-control-page>,
                           label: "First", 
                           child: make(<push-button>,
                                       label: "One")),
                      make(<tab-control-page>, 
                           label: "Second", 
                           child: make(<list-box>,
                                       items: 
                                         #(1, 2, 3)
                                      )))));

See also

<page>, page 623


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index