Procedure

TfrmTemplateEditor.popTemplatesPopup

Module

fTemplateEditor

Last Modified

7/15/2014 3:26:44 PM

Visibility

Public/Published

Owner

TfrmTemplateEditor

Declaration

procedure popTemplatesPopup(Sender: TObject);

Calls Hierarchy


TfrmTemplateEditor.popTemplatesPopup
 ├TfrmTemplateEditor.GetTree
 ├TdmodShared.NeedsCollapsing
 └TfrmTemplateEditor.PasteOK
   └TfrmTemplateEditor.AllowMove
     ├TfrmTemplateEditor.IsTemplateLocked
     │ ├TTemplate.AutoLock
     │ │ └TTemplate.LinkType
     │ ├TTemplate.IsLocked
     │ │ └TTemplate.AutoLock...
     │ └..(rec)..
     └TTemplate.GetItems
       └ExpandTemplate
         ├TTemplate.GetChildren
         ├GetTemplateChildren
         ├AddTemplate
         │ ├TTemplate.Create
         │ │ └TTemplate.ReminderDialogIEN
         │ └TTemplate.AddChild
         │   └TTemplate.GetItems...
         └TTemplate.ItemIENs
           └TTemplate.GetItems...

Calls

Name Declaration Comments
TfrmTemplateEditor.GetTree function GetTree: TTreeView; -
TdmodShared.NeedsCollapsing function NeedsCollapsing(Tree: TTreeView): boolean; -
TfrmTemplateEditor.PasteOK function PasteOK: boolean; -


Source

2302  procedure TfrmTemplateEditor.popTemplatesPopup(Sender: TObject);
2303  var
2304    Tree: TTreeView;
2305    Node: TTreeNode;
2306    FindOn: boolean;
2307    Txt: string;
2308  
2309  begin
2310    FFromMainMenu := FALSE;
2311    Tree := GetTree;
2312    Node := Tree.Selected;
2313    Tree.Selected := Node; // This line prevents selected from changing after menu closes
2314    mnuCollapseTree.Enabled := dmodShared.NeedsCollapsing(Tree);
2315    if (Tree = tvShared) then
2316    begin
2317      Txt := 'Shared';
2318      FindOn := FFindShOn;
2319      mnuNodeDelete.Enabled := ((sbShDelete.Visible) and (sbShDelete.Enabled));
2320    end
2321    else
2322    begin
2323      Txt := 'Personal';
2324      FindOn := FFindPerOn;
2325      mnuNodeDelete.Enabled := ((sbPerDelete.Visible) and (sbPerDelete.Enabled));
2326    end;
2327    mnuFindTemplates.Checked := FindOn;
2328    mnuCollapseTree.Caption := 'Collapse ' + Txt + ' &Tree';
2329    mnuFindTemplates.Caption := '&Find ' + Txt + ' Templates';
2330  
2331    if (assigned(Tree) and assigned(Tree.Selected) and assigned(Tree.Selected.Data)) then
2332    begin
2333      mnuNodeCopy.Enabled := (TTemplate(Tree.Selected.Data).RealType in [ttDoc, ttGroup, ttClass]);
2334      mnuNodeSort.Enabled := (TTemplate(Tree.Selected.Data).RealType in AllTemplateFolderTypes) and
2335        (Tree.Selected.HasChildren) and
2336        (Tree.Selected.GetFirstChild.GetNextSibling <> nil);
2337    end
2338    else
2339    begin
2340      mnuNodeCopy.Enabled := FALSE;
2341      mnuNodeSort.Enabled := FALSE;
2342    end;
2343    FPasteNode := Tree.Selected;
2344    mnuNodePaste.Enabled := PasteOK;
2345    mnuNodeNew.Enabled := btnNew.Enabled;
2346    mnuNodeAutoGen.Enabled := btnNew.Enabled;
2347  end;