zTabControl

Manages a Tab Control object.

Syntax

zTabControl(in viMethod, in viSelf)

Parameters

vlMethod

The name of the method to be executed. Methods include 'TABINITIALISE', 'TABPAGE', 'TABPAGEFORWARD', 'TABPAGEBACKWARD' and 'FINALISE'.

viSelf

is ’’ (blank).

Interface

The public attribute structure, aTabControl, has the following fields:

Comments

zTabControl manages a Tab Control in a form. The Tab Control Constructor found on the Edit menu of the Form Maintenance Interface constructs a Tab Control. This save the developer building the Tab Control manually. zTabControl managers multiple Tab Controls in different forms.

To use the zTabControl, the Tab Object must first be initialized by using the 'TABINITIALISE' method. The 'NEXTPage' attribute must be set.

The 'NEXTPAGE' method displays the next page of the Tab Object. Before the method is called, the 'CurrentPage', 'NextPage', 'TotalPages', and 'SetFocus' attributes must be set. After the call is made, the internal variable storing the Current Page should be set to the New Page. The request for the 'TABPAGE' method is situated in the event loop of the requesting class/program.

As the first page is most commonly set after initializing the Tab Control, you must call the zTabControl with the 'TABPAGE' method.

zTabControl supports Ctrl Tab and Ctrl Back Tab accelerator keys enabling 'quick navigation' through Tab Controls. When the user press Ctrl Tab, the user is taken to the next tab page. Ctrl Back Tab takes the user to the previous tab page.

 'FINIALISE' removes the instance of the tab control from run-time. A maxiumum of ten (10) controls can be opened at one time.

 zTabControl supports a maximum of nine tabs.

Example

%-------------------------------------------------------
% plOpen
%------------------------------------------------------
localprocedure plOpen()
  window open wInterfaceClass
  window set accelerator Escape CtlTab CtlTabBack
  form open fInterfaceClass
  form display fInterfaceClass
endprocedure
%-------------------------------------------------------
% plClose
%-------------------------------------------------------
localprocedure plClose()
plSetTabControl(1)
zTabControl('FINALISE','')
window close InterfaceClass
endprocedure
 
%-------------------------------------------------------
% plSetTabControl
%-------------------------------------------------------
localprocedure plSetTabControl(in vlNextPage)
  let aTabControl.FormName = 'fInterfaceClass' \
    aTabControl.DirName = 'Zim' \
    aTabControl.NextPage = vlNextPage
endprocedure
%-------------------------------------------------------
% plInitTabControl
%-------------------------------------------------------
localprocedure plInitTabControl()
  plSetTabControl(1)
  zTabControl('TABINITIALISE','')
  plSetTabControl(1)
  zTabControl('TABPAGE','')
endprocedure
 
%-------------------------------------------------------
% plTabPage
%-------------------------------------------------------
localprocedure plTabPage(vlAction)
 
  plSetTabControl(ThisForm.FFFieldNum)
  zTabControl(vlAction,'')
endprocedure
 
%-------------------------------------------------------
% zInterfaceClass
%-------------------------------------------------------
procedure zInterfaceClass() \
  local (vlStatus, vlAction, vlWindowName)
 
  plOpen()
  plInitTabControl()
 
  while
     pGetAction(vlStatus, 'wInterfaceClass', vlAction, vlWindowName)
 
     case
        when vlAction in ('TABPAGE', 'TABPAGEFORWARD', 'TABPAGEBACKWARD')
          plTabPage(vlAction)
      when vlAction = 'EXIT'
          break
  endcase
endwhile
plClose()
 
endprocedure