Aztec® Programming Language
Version 1.1 Alpha 2

Copyright © 2010-2017, Aztec Development Group, All Rights Reserved

Download Aztec

Search        Contact Us

There's somethin' in a Sunday...

Makes a body feel alone.

- Kris Kristofferson

 

aztec.ui.ListItem

public class ListItem from<Window>

Base

Window

ListItem

The ListItem class provides a UI window that respresents a single row within a ListMaster control.

ListItem Methods

ListItem() Constructor for the ListItem class
Index() Returns the one based index for the list item within the ListMaster control
ColumnText() Returns the text string associated with the specified column
SetColumnText Sets the text string for the specified column
Select() Manually selects the ListItem object
Unselect() Manually unselects the ListIitem object
Remove() Removes the ListItem object from the ListMaster control
AttachedObject() Returns the reference to the Attached Object for this ListItem object.
AddItemSelectHandler() Virtual method to register an event handler for an item select event using a method reference
AddItemSelectHandler() Virtual method to register to an event handler for an item select event using an ISelectItem reference
OnItemSelect() Virtual method to handle ItemSelect events - can be overridden

Derived Classes

See Also

 


ListItem()

public method ListItem(Window Parent, string Text, int Index = 0, BitMap ItemBitMap = null, Base AttachedObject = null)

Parameters

Parent

Parent window for the TreeItem window (MUST be a TreeMaster or TreeItem object)

Text

Text string to be displayed for the TreeItem

Index

One based index for position of the item within the list (0 is default)

ItemBitMap

Bitmap for the item (null is default)

AttachedObject

Reference to an object which becomes attached to this TreeItem object (null is default)

Return Value

None

Description

Constructor for the ListItem class. It creates a new list item in a ListMaster object (which is specified as the parent of this item). The ListMaster() method can be used to retrieve the ListMaster parent. The list item can have a bitmap specified, which will be displayed to the left of the text string for column 1. The bitmap size should be 16 x 16 if used (null is the default).

 

The text specified here is used for the first column. Text for all of the other columns can be set using the SetColumnText() method.

 

It is also possible to attach any type of object to the list item, which can be queried at any time in the future using the AttachedObject() method.

 

ListItemClass


Index()

public method<int> Index()

Parameters

None

Return Value

One based index for position of the list item

Description

This public method returns the one based index for the position of the list item in the ListMaster control.

 

ListItem Class


ColumnText()

public method<string> ColumnText(int Index)

Parameters

Index

One based index for the column

Return Value

Text associated with the specified column

Description

This public method returns the text associated with the one based column for this particular list item. It will be an empty string if the column index is invalid.

 

ListItem Class


SetColumnText()

public method SetColumnText(int Index, string ColumnText)

Parameters

Index

One based index for the column

ColumnText

Text to be associated with the specified column

Return Value

None

Description

This public method sets the text string to be associated with the one based column for this particular list item. This does not need to be called for column 1, as it is specified in the constructor.

 

ListItem Class


Select()

public method Select(bool SendEvents = false)

Parameters

SendEvents

Invokes event handler(s) if true (false by default)

Return Value

None

Description

This public method manually selects this ListItem object as if it were selected by the user. If there are one or more event handlers set up for this list item, they will be invoked if the SendEvents flag is true.

 

ListItem Class


Unselect()

public method Unselect()

Parameters

None

Return Value

None

Description

This public method manually unselects this ListItem object.

 

ListItem Class


Remove()

public method Remove()

Parameters

None

Return Value

None

Description

This public method removes this ListItem object from the ListMaster control. Once it is removed, the ListItem object is not usable, as it is no longer connected to a valid control.

 

ListItem Class


AttachedObject()

public method<Base> AttachedObject()

Parameters

None

Return Value

Reference to the attached object

Description

This public method returns the reference to the object which was attached to this list item object in the constructor (which is null by detault).

 

ListItem Class


AddItemSelectHandler()

public virtual method AddItemSelectHandler(ItemSelectHandler Handler, Base ExtraObject = null)

Parameters

Handler

Method reference to be executed when the event occurs

ExtraObject

Optional object which will be sent along to each event handler when it is executed

Return Value

NONE

Description

This virtual method registers a method reference to be executed when an "item select" event occurs within the list item. An optional object can also be registered which will be sent to each event handler as it is executed.

 

As is true with all Aztec event handling, this method can be called by any thread. When the event occurs, each registered event handler is scheduled to execute within the thread that registered it. So an event sent to one thread can be handled by event handlers executing in one or more other threads.

 

The ItemSelectHandler data type represents a method reference specific to a handler for ItemSelectEvent. ItemSelectHandler is defined as follows:

 

        public type<method<ItemSelectEvent,Base>> ItemSelectHandler

 

Given this definition, the method handler must be defined with the following signature (name can be anything):

 

        public method ItemSelectMethod(ItemSelectEvent event, Base Extra) { }.

 

ListItem Class


AddItemSelectHandler()

public virtual method AddItemSelectHandler(ISelectItem Interface, Base ExtraObject = null)

Parameters

Interface

Reference to an ISelectItem object

ExtraObject

Optional object which will be sent along to each event handler when it is executed

Return Value

NONE

Description

This method registers an ISelectItem interface object to be executed when an "item select" event occurs with this item. An optional object can also be registered which will be sent to each event handler as it is executed.

 

As is true with all Aztec event handling, this method can be called by any thread. When the event occurs, each registered event handler is scheduled to execute within the thread that registered it. So an event sent to one thread can be handled by event handlers executing in one or more other threads.

 

When the item is selected, the OnItemSelect() method within the ISelectItem object will be executed.

 

ListItem Class


OnItemSelect()

public virtual method OnItemSelect(ItemSelectEvent SelectEvent, Base ExtraObject)

Parameters

SelectEvent

ItemSelectEvent object associated with the event

ExtraObject

Optional object sent along from when it was registered

Return Value

NONE

Description

This method is the event handler for ItemSelectEvent within the tree item. It is invoked internally when the item is selected by the user. This method in turn executes every registered handler with the same argument list which comes in. Both implementations of the ListItem.AddItemSelectHandler() method register the event handlers which get invoked by this method.

 

If this method is overridden by a class derived from TreeItem, it must call this implementation of the method if it needs to execute handlers registered with the ListItem.AddItemSelectHandler() methods.

 

ListItem Class

 

Copyright © 2010-2017

Aztec Development Group

All Rights Reserved

Download Aztec