Here are some tips for easier using of NxLinkMenu!
After adding component on form it would be useful to add 2 buttons. One for adding section, and other for adding items to section.
In first buttton event OnClick add this:
CODE
var
ASection: TSection;
begin
NxLinkMenu1.Sections.Add; // adding section
SectionCount := NxLinkMenu1.Sections.Count-1;
ASection := TSection(NxLinkMenu1.Sections.Items[SectionCount]);
ASection.Caption := 'Newly added section'; // adding text to caption of last added section
end;
ASection: TSection;
begin
NxLinkMenu1.Sections.Add; // adding section
SectionCount := NxLinkMenu1.Sections.Count-1;
ASection := TSection(NxLinkMenu1.Sections.Items[SectionCount]);
ASection.Caption := 'Newly added section'; // adding text to caption of last added section
end;
In second button event OnClick add:
CODE
var
AItem: TSectionItem;
begin
AItem := TSectionItem(TSection(NxLinkMenu1.Sections.Items[SectionCount]).Items.Add); // adding item
AItem.Caption := 'This is new item'; // adding text to new item
AItem.Section.Expanded := True;
end;
AItem: TSectionItem;
begin
AItem := TSectionItem(TSection(NxLinkMenu1.Sections.Items[SectionCount]).Items.Add); // adding item
AItem.Caption := 'This is new item'; // adding text to new item
AItem.Section.Expanded := True;
end;