unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, NxCollection, ImgList;

type
  TForm1 = class(TForm)
    NxPathControl1: TNxPathControl;
    Button1: TButton;
    Button2: TButton;
    ImageList1: TImageList;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  PicturesItem: TNxPathNode;
begin
// 1. Add root item
  NxPathControl1.Items.AddChild(nil);

// 2. Set properties of 1st item in Items array
  NxPathControl1.Items[0].Text := 'Music';
  NxPathControl1.Items[0].ImageIndex := 0;

// 3. Add new root item and assign reference to PicturesItem variable
  PicturesItem := TNxPathNode(NxPathControl1.Items.AddChild(nil));

  PicturesItem.Text := 'Pictures';
  PicturesItem.ImageIndex := 1;

  Button2.Enabled := True;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  DecadesItem: TNxPathNode;
begin
// 1. Add new child item inside 1st item inside Items array
  NxPathControl1.Items.AddChild(NxPathControl1.Items[0]).Text := 'Genres';

// 2. Manually create item's object and then add it into array
  DecadesItem := TNxPathNode.Create;
  DecadesItem.Text := 'Decades';
                             
  NxPathControl1.Items.AddItem(NxPathControl1.Items[0], DecadesItem);
end;

end.
