Jump to content


Deja (Berg)

Member Since 15 Nov 2006
Offline Last Active Mar 12 2007 12:46 PM
-----

Topics I've Started

NxLinkMenu: Adding sections and items tips

01 February 2007 - 08:16 PM

Hello!

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;


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;