Aztec® Programming Language
Version 1.1 Alpha 2

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

Download Aztec

Search        Contact Us

Won't you help to sing...

These songs of freedom?

- Bob Marley

 

aztec.ui.TreeItem

public class TreeItem from<Window>

Base

Window

TreeItem

The TreeItem class provides a UI window that respresents a single row within a TreeMaster control.

 

A single TreeItem object (or an object derived from it) is the only valid child window for the TreeItem class.

Valid Child Window of TreeItem

 

TreeItem Methods

TreeItem() Constructor for the TreeItem class
NumItems() Number of items directly under this TreeItem
Expand() Expands the TreeItem and displays the items directly under this TreeItem
Collapse() Collapses the TreeItem so items directly under this TreeItem will not be displayed
Select() Manually selects the TreeItem object
Unselect() Manually unselects the TreeIitem object
Remove() Removes the TreeItem object from the TreeMaster control
AttachedObject() Returns the reference to the Attached Object for this TreeItem 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

 


TreeItem()

public method TreeItem(Window Parent, string Text, 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

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 TreeItem class. It creates a new tree item in a TreeMaster object (which might be specified as the parent of this item). The TreeMaster() method can be used to retrieve the top level TreeMaster parent. The tree item can have a bitmap specified, which will be displayed to the left of the text string. The bitmap size should be 16 x 16 if used (null is the default).

 

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

 

TreeItemClass


NumItems()

public method<int> NumItems()

Parameters

None

Return Value

Number of items directly below this item

Description

This public method returns the number of tree items directly below this tree item.

 

TreeItem Class


Expand()

public method Expand()

Parameters

None

Return Value

None

Description

This public method expands theTreeItem object and displays the items below it.

 

TreeItem Class


Collapse()

public method Collapse()

Parameters

None

Return Value

None

Description

This public method collapses theTreeItem object so the items below it will not be displayed.

 

TreeItem 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 TreeItem object as if it were selected by the user. If there are one or more event handlers set up for this tree item, they will be invoked if the SendEvents flag is true.

 

TreeItem Class


Unselect()

public method Unselect()

Parameters

None

Return Value

None

Description

This public method manually unselects this TreeItem object.

 

TreeItem Class


Remove()

public method Remove()

Parameters

None

Return Value

None

Description

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

 

TreeItem 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 tree item object in the constructor (which is null by detault).

 

TreeItem 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 tree 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) { }.

 

TreeItem 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.

 

TreeItem 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 TreeItem.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 TreeItem.AddItemSelectHandler() methods.

 

TreeItem Class

 


Copyright © 2010-2017

Aztec Development Group

All Rights Reserved

Download Aztec