YOUSEFUL / DELPHI / COMPONENTS

TAtlasLoadChildrenEvent

The type of TAtlasTree.OnLoadChildren: procedure(Sender: TObject; Node: TTreeNode) of object.

Type Unit Atlas.Tree · Product Atlas VCL

Description

TAtlasLoadChildrenEvent = procedure(Sender: TObject; Node: TTreeNode) of object;. Sender is the TAtlasTree, Node the lazy node being expanded for the first time.

This type has no members of its own beyond those listed in its description.

Examples

Declare and attach a loader

Expanding Catalog creates three children, Catalog / part 1 to Catalog / part 3.

pascal
uses System.SysUtils, Vcl.ComCtrls, Atlas.Tree;

type
  TCatalogLoader = class
    // Matches TAtlasLoadChildrenEvent.
    procedure LoadChildren(Sender: TObject; Node: TTreeNode);
  end;

procedure TCatalogLoader.LoadChildren(Sender: TObject; Node: TTreeNode);
var
  I: Integer;
begin
  for I := 1 to 3 do
    (Sender as TAtlasTree).AddNode(Node, Node.Text + ' / part ' + IntToStr(I));
end;

procedure AttachLoader(Tree: TAtlasTree; Loader: TCatalogLoader);
begin
  Tree.OnLoadChildren := Loader.LoadChildren;
  Tree.AddNode(nil, 'Catalog', True); // children are created on first expand
end;

TAtlasTree

Also in Atlas VCL

TAtlasTable · TAtlasGrid · TAtlasValueEdit · TAtlasTree · TAtlasWorkbook · TAtlasSheetGrid · TAtlasPivot · TAtlasInspector · TAtlasRichEdit · TAtlasSpellChecker · TAtlasChart · TAtlasGauge · TAtlasThemer · TAtlasWizard · TAtlasWorkspace · TAtlasCommandBar · TAtlasActionTile · TAtlasTileBoard · TAtlasNavigation · TAtlasMap · TAtlasGraph · TAtlasDiagram · TAtlasPrintDocument · TAtlasSchedule · TAtlasScheduler · TAtlasTaskPlan · TAtlasGantt · TAtlasPdfDocument · TAtlasPdfViewer