Function

TfrmTemplateEditor.AllowMove

Module

fTemplateEditor

Last Modified

7/15/2014 3:26:44 PM

Visibility

Protected

Owner

TfrmTemplateEditor

Declaration

function AllowMove(ADropNode, ADragNode: TTreeNode): boolean;

Calls Hierarchy


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...

Called-By Hierarchy


                          TfrmTemplateEditor.AllowMove
                TfrmTemplateEditor.EnableNavControls┤ 
                 TfrmTemplateEditor.EnableControls┤ │ 
                 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┤ │ │   │ │ 
     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.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.cbActiveClick┤ │ 
               TfrmTemplateEditor.cbShHideClick...┤ │ 
              TfrmTemplateEditor.cbPerHideClick...┤ │ 
                      TfrmTemplateEditor.Resync...┘ │ 
                   TfrmTemplateEditor.tvTreeDragOver┤ 
                TfrmTemplateEditor.tvTreeDragDrop...┤ 
                          TfrmTemplateEditor.PasteOK┘ 
              TfrmTemplateEditor.popTemplatesPopup┤   
              TfrmTemplateEditor.mnuNodePasteClick┤   
               TfrmTemplateEditor.mnuTemplateClick┘   

Calls

Name Declaration Comments
TTemplate.GetItems function GetItems: TList; -
TfrmTemplateEditor.IsTemplateLocked function IsTemplateLocked(Node: TTreeNode): boolean; -

Called-By

Name Declaration Comments
TfrmTemplateEditor.EnableNavControls procedure EnableNavControls; -
TfrmTemplateEditor.PasteOK function PasteOK: boolean; -
TfrmTemplateEditor.tvTreeDragDrop procedure tvTreeDragDrop(Sender, Source: TObject; X, Y: Integer); -
TfrmTemplateEditor.tvTreeDragOver procedure tvTreeDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); -


Source

2127  function TfrmTemplateEditor.AllowMove(ADropNode, ADragNode: TTreeNode): boolean;
2128  var
2129    i: integer;
2130    TmpNode: TTreeNode;
2131    DragTemplate, DropTemplate: TTemplate;
2132  
2133  begin
2134    if (assigned(ADropNode) and assigned(ADragNode)) then
2135    begin
2136      DropTemplate := TTemplate(ADropNode.Data);
2137      DragTemplate := TTemplate(ADragNode.Data);
2138      if IsTemplateLocked(ADropNode) then
2139        Result := FALSE
2140      else
2141        Result := (DragTemplate.RealType in [ttDoc, ttGroup, ttClass]);
2142      if (Result) then
2143      begin
2144        if (FCopying) then
2145        begin
2146          if (DropTemplate.Items.IndexOf(DragTemplate) >= 0) then
2147            Result := FALSE;
2148        end
2149        else
2150          if ((assigned(ADragNode.Parent)) and (ADropNode <> ADragNode.Parent) and
2151            (DropTemplate.Items.IndexOf(DragTemplate) >= 0)) then
2152            Result := FALSE;
2153      end;
2154      if (Result) then
2155      begin
2156        for i := 0 to DropTemplate.Nodes.Count - 1 do
2157        begin
2158          TmpNode := TTreeNode(DropTemplate.Nodes.Objects[i]);
2159          while (Result and (assigned(TmpNode.Parent))) do
2160          begin
2161            if (TmpNode.Data = DragTemplate) then
2162              Result := FALSE
2163            else
2164              TmpNode := TmpNode.Parent;
2165          end;
2166          if (not Result) then break;
2167        end;
2168      end;
2169    end
2170    else
2171      Result := FALSE;
2172  end;