TBoldAbstractListHandle¶
Superclass for all list handles.
Unit: BoldAbstractListHandle
Declaration¶
Hierarchy¶
- TComponent
- TBoldSubscribableComponent
- TBoldElementHandle
- TBoldNonSystemHandle
- TBoldRootedHandle
- TBoldAbstractListHandle
- Direct subclasses
TBoldCursorHandle
Description¶
TBoldAbstractListHandle is an abstract superclass for handles with a cursor-type behaviour. Its purpose is to represent a list of elements, and a position in that list.
It is an extension of TBoldElementHandle in that it really has two values, the List property, and the Value property, where this Value property is effectively List[CurrentIndex]. There are a number of visual controls, notably TBoldNavigator, TBoldGrid and TBoldListBox that connect to a list handle. They are a bit special compared to other controls in that they not only manipulate values in the Object-Space, but also can set CurrentIndex, which resides in the listhandle itself.
The handle is designed to make Chained Evaluation as natural as possible.
Properties¶
| Name | Summary | Notes |
|---|---|---|
| Count | Number of elements in the list. | read-only |
| CurrentBoldObject | CurrentElement as TBoldObject . | read-only |
| CurrentElement | Current element in list. | read-only |
| CurrentIndex | Current position in list. | |
| HasNext | Use HasNext to determine if at end of list. | read-only |
| HasPrior | Indicates whether it is possible to move backward in the list. | read-only |
| List | List represented by handle. | read-only |
| ListElementType | Type of elements in List. | read-only |
| ListType | The "Best Available" type | read-only |
| MutableList | Returns a list that is possible to change. | read-only |
| MutableObjectList | Returns the MutableList as a TBoldObjectList. | read-only |
| ObjectList | Returns the List as a TBoldObjectList. | read-only |
| StaticListType | The list type of the StaticBoldType | read-only |
Count¶
This is mostly equivalent to List.Count, with the added provision of being 0 if List is **nil**.
CurrentBoldObject¶
If CurrentElement is a TBoldObject, then this property will be that value, type cast to a TBoldObject, otherwise an exception will be raised.
CurrentElement¶
CurrentElement returns the element that is current in the list. This will be the same as the value property of the handle
CurrentIndex¶
This property can be read to find the current index of the listhandle, or set programmatically to change the current index in the list.
See Also
HasNext¶
HasNext is a concept similar to Eof, but returning true while there is a next element.
Example:
| aListHandle.First; while aListHandle.HasNext do aListHandle.Next; |
|---|
HasPrior¶
This is true if the CurrentIndex property is greater than 0.
List¶
List represented by handle.
ListElementType¶
This is the type of the elements of the list.
| Note |
|---|
This is subtly different from BoldType. It will be equivalent to BoldType when (Value <> **nil**) or (List = **nil**). However if there is list, but (Value = **nil**), either because the list is empty, or (CurrentIndex = -1), ListElementType will be the type of the elements in that list, rather than StaticBoldType. |
|---|
ListType¶
The type of the list, if available. StaticListType, otherwise.
MutableList¶
MutableObjectList will return a list that is possible to change. If the List is mutable, it will be used.
MutableObjectList¶
MutableObjectList will determine if the MutableList is a TBoldObjectList. If so the the list will be returned as such, otherwise **nil** will be returned
ObjectList¶
ObjectList will determine if the List is a TBoldObjectList. If so, the list will be returned as such, otherwise **nil** will be returned.
StaticListType¶
The list type of the StaticBoldType
Methods¶
| Name | Summary | Notes |
|---|---|---|
| First | Sets CurrentIndex to 0. | |
| GetCurrentElement | Get-method for the CurrentElement property | protected, abstract |
| GetCurrentIndex | Get-method for the CurrentIndex property | protected, abstract |
| GetList | Get-method for the List property | protected, abstract |
| GetMutableList | Get-method for the MutableList property | protected, virtual |
| Last | Set CurrentIndex to Count - 1. | |
| Next | Move forward in list | |
| Prior | Move backwards in the list | |
| RemoveCurrentElement | Remove current element from list | |
| SetCurrentIndex | Set-method for the CurrentIndex property | protected, abstract |
First¶
Sets CurrentIndex to 0.
GetCurrentElement¶
Get-method for the CurrentElement property
GetCurrentIndex¶
Get-method for the CurrentIndex property
GetList¶
Get-method for the List property
GetMutableList¶
Get-method for the MutableList property
Last¶
Set CurrentIndex to Count - 1.
Next¶
Increases CurrentIndex if it is less than Count.
Prior¶
Decrease CurrentIndex if it is more than 0.
RemoveCurrentElement¶
Remove the CurrentElement from the List. If the list is a class-list (such as Person.allInstances), this will result in the object being deleted.
SetCurrentIndex¶
Set-method for the CurrentIndex property
Generated from the Bold 4.0 help (Help/BfD.chm) by Tools/chm2mkdocs.py; member lists reflect Bold 4.0, see the source for members added since.