- Bob Marley
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
None
See Also
Class Hierarchy, Frame, ChildFrame, Dialog, TreeMaster
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
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
public method Expand()
Parameters
None
Return Value
None
Description
This public method expands theTreeItem object and displays the items below it.
TreeItem Class
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
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
public method Unselect()
Parameters
None
Return Value
None
Description
This public method manually unselects this TreeItem object.
TreeItem Class
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
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
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
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
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