Procedure

TfrmTemplateEditor.mnuTemplateClick

Module

fTemplateEditor

Last Modified

7/15/2014 3:26:44 PM

Visibility

Public/Published

Owner

TfrmTemplateEditor

Declaration

procedure mnuTemplateClick(Sender: TObject);

Calls Hierarchy


TfrmTemplateEditor.mnuTemplateClick
 ├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...
 └TdmodShared.NeedsCollapsing

Calls

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


Source

3087  procedure TfrmTemplateEditor.mnuTemplateClick(Sender: TObject);
3088  var
3089    Tree: TTreeView;
3090  
3091  begin
3092    FFromMainMenu := TRUE;
3093    Tree := FCurTree;
3094    if (assigned(Tree) and assigned(Tree.Selected)) then
3095    begin
3096      if (Tree = tvShared) then
3097        mnuTDelete.Enabled := ((sbShDelete.Visible) and (sbShDelete.Enabled))
3098      else
3099        mnuTDelete.Enabled := ((sbPerDelete.Visible) and (sbPerDelete.Enabled));
3100      if (assigned(Tree) and assigned(Tree.Selected) and assigned(Tree.Selected.Data)) then
3101      begin
3102        mnuTCopy.Enabled := (TTemplate(Tree.Selected.Data).RealType in [ttDoc, ttGroup, ttClass]);
3103        mnuSort.Enabled := (TTemplate(Tree.Selected.Data).RealType in AllTemplateFolderTypes) and
3104          (Tree.Selected.HasChildren) and
3105          (Tree.Selected.GetFirstChild.GetNextSibling <> nil);
3106      end
3107      else
3108      begin
3109        mnuTCopy.Enabled := FALSE;
3110        mnuSort.Enabled := FALSE;
3111      end;
3112      FPasteNode := Tree.Selected;
3113      mnuTPaste.Enabled := PasteOK;
3114    end
3115    else
3116    begin
3117      mnuTCopy.Enabled := FALSE;
3118      mnuTPaste.Enabled := FALSE;
3119      mnuTDelete.Enabled := FALSE;
3120      mnuSort.Enabled := FALSE;
3121    end;
3122    mnuNewTemplate.Enabled := btnNew.Enabled;
3123    mnuAutoGen.Enabled := btnNew.Enabled;
3124    mnuFindShared.Checked := FFindShOn;
3125    mnuFindPersonal.Checked := FFindPerOn;
3126    mnuShCollapse.Enabled := dmodShared.NeedsCollapsing(tvShared);
3127    mnuPerCollapse.Enabled := dmodShared.NeedsCollapsing(tvPersonal);
3128  end;