A tab control can be compared to a divider in a notebook or a label in a file cabinet. By using a tab control, an application can define several pages for the same area of a dialog or dialog control. Each page consists of a set of information or a group of controls that the application displays when the user selects the corresponding tab.
A special type of tab control displays tabs that look like buttons. Clicking a button immediately performs a command instead of displaying a page.
You can apply specific characteristics to tab controls by specifying tab control styles. For example, you can specify the alignment and general appearance of the tabs in a tab control.
By default, a tab control displays only one row of tabs. If not all tabs can be shown at once, the tab control displays an up-and-down control so that the user can scroll to view additional tabs.
Refer to PROPDEMO.REX in the OODIALOG\SAMPLES directory for an example.
The TabControl class sends notification messages to notify about the event. For information about notification messages, refer to ConnectListNotify.
The TabControl class requires the class definition file oodwin32.cls:
::requires "oodwin32.cls"
Instances of the TabControl class implement the methods listed in the TabControl Instance Methods table.
Table 27-1. TabControl Instance Methods
Method... | ...on page |
---|---|
AddFullSeq | AddFullSeq |
AddSequence | AddSequence |
AdjustToRectangle | AdjustToRectangle |
Delete | Delete |
DeleteAll | DeleteAll |
Focus | Focus |
Focused | Focused |
Insert | Insert |
ItemInfo | ItemInfo |
Items | Items |
Last | Last |
Modify | Modify |
PosRectangle | PosRectangle |
RemoveImages | RemoveImages |
RequiredWindowSize | RequiredWindowSize |
Rows | Rows |
Select | Select |
SelectIndex | SelectIndex |
Selected | Selected |
SelectedIndex | SelectedIndex |
SetImages | SetImages |
SetPadding | SetPadding |
SetSize | SetSize |
>>-aTabControl~Insert(--+-----+--,--text--,--icon--,--numValue--)->< +-tab-+
The Insert method inserts a new tab in a tab control.
The arguments are:
The number of the tab. If you omit this argument, the number of the last tab is increased by 1, starting with 0.
The label text for the inserted tab.
The index of the icon in the image list of the tab control, set with the SetImages method (see SetImages).
An integer value stored together with the tab to save information.
The number of the new tab, or -1 for all other cases.
The following example inserts three tabs in a tab control with the specified text and a specific item:
::method InitDialog InitDlgRet = self~InitDialog:super curTab = self~GetTabControl("ID_TAB") if curTab \= .Nil then do curTab~SetImages("oodtab.BMP",16,16) curTab~Insert(,"First Tab",0) curTab~Insert(,"Second Tab",1) curTab~Insert(,"Third Tab",2) end return InitDlgRet