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:

  1. Paint a new menu item with the menu label 'View'.
  2. Add sub-menu items to View, one for each tab labelling them appropriately.
  3. For each sub-menu item assign a concatenated string of the menu name and the submenu name to the menu tag. For example, 'ViewCustomer'.
  4. 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)

Check out Tab Controls in Action

The Example Application has been enhanced to use Tab Controls (MS-Windows only).