TW3ListItems
Class used for maintaining items in TW3ListMenu component. Items are stored into TObjectList list which may be managed via methods and properties bellow.
Unit: SmartCL.istMenu.pas
- Hierarchy
- TObject
- TW3OwnedObject
- TW3ListItems
- TW3OwnedObject
Properties |
---|
Count |
Items |
Methods |
Add |
Clear |
IndexOf |
Remove |
RemoveByRef |
Properties
Count
Determine number of items inside list menu.
property Count: Integer read getCount;
Items
Identify TW3ListItem item at specified index. This property is zero-based.
property Items[index: Integer]: TW3ListItem read getItem; default;
Methods
Add
Create new item at the end of items list, and returns reference to it.
function Add: TW3ListItem;
As this method returns reference to newly created item, it may be set in same line.
Example:
W3ListMenu1.Items.Add.Text:= 'My Item';
Clear
Delete all items from list. After calling this method, Count property will return 0.
procedure Clear;
IndexOf
Determine index of item.
function indexOf(aItem: TW3ListItem): Integer;
Parameters:
aItem
- TW3ListItem
- Item’s reference requesting for index.
Remove
Remove item with specified index from list. If index in inside bounds, Count property value will be decreased.
procedure Remove(index: Integer);
index
- Integer
- Index of item (zero-based) to be destroyed and removed from list.
Remarks:
Item is also destroyed. Any outside reference to item will be invalid after this method is called.
RemoveByRef
Remove item with specified reference (address).
procedure RemoveByRef(aItem: TW3ListItem);
aItem
- TW3ListItem
- Item’s reference requesting to be deleted.
This method internally calls IndexOf method in order to determine Item’s index. Then, Remove method with obtained index is called.
See also: IndexOf