YOUSEFUL / DELPHI / COMPONENTS

EAtlasTreeError

The exception raised by TAtlasTree for foreign nodes, cyclic moves and invalid JSON.

Class Unit Atlas.Tree · Inherits Exception · Product Atlas VCL

Description

Raised by AddNode, MoveNode, FindCaption and SortChildren for a node of another tree, by MoveNode for a nil node or a move that would create a cycle, and by LoadJSON for an invalid document. The tree is unchanged when it is raised.

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

Examples

Try a move

Returns False instead of raising when the move is not allowed.

pascal
uses Vcl.ComCtrls, Atlas.Tree;

function TryMove(Tree: TAtlasTree; Node, NewParent: TTreeNode): Boolean;
begin
  try
    Tree.MoveNode(Node, NewParent);
    Result := True;
  except
    on EAtlasTreeError do
      Result := False; // nil node, node of another tree, or a move under its own descendant
  end;
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