Public Member Functions | |
this (Dialog parent, int id) | |
Constructs a TreeView object to interface a given tree-view control. | |
this (WindowBase parent, int id, Rect position) | |
Constructs a tree-view control to be created at runtime. | |
this (FrameWindow parent, int id) | |
Constructs a tree-view control to be used as the client pane of a FrameWindow. | |
override void | create () |
Creates the tree-view interface element. | |
TreeItem | addAtTop (string label) |
Adds a top-level item displaying the given text, in the top-most position. | |
TreeItem | addAtTop (TreeItem item) |
Adds the given top-level item at the top-most position. | |
TreeItem | addAtBottom (string label) |
Adds a top-level item displaying the given text, at the bottom-most position. | |
TreeItem | addAtBottom (TreeItem item) |
Adds the given top-level item at the bottom-most position. | |
TreeItem | addSorted (string label) |
Adds a top-level item displaying the given text, in its alphabetical position. | |
TreeItem | addSorted (TreeItem item) |
Adds the given top-level item in its alphabetical position. | |
TreeItem | addAfter (TreeItem pos, string label) |
Adds an item at a position in the tree specified by a sibling item. | |
TreeItem | addAfter (TreeItem pos, TreeItem item) |
Adds an item at a position in the tree specified by a sibling item. | |
void | endEdit (bool cancel) |
Ends editing of an item in the tree. | |
void | sort () |
Sorts siblings at all levels in the tree. | |
int | processEdit (uint message, uint wParam, int lParam, WindowBase receivedVia, out bool swallow) |
Listener to help with the processing of label editing messages. | |
Operators | |
TreeView | opCatAssign (string label) |
Adds an item displaying the given text, as a top-level tree item. | |
TreeView | opCatAssign (TreeItem item) |
Adds the given item as a top-level tree item. | |
TreeItem | opIndex (int i) |
Gets the top-level item with the specified index. | |
TreeItem | opIndex (HTREEITEM h) |
Gets the tree item identified by a handle. | |
Properties | |
TreeItem | root () |
The root of the tree. | |
TreeItem | selected () |
The currently selected item in the tree, or null if no item is selected. | |
TreeItem | selected (TreeItem i) |
The currently selected item in the tree, or null if no item is selected. | |
ImageList | imageList () |
The tree's image list. | |
ImageList | imageList (ImageList il) |
The tree's image list. | |
uint | indent () |
The width of an indentation level in pixels. | |
void | indent (uint i) |
The width of an indentation level in pixels. | |
uint | count () |
The total number of items in the tree. | |
uint | countVisible () |
The number of items that are completely visible in this tree. | |
TreeItem | scrollPosition () |
The top-most visible item in this tree. | |
void | scrollPosition (TreeItem i) |
The top-most visible item in this tree. | |
Public Attributes | |
deprecated typedef TreeItem | Item |
Protected Member Functions | |
Callback Methods | |
bool | prepareEdit (TreeItem item) |
Prepares to edit the text of an item in the tree. | |
bool | acceptEdit (TreeItem item, string newText) |
Finishes user editing of an item in the tree. |
Unlike most SDWF control classes, TreeView includes methods designed to be overridden by the programmer in a derived class. These are provided to facilitate handling of edits using the processEdit listener.
smjg.libs.sdwf.commoncontrol.TreeView.this | ( | Dialog | parent, | |
int | id | |||
) |
Constructs a TreeView object to interface a given tree-view control.
Reimplemented from smjg.libs.sdwf.control.Control.
smjg.libs.sdwf.commoncontrol.TreeView.this | ( | WindowBase | parent, | |
int | id, | |||
Rect | position | |||
) |
smjg.libs.sdwf.commoncontrol.TreeView.this | ( | FrameWindow | parent, | |
int | id | |||
) |
TreeView smjg.libs.sdwf.commoncontrol.TreeView.opCatAssign | ( | string | label | ) |
TreeItem smjg.libs.sdwf.commoncontrol.TreeView.opIndex | ( | int | i | ) |
Gets the top-level item with the specified index.
(Implementation of this[i]
.)
This operator is syntactic sugar for root[i]
.
i | index of item to retrieve. |
TreeItem smjg.libs.sdwf.commoncontrol.TreeView.opIndex | ( | HTREEITEM | h | ) |
Gets the tree item identified by a handle.
(Implementation of this[h]
.)
h | handle of tree item. |
null
if the item doesn't exist in this tree.TreeItem smjg.libs.sdwf.commoncontrol.TreeView.root | ( | ) |
The root of the tree.
TreeItem smjg.libs.sdwf.commoncontrol.TreeView.selected | ( | ) |
The currently selected item in the tree, or null
if no item is selected.
The currently selected item in the tree, or null
if no item is selected.
ImageList smjg.libs.sdwf.commoncontrol.TreeView.imageList | ( | ) |
The tree's image list.
ImageList smjg.libs.sdwf.commoncontrol.TreeView.imageList | ( | ImageList | il | ) |
The tree's image list.
An image list is used to display a graphic in addition to the text for every item in a TreeView. By default, every item shows the first image (index 0) of the list.
uint smjg.libs.sdwf.commoncontrol.TreeView.indent | ( | ) |
The width of an indentation level in pixels.
void smjg.libs.sdwf.commoncontrol.TreeView.indent | ( | uint | i | ) |
The width of an indentation level in pixels.
uint smjg.libs.sdwf.commoncontrol.TreeView.count | ( | ) |
The total number of items in the tree.
uint smjg.libs.sdwf.commoncontrol.TreeView.countVisible | ( | ) |
The number of items that are completely visible in this tree.
TreeItem smjg.libs.sdwf.commoncontrol.TreeView.scrollPosition | ( | ) |
The top-most visible item in this tree.
void smjg.libs.sdwf.commoncontrol.TreeView.scrollPosition | ( | TreeItem | i | ) |
The top-most visible item in this tree.
override void smjg.libs.sdwf.commoncontrol.TreeView.create | ( | ) | [virtual] |
Creates the tree-view interface element.
Reimplemented from smjg.libs.sdwf.control.Control.
TreeItem smjg.libs.sdwf.commoncontrol.TreeView.addAtTop | ( | string | label | ) |
Adds a top-level item displaying the given text, in the top-most position.
This method is syntactic sugar for root.addAtTop(label)
.
label | text of item to add to tree. |
Adds the given top-level item at the top-most position.
This method is syntactic sugar for root.addAtTop(item)
.
item | the item to add to the tree. |
TreeItem smjg.libs.sdwf.commoncontrol.TreeView.addAtBottom | ( | string | label | ) |
Adds a top-level item displaying the given text, at the bottom-most position.
This method is syntactic sugar for root.addAtBottom(label)
.
label | text of item to add to tree. |
Adds the given top-level item at the bottom-most position.
This method is syntactic sugar for root.addAtBottom(item)
.
item | the item to add to the tree. |
TreeItem smjg.libs.sdwf.commoncontrol.TreeView.addSorted | ( | string | label | ) |
Adds a top-level item displaying the given text, in its alphabetical position.
This method is syntactic sugar for root.addSorted(label)
.
label | text of item to add to tree. |
Adds the given top-level item in its alphabetical position.
This method is syntactic sugar for root.addSorted(item)
.
item | the item to add to the tree. |
Adds an item at a position in the tree specified by a sibling item.
pos | item after which this one will be added. | |
label | text of item to add to tree. |
Adds an item at a position in the tree specified by a sibling item.
pos | item after which this one will be added. | |
item | the item to add to the tree |
void smjg.libs.sdwf.commoncontrol.TreeView.endEdit | ( | bool | cancel | ) |
Ends editing of an item in the tree.
cancel | true to cancel edit; false to save the result. |
void smjg.libs.sdwf.commoncontrol.TreeView.sort | ( | ) |
Sorts siblings at all levels in the tree.
This method is syntactic sugar for root.sort()
.
int smjg.libs.sdwf.commoncontrol.TreeView.processEdit | ( | uint | message, | |
uint | wParam, | |||
int | lParam, | |||
WindowBase | receivedVia, | |||
out bool | swallow | |||
) |
Listener to help with the processing of label editing messages.
This listener must be added to the TreeView's parent window or dialog.
This listener handles the Enter and Esc keystrokes while the user is editing the text of a tree item. It also calls the prepareEdit and acceptEdit functions when the user begins or ends editing the text of an item.
bool smjg.libs.sdwf.commoncontrol.TreeView.prepareEdit | ( | TreeItem | item | ) | [protected] |
Prepares to edit the text of an item in the tree.
This can be overridden e.g. to prevent editing of certain items within the tree.
For this to work, the processEdit listener must have been added to the parent window or dialog.
The default implementation does nothing but returns true
.
item | the item to edit. |
true | to allow the item to be edited. | |
false | to prevent the item from being edited. |
bool smjg.libs.sdwf.commoncontrol.TreeView.acceptEdit | ( | TreeItem | item, | |
string | newText | |||
) | [protected] |
Finishes user editing of an item in the tree.
This can be overridden to validate the user's edit, or to update entities external to the TreeView to reflect the changed text.
For this to work, the processEdit listener must have been added to the parent window or dialog.
The default implementation does nothing but returns true
.
item | the item that has been edit. | |
newText | the newly entered text. |
true | to accept the edit. | |
false | to revert the item's text to what it was before the edit. |
deprecated typedef TreeItem smjg.libs.sdwf.commoncontrol.TreeView.Item |