Procedure

TfrmTemplateEditor.ShowInfo

Module

fTemplateEditor

Last Modified

7/15/2014 3:26:44 PM

Visibility

Protected

Owner

TfrmTemplateEditor

Declaration

procedure ShowInfo(Node: TTreeNode);

Calls Hierarchy


TfrmTemplateEditor.ShowInfo
 ├TfrmTemplateEditor.ShowTemplateType
 ├TfrmTemplateEditor.GetLinkType
 ├LoadServiceListWithSynonyms
 ├TTemplate.LinkName
 │ ├GetLinkName
 │ │ └ExternalName
 │ ├TTemplate.LinkIEN
 │ └TTemplate.LinkType
 ├TTemplate.LinkIEN
 ├TTemplate.GetDescription
 │ └LoadTemplateDescription
 ├TTemplate.IsLocked
 │ └TTemplate.AutoLock
 │   └TTemplate.LinkType
 ├TTemplate.AutoLock...
 ├TfrmTemplateEditor.IsTemplateLocked
 │ ├TTemplate.AutoLock...
 │ ├TTemplate.IsLocked...
 │ └..(rec)..
 ├TTemplate.GetChildren
 ├TTemplate.ReminderDialogIEN
 ├TdmodShared.InDialog
 │ └TTemplate.IsDialog
 ├TTemplate.GetBoilerplate
 │ └GetTemplateBoilerplate
 ├TfrmTemplateEditor.DisplayBoilerplate
 │ ├TfrmTemplateEditor.pnlBoilerplateResize
 │ ├TTemplate.GetBoilerplate...
 │ ├TTemplate.FullBoilerplate
 │ │ ├TTemplate.GetBoilerplate...
 │ │ ├TTemplate.ItemBoilerplate
 │ │ │ ├TTemplate.GetItems
 │ │ │ │ └ExpandTemplate
 │ │ │ │   ├TTemplate.GetChildren
 │ │ │ │   ├GetTemplateChildren
 │ │ │ │   ├AddTemplate
 │ │ │ │   │ ├TTemplate.Create
 │ │ │ │   │ │ └TTemplate.ReminderDialogIEN
 │ │ │ │   │ └TTemplate.AddChild
 │ │ │ │   │   └TTemplate.GetItems...
 │ │ │ │   └TTemplate.ItemIENs
 │ │ │ │     └TTemplate.GetItems...
 │ │ │ ├TTemplate.GetTemplateType
 │ │ │ ├DlgText
 │ │ │ └TTemplate.DialogProperties
 │ │ │   ├TTemplate.GetBoilerplate...
 │ │ │   └TTemplate.DlgID
 │ │ ├DlgText
 │ │ └TTemplate.DialogProperties...
 │ ├TfrmTemplateEditor.UpdateInsertsDialogs
 │ │ ├TfrmTemplateObjects.UpdateStatus
 │ │ └TfrmTemplateFields.UpdateStatus
 │ │   └TfrmTemplateFields.ValidInsert
 │ ├TfrmTemplateEditor.ShowBoilerPlate
 │ └TfrmTemplateEditor.ShowGroupBoilerplate
 ├TfrmTemplateEditor.ShowGroupBoilerplate
 └TfrmTemplateEditor.pnlBoilerplateResize

Called-By Hierarchy


                      TfrmTemplateEditor.ShowInfo
                                  EditTemplates┤ 
          TfrmDCSumm.popSummMemoTemplateClick┤ │ 
               TfrmDCSumm.mnuNewTemplateClick┤ │ 
             TfrmDCSumm.mnuEditTemplatesClick┤ │ 
       TfrmDCSumm.mnuEditSharedTemplatesClick┤ │ 
         TfrmDCSumm.mnuNewSharedTemplateClick┤ │ 
        TfrmConsults.popNoteMemoTemplateClick┤ │ 
           TfrmConsults.mnuEditTemplatesClick┤ │ 
             TfrmConsults.mnuNewTemplateClick┤ │ 
     TfrmConsults.mnuEditSharedTemplatesClick┤ │ 
       TfrmConsults.mnuNewSharedTemplateClick┤ │ 
            TfrmDrawers.mnuEditTemplatesClick┤ │ 
              TfrmDrawers.mnuNewTemplateClick┤ │ 
         TfrmSurgery.popNoteMemoTemplateClick┤ │ 
            TfrmSurgery.mnuEditTemplatesClick┤ │ 
              TfrmSurgery.mnuNewTemplateClick┤ │ 
      TfrmSurgery.mnuEditSharedTemplatesClick┤ │ 
        TfrmSurgery.mnuNewSharedTemplateClick┤ │ 
           TfrmNotes.popNoteMemoTemplateClick┤ │ 
              TfrmNotes.mnuEditTemplatesClick┤ │ 
                TfrmNotes.mnuNewTemplateClick┤ │ 
        TfrmNotes.mnuEditSharedTemplatesClick┤ │ 
          TfrmNotes.mnuNewSharedTemplateClick┘ │ 
                TfrmTemplateEditor.tvTreeChange┤ 
             TfrmTemplateEditor.cbActiveClick┤ │ 
               TfrmTemplateEditor.tvTreeEnter┤ │ 
             TfrmTemplateEditor.cbShHideClick┤ │ 
           TfrmTemplateEditor.cbActiveClick┘ │ │ 
            TfrmTemplateEditor.cbPerHideClick┤ │ 
           TfrmTemplateEditor.cbActiveClick┘ │ │ 
             TfrmTemplateEditor.sbDeleteClick┤ │ 
      TfrmTemplateEditor.mnuNodeDeleteClick┤ │ │ 
           TfrmTemplateEditor.tvTreeKeyDown┘ │ │ 
                    TfrmTemplateEditor.Resync┤ │ 
             TfrmTemplateEditor.btnNewClick┤ │ │ 
                         EditTemplates...┤ │ │ │ 
       TfrmTemplateEditor.mnuAutoGenClick┤ │ │ │ 
TfrmTemplateEditor.mnuImportTemplateClick┘ │ │ │ 
           TfrmTemplateEditor.sbMoveUpClick┤ │ │ 
         TfrmTemplateEditor.sbMoveDownClick┤ │ │ 
        TfrmTemplateEditor.sbDeleteClick...┤ │ │ 
          TfrmTemplateEditor.tvTreeDragDrop┤ │ │ 
       TfrmTemplateEditor.sbCopyLeftClick┤ │ │ │ 
      TfrmTemplateEditor.sbCopyRightClick┤ │ │ │ 
     TfrmTemplateEditor.mnuNodePasteClick┘ │ │ │ 
            TfrmTemplateEditor.mnuSortClick┤ │ │ 
          TfrmTemplateEditor.TemplateLocked┘ │ │ 
            TfrmTemplateEditor.FormCreate┘   │ │ 
             TfrmTemplateEditor.SharedEditing┤ │ 
              TfrmTemplateEditor.FormCreate┤ │ │ 
       TfrmTemplateEditor.cbEditSharedClick┘ │ │ 
             TfrmTemplateEditor.cbxTypeChange┘ │ 
                TfrmTemplateEditor.reBoilChange┤ 
             TfrmTemplateEditor.mnuAutoGenClick┤ 
      TfrmTemplateEditor.mnuImportTemplateClick┘ 

Calls

Name Declaration Comments
TTemplate.AutoLock function AutoLock: boolean; -
TfrmTemplateEditor.DisplayBoilerplate procedure DisplayBoilerplate(Node: TTreeNode); -
TTemplate.GetBoilerplate function GetBoilerplate: string; -
TTemplate.GetChildren function GetChildren: TTemplateChildren; -
TTemplate.GetDescription function GetDescription: string; -
TfrmTemplateEditor.GetLinkType function GetLinkType(const ANode: TTreeNode): TTemplateLinkType; -
TdmodShared.InDialog function InDialog(Node: TTreeNode): boolean; -
TTemplate.IsLocked function IsLocked: boolean; -
TfrmTemplateEditor.IsTemplateLocked function IsTemplateLocked(Node: TTreeNode): boolean; -
TTemplate.LinkIEN function LinkIEN: string; -
TTemplate.LinkName function LinkName: string; -
LoadServiceListWithSynonyms function LoadServiceListWithSynonyms(Purpose: integer): TStrings ; overload; -
TfrmTemplateEditor.pnlBoilerplateResize procedure pnlBoilerplateResize(Sender: TObject); -
TTemplate.ReminderDialogIEN function ReminderDialogIEN: string; -
TfrmTemplateEditor.ShowGroupBoilerplate procedure ShowGroupBoilerplate(Visible: boolean); -
TfrmTemplateEditor.ShowTemplateType procedure ShowTemplateType(Template: TTemplate); -

Called-By

Name Declaration Comments
EditTemplates procedure EditTemplates(Form: TForm; NewTemplate: boolean = FALSE; CopiedText: string = ''; Shared: boolean = FALSE); -
TfrmTemplateEditor.mnuAutoGenClick procedure mnuAutoGenClick(Sender: TObject); -
TfrmTemplateEditor.mnuImportTemplateClick procedure mnuImportTemplateClick(Sender: TObject); -
TfrmTemplateEditor.reBoilChange procedure reBoilChange(Sender: TObject); -
TfrmTemplateEditor.tvTreeChange procedure tvTreeChange(Sender: TObject; Node: TTreeNode); -


Source

995   procedure TfrmTemplateEditor.ShowInfo(Node: TTreeNode);
996   var
997     OldUpdating, ClearName, ClearRB, ClearAll: boolean;
998     Idx: TTypeIndex;
999     CanDoCOM: boolean;
1000    lt: TTemplateLinkType;
1001    lts: string;
1002  
1003  begin
1004    OldUpdating := FUpdating;
1005    FUpdating := TRUE;
1006    try
1007      if (assigned(Node)) then
1008      begin
1009        FShowingTemplate := TTemplate(Node.Data);
1010        with FShowingTemplate do
1011        begin
1012          ClearName := FALSE;
1013          ClearRB := FALSE;
1014          ClearAll := FALSE;
1015          ShowTemplateType(TTemplate(Node.Data));
1016          lt := GetLinkType(Node);
1017          if (lt = ltNone) or (IsReminderDialog and (not (lt in [ltNone, ltTitle]))) then
1018            pnlLink.Visible := FALSE
1019          else
1020          begin
1021            pnlLink.Visible := TRUE;
1022            pnlLink.Tag := ord(lt);
1023            case lt of
1024              ltTitle: lts := 'Title';
1025              ltConsult: lts := 'Consult Service';
1026              ltProcedure: lts := 'Procedure';
1027            else lts := '';
1028            end;
1029            cbxLink.Clear;
1030            if lt = ltConsult then
1031            begin
1032              cbxLink.LongList := FALSE;
1033              if not assigned(FConsultServices) then
1034              begin
1035                FConsultServices := TStringList.Create;
1036                FastAssign(LoadServiceListWithSynonyms(1), FConsultServices);
1037                SortByPiece(FConsultServices, U, 2);
1038              end;
1039              FastAssign(FConsultServices, cbxLink.Items);
1040            end
1041            else
1042            begin
1043              cbxLink.LongList := TRUE;
1044              cbxLink.HideSynonyms := TRUE;
1045              cbxLink.InitLongList(LinkName);
1046            end;
1047            cbxLink.SelectByID(LinkIEN);
1048            lblLink.Caption := ' Associated ' + lts + ': ';
1049            cbxLink.Caption := lblLink.Caption;
1050          end;
1051  
1052          edtName.Text := PrintName;
1053          reNotes.Lines.Text := Description;
1054          if (PersonalOwner = 0) and (FCurTree = tvShared) and (cbEditShared.Checked) then
1055          begin
1056            cbLock.Checked := IsLocked;
1057            if AutoLock then
1058              cbLock.Enabled := FALSE;
1059          end
1060          else
1061          begin
1062            cbLock.Checked := IsTemplateLocked(Node);
1063            cbLock.Enabled := FALSE;
1064          end;
1065          CanDoCom := FCanDoCOMObjects and (PersonalOwner = 0);
1066          if (RealType in AllTemplateRootTypes) then
1067          begin
1068            ClearRB := TRUE;
1069            ClearAll := TRUE;
1070          end
1071          else
1072          begin
1073            case RealType of
1074              ttDoc: begin
1075                  if IsReminderDialog then
1076                    Idx := tiRemDlg
1077                  else
1078                    if IsCOMObject then
1079                      Idx := tiCOMObj
1080                    else
1081                      Idx := tiTemplate;
1082                end;
1083              ttGroup: begin
1084                  if (Dialog) then
1085                    Idx := tiDialog
1086                  else
1087                    Idx := tiGroup;
1088                end;
1089              ttClass: Idx := tiFolder;
1090            else Idx := tiNone;
1091            end;
1092            FForceContainer := ((RealType in [ttGroup, ttClass]) and (Children <> tcNone));
1093            cbxType.Items.Clear;
1094            if not FForceContainer then
1095              cbxType.Items.Add('Template');
1096            cbxType.Items.Add('Folder');
1097            cbxType.Items.Add('Group Template');
1098            cbxType.Items.Add('Dialog');
1099            if (not FForceContainer) then
1100            begin
1101              if (FCanDoReminders or CanDoCOM) then
1102                cbxType.Items.Add('Reminder Dialog');
1103              if (CanDoCOM) then
1104                cbxType.Items.Add('COM Object');
1105            end;
1106            cbxType.ItemIndex := ForcedIdx[FForceContainer, Idx];
1107            if (Idx = tiRemDlg) and FCanDoReminders then
1108              cbxRemDlgs.SelectByID(ReminderDialogIEN)
1109            else
1110            begin
1111              lblRemDlg.Enabled := FALSE;
1112              cbxRemDlgs.Enabled := FALSE;
1113              cbxRemDlgs.ItemIndex := -1;
1114            end;
1115            if (Idx = tiCOMObj) and CanDoCOM then
1116            begin
1117              pnlCOM.Visible := TRUE;
1118              cbxCOMObj.SelectByIEN(COMObject);
1119              edtCOMParam.Text := COMParam;
1120            end
1121            else
1122            begin
1123              pnlCOM.Visible := FALSE;
1124              cbxCOMObj.ItemIndex := -1;
1125              edtCOMParam.Text := '';
1126            end;
1127            cbActive.Checked := Active;
1128            if (RealType in [ttClass, ttGroup]) then
1129              cbHideItems.Checked := HideItems
1130            else
1131            begin
1132              cbHideItems.Checked := FALSE;
1133              cbHideItems.Enabled := FALSE;
1134            end;
1135            if ((RealType in [ttDoc, ttGroup]) and (assigned(Node.Parent)) and
1136              (TTemplate(Node.Parent.Data).RealType = ttGroup) and
1137              (not IsReminderDialog) and (not IsCOMObject)) then
1138              cbExclude.Checked := Exclude
1139            else
1140            begin
1141              cbExclude.Checked := FALSE;
1142              cbExclude.Enabled := FALSE;
1143            end;
1144            if dmodShared.InDialog(Node) and (not IsReminderDialog) and (not IsCOMObject) then
1145            begin
1146              cbDisplayOnly.Checked := DisplayOnly;
1147              cbFirstLine.Checked := FirstLine;
1148            end
1149            else
1150            begin
1151              cbDisplayOnly.Checked := FALSE;
1152              cbDisplayOnly.Enabled := FALSE;
1153              cbFirstLine.Checked := FALSE;
1154              cbFirstLine.Enabled := FALSE;
1155            end;
1156            if (RealType in [ttGroup, ttClass]) and (Children <> tcNone) and
1157              (dmodShared.InDialog(Node)) then
1158            begin
1159              cbOneItemOnly.Checked := OneItemOnly;
1160              cbIndent.Checked := IndentItems;
1161              if (RealType = ttGroup) and (Boilerplate <> '') then
1162              begin
1163                cbHideDlgItems.Checked := HideDlgItems;
1164              end
1165              else
1166              begin
1167                cbHideDlgItems.Checked := FALSE;
1168                cbHideDlgItems.Enabled := FALSE;
1169              end;
1170            end
1171            else
1172            begin
1173              cbOneItemOnly.Checked := FALSE;
1174              cbOneItemOnly.Enabled := FALSE;
1175              cbHideDlgItems.Checked := FALSE;
1176              cbHideDlgItems.Enabled := FALSE;
1177              cbIndent.Checked := FALSE;
1178              cbIndent.Enabled := FALSE;
1179            end;
1180            if (RealType = ttGroup) then
1181              edtGap.Text := IntToStr(Gap)
1182            else
1183            begin
1184              edtGap.Text := '0';
1185              edtGap.Enabled := FALSE;
1186              udGap.Enabled := FALSE;
1187              udGap.Invalidate;
1188              lblLines.Enabled := FALSE;
1189            end;
1190            DisplayBoilerplate(Node);
1191          end;
1192        end;
1193      end
1194      else
1195      begin
1196        ClearAll := TRUE;
1197        ClearRB := TRUE;
1198        ClearName := TRUE;
1199        gbProperties.Caption := PropText;
1200      end;
1201      if (ClearName) then
1202      begin
1203        edtName.Text := '';
1204        reNotes.Clear;
1205      end;
1206      if (ClearRB) then
1207      begin
1208        cbxType.ItemIndex := Ord(tiNone);
1209      end;
1210      if (ClearAll) then
1211      begin
1212        cbActive.Checked := FALSE;
1213        cbExclude.Checked := FALSE;
1214        cbDisplayOnly.Checked := FALSE;
1215        cbFirstLine.Checked := FALSE;
1216        cbOneItemOnly.Checked := FALSE;
1217        cbHideDlgItems.Checked := FALSE;
1218        cbHideItems.Checked := FALSE;
1219        cbIndent.Checked := FALSE;
1220        edtGap.Text := '0';
1221        reBoil.Clear;
1222        ShowGroupBoilerplate(False);
1223        pnlBoilerplateResize(Self);
1224        pnlCOM.Visible := FALSE;
1225        pnlLink.Visible := FALSE;
1226      end;
1227      if cbDisplayOnly.Enabled or
1228        cbFirstLine.Enabled or
1229        cbIndent.Enabled or
1230        cbOneItemOnly.Enabled or
1231        cbHideDlgItems.Enabled then
1232        gbDialogProps.Font.Color := clWindowText
1233      else
1234        gbDialogProps.Font.Color := clInactiveCaption;
1235    finally
1236      FUpdating := OldUpdating;
1237    end;
1238  end;