Public Member Functions | |
this (string label, int image=0) | |
Constructs a new TreeItem. | |
TreeItem | addAtTop (string label) |
Adds an item displaying the given text, as the top-most child of this item. | |
TreeItem | addAtTop (TreeItem item) |
Adds an item as the top-most child of this item. | |
TreeItem | addAtBottom (string label) |
Adds an item displaying the given text, as the bottom-most child of this item. | |
TreeItem | addAtBottom (TreeItem item) |
Adds an item as the bottom-most child of this item. | |
TreeItem | addSorted (string label) |
Adds an item displaying the given text as a child of this item, in its alphabetical position. | |
TreeItem | addSorted (TreeItem item) |
Adds an item as as a child of this item in its alphabetical position. | |
TreeItem | addAfter (TreeItem pos, string label) |
Adds an item displaying the given text as a child of this item, at the specified position. | |
TreeItem | addAfter (TreeItem pos, TreeItem item) |
Adds an item as a child of this item, at the specified position. | |
void | remove () |
Removes this item from the tree. | |
void | ensureVisible () |
Scrolls the tree and/or expands tree branches as necessary to make this item visible. | |
void | expand () |
Expands the child items of this item. | |
void | collapse () |
Collapses the child items of this item. | |
void | toggleExpanded () |
Toggles the expanded/collapsed state of this tree item. | |
void | removeChildren () |
Removes all child items from this item. | |
void | edit () |
Starts editing of this item's text. | |
void | sortChildren () |
Sorts the children of this item alphabetically. | |
void | sort () |
Sorts the children of this item alphabetically, and recursively sorts descendants at each level. | |
void | refreshChildren () |
Refreshes the child list in the TreeItem object. | |
void | refresh () |
Refreshes the child lists of this TreeItem object and all its children. | |
Properties | |
HTREEITEM | handle () |
The Windows handle of this tree item. | |
TV_ITEMA | info () |
Information about this tree item, as a Windows TV_ITEMA structure. | |
TreeView | container () |
The TreeView of which this item is a member. | |
TreeItem | parent () |
The parent item of this one in the tree. | |
bool | isRoot () |
Whether this item is the root of a TreeView. | |
string | text () |
The text of this tree item. | |
string | text (string t) |
The text of this tree item. | |
int | image () |
The zero-based index in the image list of the image that is displayed with this tree item when it is not selected. | |
int | image (int i) |
The zero-based index in the image list of the image that is displayed with this tree item when it is not selected. | |
int | selectedImage () |
The zero-based index in the image list of the image that is displayed with this tree item when it is selected. | |
int | selectedImage (int i) |
The zero-based index in the image list of the image that is displayed with this tree item when it is selected. | |
override string | toString () |
Returns a string representation of this TreeItem. | |
int | length () |
Returns the number of children the item has. | |
Operators | |
TreeItem | opCatAssign (string label) |
Adds an item displaying the given text, as a child of this item. | |
TreeItem | opCatAssign (TreeItem item) |
Adds the given item as a child of this item. | |
TreeItem | opIndex (int i) |
Gets the child of this item with the specified index. | |
final override intBool | opEquals (Object o) |
Determines whether this TreeItem is equal to another object. | |
final bool | opEquals (TreeItem a) |
Determines whether this TreeItem is equal to another TreeItem. | |
final override int | opCmp (Object o) |
Compares this TreeItem object with another Object. | |
final int | opCmp (TreeItem it) |
Compares this TreeItem object with another, by comparing their text strings. |
Prior to SDWF 0.52, this class was TreeView.Item. Item objects were created only by the TreeView class, and automatically destructed when removed from the tree. TreeItem objects can, on the other hand, be constructed by the application programmer and are not automatically destructed. This also makes it possible to use a class derived from TreeItem to hold additional information about the entities represented by tree items.
A single TreeItem can be in only one place at a time. A TreeItem that is not present in any TreeView is a limbo item, and holds no connections with any other items.
smjg.libs.sdwf.commoncontrol.TreeItem.this | ( | string | label, | |
int | image = 0 | |||
) |
Constructs a new TreeItem.
label | the item's display text. | |
image | (since 0.56) the zero-based index in the image list of the image to display for this item. |
HTREEITEM smjg.libs.sdwf.commoncontrol.TreeItem.handle | ( | ) |
The Windows handle of this tree item.
You would use this property if you need to call a Windows API function directly on the item.
null
if this is a limbo item. TV_ITEMA smjg.libs.sdwf.commoncontrol.TreeItem.info | ( | ) |
Information about this tree item, as a Windows TV_ITEMA
structure.
TreeView smjg.libs.sdwf.commoncontrol.TreeItem.container | ( | ) |
TreeItem smjg.libs.sdwf.commoncontrol.TreeItem.parent | ( | ) |
The parent item of this one in the tree.
null
if this is a limbo item or the root of a tree.bool smjg.libs.sdwf.commoncontrol.TreeItem.isRoot | ( | ) |
string smjg.libs.sdwf.commoncontrol.TreeItem.text | ( | ) |
The text of this tree item.
string smjg.libs.sdwf.commoncontrol.TreeItem.text | ( | string | t | ) |
The text of this tree item.
int smjg.libs.sdwf.commoncontrol.TreeItem.image | ( | ) |
The zero-based index in the image list of the image that is displayed with this tree item when it is not selected.
int smjg.libs.sdwf.commoncontrol.TreeItem.image | ( | int | i | ) |
The zero-based index in the image list of the image that is displayed with this tree item when it is not selected.
int smjg.libs.sdwf.commoncontrol.TreeItem.selectedImage | ( | ) |
The zero-based index in the image list of the image that is displayed with this tree item when it is selected.
int smjg.libs.sdwf.commoncontrol.TreeItem.selectedImage | ( | int | i | ) |
The zero-based index in the image list of the image that is displayed with this tree item when it is selected.
override string smjg.libs.sdwf.commoncontrol.TreeItem.toString | ( | ) |
int smjg.libs.sdwf.commoncontrol.TreeItem.length | ( | ) |
Returns the number of children the item has.
TreeItem smjg.libs.sdwf.commoncontrol.TreeItem.opCatAssign | ( | string | label | ) |
TreeItem smjg.libs.sdwf.commoncontrol.TreeItem.opIndex | ( | int | i | ) |
Gets the child of this item with the specified index.
(Implementation of this[i]
.)
i | index of item to retrieve. |
final override intBool smjg.libs.sdwf.commoncontrol.TreeItem.opEquals | ( | Object | o | ) |
Determines whether this TreeItem is equal to another object.
final bool smjg.libs.sdwf.commoncontrol.TreeItem.opEquals | ( | TreeItem | a | ) |
final override int smjg.libs.sdwf.commoncontrol.TreeItem.opCmp | ( | Object | o | ) |
final int smjg.libs.sdwf.commoncontrol.TreeItem.opCmp | ( | TreeItem | it | ) |
Compares this TreeItem object with another, by comparing their text strings.
TreeItem smjg.libs.sdwf.commoncontrol.TreeItem.addAtTop | ( | string | label | ) |
Adds an item displaying the given text, as the top-most child of this item.
label | text of item to add to tree. |
Adds an item as the top-most child of this item.
item | the item to add to the tree. |
TreeItem smjg.libs.sdwf.commoncontrol.TreeItem.addAtBottom | ( | string | label | ) |
Adds an item displaying the given text, as the bottom-most child of this item.
label | text of item to add to tree. |
Adds an item as the bottom-most child of this item.
item | the item to add to the tree. |
TreeItem smjg.libs.sdwf.commoncontrol.TreeItem.addSorted | ( | string | label | ) |
Adds an item displaying the given text as a child of this item, in its alphabetical position.
label | text of item to add to tree. |
Adds an item as as a child of this item in its alphabetical position.
item | the item to add to the tree. |
Adds an item displaying the given text as a child of this item, at the specified position.
pos | item after which this one will be added. | |
label | text of item to add to tree. |
pos
must be a child of this item. Adds an item as a child of this item, at the specified position.
pos | item after which this one will be added. | |
item | the item to add to the tree. |
void smjg.libs.sdwf.commoncontrol.TreeItem.remove | ( | ) |
void smjg.libs.sdwf.commoncontrol.TreeItem.ensureVisible | ( | ) |
Scrolls the tree and/or expands tree branches as necessary to make this item visible.
void smjg.libs.sdwf.commoncontrol.TreeItem.expand | ( | ) |
Expands the child items of this item.
void smjg.libs.sdwf.commoncontrol.TreeItem.collapse | ( | ) |
Collapses the child items of this item.
void smjg.libs.sdwf.commoncontrol.TreeItem.toggleExpanded | ( | ) |
Toggles the expanded/collapsed state of this tree item.
void smjg.libs.sdwf.commoncontrol.TreeItem.removeChildren | ( | ) |
void smjg.libs.sdwf.commoncontrol.TreeItem.edit | ( | ) |
Starts editing of this item's text.
void smjg.libs.sdwf.commoncontrol.TreeItem.sortChildren | ( | ) |
Sorts the children of this item alphabetically.
void smjg.libs.sdwf.commoncontrol.TreeItem.sort | ( | ) |
Sorts the children of this item alphabetically, and recursively sorts descendants at each level.
void smjg.libs.sdwf.commoncontrol.TreeItem.refreshChildren | ( | ) |
void smjg.libs.sdwf.commoncontrol.TreeItem.refresh | ( | ) |