Procedure

TdmodShared.SelectNode

Module

dShared

Last Modified

7/15/2014 3:26:36 PM

Visibility

Public

Owner

TdmodShared

Declaration

procedure SelectNode(Tree: TORTreeView; GotoNodeID: string; var EmptyCount: integer);

Calls Hierarchy


TdmodShared.SelectNode
 ├FindNode
 └TdmodShared.ExpandNode
   ├ExpandTemplate
   │ ├TTemplate.GetChildren
   │ ├GetTemplateChildren
   │ ├AddTemplate
   │ │ ├TTemplate.Create
   │ │ │ └TTemplate.ReminderDialogIEN
   │ │ └TTemplate.AddChild
   │ │   └TTemplate.GetItems
   │ │     └ExpandTemplate...
   │ └TTemplate.ItemIENs
   │   └TTemplate.GetItems...
   ├TTemplate.GetItems...
   ├TdmodShared.AddTemplateNode
   │ ├AddChildObject
   │ │ └TTemplate.AddNode
   │ └TTemplate.GetChildren
   └TTemplate.GetChildren

Called-By Hierarchy


                   TdmodShared.SelectNode
                 TfrmDrawers.OpenToNode┘ 
          TfrmDrawers.ReloadTemplates┤   
       TfrmDrawers.sbTemplatesClick┤ │   
TfrmDrawers.ExternalReloadTemplates┘ │   
               TdmodShared.Reload┘   │   
 TfrmTemplateEditor.FormDestroy┘     │   
      TfrmDrawers.mnuGotoDefaultClick┘   

Calls

Name Declaration Comments
TdmodShared.ExpandNode function ExpandNode(Tree: TTreeView; Node: TTreeNode; var EmptyCount: integer; AllowInactive: boolean = FALSE): boolean; -
FindNode function FindNode(StartNode: TORTreeNode): TORTreeNode; -

Called-By

Name Declaration Comments
TfrmDrawers.OpenToNode procedure OpenToNode(Path: string = ''); -


Source

699   procedure TdmodShared.SelectNode(Tree: TORTreeView; GotoNodeID: string; var EmptyCount: integer);
700   var
701     i, j: integer;
702     IEN, PIEN: string;
703     Node: TORTreeNode;
704   
705     function FindNode(StartNode: TORTreeNode): TORTreeNode;
706     begin
707       Result := nil;
708       while assigned(StartNode) do
709       begin
710         if(Piece(StartNode.StringData, U ,1) = IEN) then
711         begin
712           Result := StartNode;
713           exit;
714         end;
715         StartNode := TORTreeNode(StartNode.GetNextSibling);
716       end;
717     end;
718   
719   begin
720     if(GotoNodeID <> '') then
721     begin
722       i := 1;
723       for j := 1 to length(GotoNodeID) do
724         if(GotoNodeID[j] = ';') then inc(i);
725       PIEN := '';
726       Node := TORTreeNode(Tree.Items.GetFirstNode);
727       repeat
728         IEN := piece(GotoNodeID, ';', i);
729         if(IEN <> '') then
730         begin
731           Node := FindNode(Node);
732           if(assigned(Node)) then
733           begin
734             if(PIEN <> '') then
735               PIEN := ';' + PIEN;
736             PIEN := IEN + PIEN;
737             if(PIEN = GotoNodeID) then
738             begin
739               Node.EnsureVisible;
740               Tree.Selected := Node;
741               IEN := '';
742             end
743             else
744             begin
745               dmodShared.ExpandNode(Tree, Node, EmptyCount);
746               Node := TORTreeNode(Node.GetFirstChild);
747               if(assigned(Node)) then
748                 dec(i)
749               else
750                 IEN := '';
751             end;
752           end
753           else
754             IEN := '';
755         end;
756       until (i < 1) or (IEN = '');
757     end;
758   end;