Adapting Tab Controls for a TUI Environment
Adapting Tab Controls for a TUI Environment
Tab Controls are unique to graphical environments, but can be required in cross-platform applications. In the TUI environment, the user interface is not driven by ‘tabs’ but by means the View menu. The tabs are not represented to the user in the display. The tabs sit behind the tab page frames. This is because of screen real estate and other factors, such as the absence of a mouse interface.
To add the View menu to drive tab controls, complete the following:
- Paint a new menu item with the menu label ‘View’.
- Add sub-menu items to View, one for each tab labelling them appropriately.
- For each sub-menu item assign a concatenated string of the menu name and the submenu name to the menu tag. For example, ‘ViewCustomer’.
- Add an ‘action’ statement to the action dispatcher procedure for each View menu item/tab page. Pass the tab number to plSetTabControl. For example in the code example, the following line would be added to zInterfaceClass:
when vlAction = ‘VIEWCUSTOMER’
plSetTabControl(1)
plTabPage(vlAction)
when vlAction = ‘VIEWPRODUCT’
plSetTabControl(2)
plTabPage(vlAction)