Understanding tab set processing

The tab set processing functions in Toolkit enable you to associate windows or lists with the “tabs” of a tabbed dialog. Specific input window or list processing is handled using a method that you register with Toolkit.

The basic tab set functionality is as follows:

A tab set is created with a call to %TS_TABSET using the DTS_CREATE subfunction. (Windows are added to the tab set with the DTS_WINDOW subfunction; lists are added with DTS_LIST.) The window or list is visually transformed into a tab page. It is placed adjacent to the tabs, a tab is created for it, and the border is rendered in a manner compatible with a tabbed page. On Windows, this is a blended 3‑D effect.

On UNIX and OpenVMS, the top border of the window will be overlapped by a single‑line window containing textually rendered tabs:

/Tab one \/Tab two \/ Tab three \

Slashes are used to delimit the tabs, by default, and the underscore attribute is used to distinguish the inactive tabs from the active one. See the DTS_CREATE, DTS_SELECT_ATTR, and DTS_NONSELECT_ATTR subfunctions of %TS_TABSET for information on how to modify these separators and attributes.

By default, tabs are placed at the top of the tab set. You can change this by setting DTS_BOTTOM, DTS_VERTICAL, or DTS_RIGHT when creating a tab set. (Note, however, that for Windows, we recommend leaving tabs at the top of the tab set; DTS_BOTTOM and DTS_VERTICAL result in incorrectly drawn tabs.)

The text of the tab is the text of the window’s title, if any. Subsequently, the placement of the window is left at the discretion of the tab set.

If the size of the window or list is larger than the number of rows and columns specified for the tab set on DTS_CREATE, by default the window or list will be clipped. If a resize event is specified for the window or list, scroll bars will be displayed as necessary.

The order in which windows are added to the tab set defines the ordering of the tabs. Only one row of tabs will be displayed. If this is not sufficient to display all the tabs in the tab set, on Windows, scroll bars are used by default to indicate that more tabs exist. This style can be changed to use multi‑line tabs instead of scroll bars by using the DTS_MULTILINE option when creating a tab set. On UNIX and OpenVMS systems, the active tab will always be visible.

A tab can be brought to the front programmatically by using the DTS_ACTIVE subfunction of %TS_TABSET.

To process a tab set, call %TS_PROCESS. When this routine is called, the method for the active tab is immediately invoked. When a tab switch occurs within %TS_PROCESS, the associated window is brought to the front, and its associated method is called. The only time that %TS_PROCESS returns is when a menu entry is selected that is not recognized by the currently active tab’s method, nor by %TS_PROCESS.

To remove a tab from a tab set, use DTS_REMOVE. The user won’t see the tab on the tab set, but the window will still reside in memory. You must use U_WINDOW with D_DELETE (or rely on an environment) to remove a window from memory.

To delete a tab set, do one of the following: