Open abstract instantiable class
The class of tab controls.
pages:limited(<sequence>, of: <page>).
current-page: false-or(<sheet>).
key-press-callback: An instance of type false-or(<command>, <function>).
duim-gadgets
duim-gadgets
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.
|
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.
tab-control-current-page tab-control-current-page-setter tab-control-labels tab-control-pages tab-control-pages-setter
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)
)))));