Jump to content


Photo

NxLinkMenu: Adding sections and items tips


  • This topic is locked This topic is locked
No replies to this topic

#1 Deja (Berg)

Deja (Berg)
  • Members
  • 3 posts

Posted 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;





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users