Skip to content

TBoldAbstractListHandle

Superclass for all list handles.

Unit: BoldAbstractListHandle

Declaration

TBoldAbstractListHandle = class(TBoldRootedHandle)

Hierarchy

  1. TComponent
  2. TBoldSubscribableComponent
  3. TBoldElementHandle
  4. TBoldNonSystemHandle
  5. TBoldRootedHandle
  6. TBoldAbstractListHandle
  7. Direct subclasses
  8. 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

property Count: Integer;

This is mostly equivalent to List.Count, with the added provision of being 0 if List is **nil**.

CurrentBoldObject

property CurrentBoldObject: TBoldObject;

If CurrentElement is a TBoldObject, then this property will be that value, type cast to a TBoldObject, otherwise an exception will be raised.

CurrentElement

property CurrentElement: TBoldElement;

CurrentElement returns the element that is current in the list. This will be the same as the value property of the handle

CurrentIndex

property CurrentIndex: Integer;

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

property HasNext: Boolean;

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

property HasPrior: Boolean;

This is true if the CurrentIndex property is greater than 0.

List

property List: TBoldList;

List represented by handle.

ListElementType

property ListElementType: TBoldElementTypeInfo;

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

property ListType: TBoldListTypeInfo;

The type of the list, if available. StaticListType, otherwise.

MutableList

property MutableList: TBoldList;

MutableObjectList will return a list that is possible to change. If the List is mutable, it will be used.

MutableObjectList

property MutableObjectList: TBoldObjectList;

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

property ObjectList: TBoldObjectList;

ObjectList will determine if the List is a TBoldObjectList. If so, the list will be returned as such, otherwise **nil** will be returned.

StaticListType

property StaticListType: TBoldListTypeInfo;

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

procedure First;

Sets CurrentIndex to 0.

GetCurrentElement

function GetCurrentElement: TBoldElement; virtual; abstract;

Get-method for the CurrentElement property

GetCurrentIndex

function GetCurrentIndex: Integer; virtual; abstract;

Get-method for the CurrentIndex property

GetList

function GetList: TBoldList; virtual; abstract;

Get-method for the List property

GetMutableList

function GetMutableList: TBoldList; virtual;

Get-method for the MutableList property

Last

procedure Last;

Set CurrentIndex to Count - 1.

Next

procedure Next;

Increases CurrentIndex if it is less than Count.

Prior

procedure Prior;

Decrease CurrentIndex if it is more than 0.

RemoveCurrentElement

procedure 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

procedure SetCurrentIndex(Value: Integer); virtual; abstract;

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.