Procedure

TfrmEncounterFrame.tabPageChange

Module

fEncounterFrame

Last Modified

7/15/2014 3:26:36 PM

Comments

//Name: procedure TfrmEncounterFrame.tabPageChange(Sender: TObject; NewTab: Integer; var AllowChange: Boolean);
//Created: Jan 1999
//By: Robert Bott
//Location: ISL
//Description: Finds the page, and calls SwithToPage to display it.
///////////////////////////////////////////////////////////////////////////////

 switches to form linked to NewTab

Visibility

Public/Published

Owner

TfrmEncounterFrame

Declaration

procedure tabPageChange(Sender: TObject; NewTab: Integer;
  var AllowChange: Boolean);

Calls Hierarchy


TfrmEncounterFrame.tabPageChange
 ├TfrmEncounterFrame.PageIDToTab
 ├TfrmEncounterFrame.PageIDToForm
 └TfrmEncounterFrame.SwitchToPage
   └TfrmPCEBase.DisplayPage

Called-By Hierarchy


   TfrmEncounterFrame.tabPageChange
TfrmEncounterFrame.FormCloseQuery┤ 
     TfrmEncounterFrame.SelectTab┘ 
            TfrmPCEBase.DoEnter┘   

Calls

Name Declaration Comments
TfrmEncounterFrame.PageIDToForm function PageIDToForm(PageID: Integer): TfrmPCEBase; -
TfrmEncounterFrame.PageIDToTab function PageIDToTab(PageID: Integer): string; -
TfrmEncounterFrame.SwitchToPage procedure SwitchToPage(NewForm: TfrmPCEBase); -

Called-By

Name Declaration Comments
TfrmEncounterFrame.FormCloseQuery procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); -
TfrmEncounterFrame.SelectTab procedure SelectTab(NewTabName: string); -


Source

314   procedure TfrmEncounterFrame.tabPageChange(Sender: TObject; NewTab: Integer; var AllowChange: Boolean);
315   { switches to form linked to NewTab }
316   var
317     i: integer;
318   begin
319   //must switch based on caption, as all tabs may not be present.
320   for i := CT_FIRST to CT_LAST do
321     begin
322     With Formlist do
323       if NewTab = IndexOf(PageIDToTab(i)) then
324       begin
325         PageIDToForm(i).show;
326         SwitchToPage(PageIDToForm(i));
327       end;
328     end;
329   end;