Procedure

TfrmFrame.SetUserTools

Module

fFrame

Last Modified

3/11/2015 8:41:44 AM

Comments

OptionsClick: TNotifyEvent;

Visibility

Private

Owner

TfrmFrame

Declaration

procedure SetUserTools;

Calls Hierarchy


TfrmFrame.SetUserTools
 ├TfrmFrame.mnuToolsOptionsClick
 │ └DialogOptions
 │   └TfrmBase508Form.Create
 │     ├TfrmBase508Form.UpdateAccessibilityActions
 │     ├UnfocusableControlEnter
 │     └AdjustControls
 │       ├TfrmBase508Form.ModifyUnfocusableControl
 │       └..(rec)..
 ├TfrmFrame.mnuGECStatusClick
 ├GetToolMenu
 └TfrmFrame.ToolClick
   ├TakeOutAmps
   ├TfrmFrame.UpdateECSParameter
   │ ├GetVisitID
   │ │ └TEncounter.GetVisitStr
   │ │   └TEncounter.GetVisitCategory
   │ └GetDivisionID
   ├TfrmFrame.ExpandCommand
   │ ├Substitute
   │ └MScalar
   ├ExcuteECS
   │ └SaveUserPath
   └ExcuteEC

Called-By Hierarchy


TfrmFrame.SetUserTools
TfrmFrame.FormCreate┘ 

Calls

Name Declaration Comments
GetToolMenu procedure GetToolMenu; -
TfrmFrame.mnuGECStatusClick procedure mnuGECStatusClick(Sender: TObject); -
TfrmFrame.mnuToolsOptionsClick procedure mnuToolsOptionsClick(Sender: TObject); -
TfrmFrame.ToolClick procedure ToolClick(Sender: TObject); -

Called-By

Name Declaration Comments
TfrmFrame.FormCreate procedure FormCreate(Sender: TObject); -


Source

1025  procedure TfrmFrame.SetUserTools;
1026  var
1027    item, parent: TToolMenuItem;
1028    ok: boolean;
1029    index, i, idx, count: Integer;
1030    UserTool: TMenuItem;
1031    Menus: TStringList;
1032    //  OptionsClick: TNotifyEvent;
1033  begin
1034    if User.IsReportsOnly then // Reports Only tab.
1035    begin
1036      mnuTools.Clear; // Remove all current items.
1037      UserTool := TMenuItem.Create(Self);
1038      UserTool.Caption := 'Options...';
1039      UserTool.Hint := 'Options';
1040      UserTool.OnClick := mnuToolsOptionsClick;
1041      mnuTools.Add(UserTool); // Add back the "Options" menu.
1042      exit;
1043    end;
1044    if User.GECStatus then
1045    begin
1046      UserTool := TMenuItem.Create(self);
1047      UserTool.Caption := 'GEC Referral Status Display';
1048      UserTool.Hint := 'GEC Referral Status Display';
1049      UserTool.OnClick := mnuGECStatusClick;
1050      mnuTools.Add(UserTool); // Add back the "Options" menu.
1051      //exit;
1052    end;
1053    GetToolMenu; // For all other users, proceed normally with creation of Tools menu:
1054    for i := uToolMenuItems.Count-1 downto 0 do
1055    begin
1056      item := TToolMenuItem(uToolMenuItems[i]);
1057      if (AnsiCompareText(item.Caption, 'Event Capture Interface') = 0 ) and
1058         (not uECSReport.ECSPermit) then
1059      begin
1060        uToolMenuItems.Delete(i);
1061        Break;
1062      end;
1063    end;
1064    Menus := TStringList.Create;
1065    try
1066      count := 0;
1067      idx := 0;
1068      index := 0;
1069      while count < uToolMenuItems.Count do
1070      begin
1071        for I := 0 to uToolMenuItems.Count - 1 do
1072        begin
1073          item := TToolMenuItem(uToolMenuItems[i]);
1074          if assigned(item.MenuItem) then continue;        
1075          if item.SubMenuID = '' then
1076            ok := True
1077          else
1078          begin
1079            idx := Menus.IndexOf(item.SubMenuID);
1080            ok := (idx >= 0);
1081          end;
1082          if ok then
1083          begin
1084            inc(count);
1085            UserTool := TMenuItem.Create(Self);
1086            UserTool.Caption := Item.Caption;
1087            if Item.Action <> '' then
1088            begin
1089              UserTool.Hint := Item.Action;
1090              UserTool.OnClick := ToolClick;
1091            end;
1092            Item.MenuItem := UserTool;
1093            if item.SubMenuID = '' then
1094            begin
1095              mnuTools.Insert(Index,UserTool);
1096              inc(Index);
1097            end
1098            else
1099            begin
1100              parent := TToolMenuItem(Menus.Objects[idx]);
1101              parent.MenuItem.Add(UserTool);
1102            end;
1103            if item.MenuID <> '' then
1104              Menus.AddObject(item.MenuID, item);
1105          end;
1106        end;
1107      end;
1108    finally
1109      Menus.Free;
1110    end;
1111    FreeAndNil(uToolMenuItems);
1112  end;