Function

TfrmTemplateEditor.GetLinkType

Module

fTemplateEditor

Last Modified

7/15/2014 3:26:44 PM

Visibility

Protected

Owner

TfrmTemplateEditor

Declaration

function GetLinkType(const ANode: TTreeNode): TTemplateLinkType;

Called-By Hierarchy


                     TfrmTemplateEditor.GetLinkType
                      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┘ │ 
                 TfrmTemplateEditor.cbxTypeChange┘ 

Called-By

Name Declaration Comments
TfrmTemplateEditor.cbxTypeChange procedure cbxTypeChange(Sender: TObject); -
TfrmTemplateEditor.ShowInfo procedure ShowInfo(Node: TTreeNode); -


Source

4132  function TfrmTemplateEditor.GetLinkType(const ANode: TTreeNode): TTemplateLinkType;
4133  var
4134    Node: TTreeNode;
4135  
4136  begin
4137    Result := ltNone;
4138    if assigned(ANode) then
4139    begin
4140      if (not assigned(ANode.Data)) or (TTemplate(ANode.Data).RealType <> ttClass) then
4141      begin
4142        Node := ANode.Parent;
4143        repeat
4144          if assigned(Node) and assigned(Node.Data) then
4145          begin
4146            if (TTemplate(Node.Data).FileLink <> '') then
4147              Node := nil
4148            else
4149              if (TTemplate(Node.Data).RealType in AllTemplateLinkTypes) then
4150              begin
4151                case TTemplate(Node.Data).RealType of
4152                  ttTitles: Result := ltTitle;
4153                  ttConsults: Result := ltConsult;
4154                  ttProcedures: Result := ltProcedure;
4155                end;
4156              end
4157              else
4158                Node := Node.Parent;
4159          end
4160          else
4161            Node := nil;
4162        until (Result <> ltNone) or (not assigned(Node));
4163      end;
4164    end;
4165  end;