Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TInspectorBar
Adding a tree structure in the InspectorBar

A tree structure can be added in InspectorBar items by using the item's Level property. By default, all items have Level = 0, meaning that all items are treated as root items. When Level is set to a value different from zero, this means that the item becomes the child item of another item before this item with a smaller Level property value. In this sample code snippet, a panel is programmatically created and a tree structure of a root item, a child item and a child of this child item is inserted.
begin
  InspectorBar1.Panels.Add;
  InspectorBar1.PanelCaption.SideDisplay := true;
  InspectorBar1.PanelCaption.SideWidth := 20;
  InspectorBar1.PanelCaption.OpenCloseGraphic := ocgCross;
  InspectorBar1.Mode := imMultiPanelActive;
  InspectorBar1.Panels[0].Caption := 'A panel';
  InspectorBar1.Panels[0].ItemHeight := 23;
  InspectorBar1.Panels[0].Items.Add;
  InspectorBar1.Panels[0].Items.Add;
  InspectorBar1.Panels[0].Items.Add;
  InspectorBar1.Panels[0].Items.Add;
  InspectorBar1.Panels[0].Style := psProperties;
  InspectorBar1.Panels[0].Items[0].Level := 0;
  InspectorBar1.Panels[0].Items[0].Caption := 'Root 0';
  InspectorBar1.Panels[0].Items[1].Level := 1;
  InspectorBar1.Panels[0].Items[1].Caption := 'Item';
  InspectorBar1.Panels[0].Items[2].Level := 2;
  InspectorBar1.Panels[0].Items[2].Caption := 'SubItem';
  InspectorBar1.Panels[0].Items[3].Level := 0;
  InspectorBar1.Panels[0].Items[3].Caption := 'Root 1';
end;