About
A TreeView? is a control used to represent a branching tree that may or may not be folded but has distinct levels.
Usage
TreeViews? are all about nodes. Since each node of a TreeView? may be a Tree all the TreeNodes? can have children added to them using the nodes property to get a TreeNodeCollection?.
Example
import dfl.all;
void main() {
auto form = new Form;
auto label = new Label;
auto tree = new TreeView;
tree.dock = DockStyle.LEFT;
tree.afterSelect ~= delegate void (TreeView t, TreeViewEventArgs e) {
label. text = "Text: " ~ e.node.text ~
"\nPath: " ~ e.node.fullPath;
};
tree.text = "I am the TreeView";
auto currentNode = new TreeNode;
currentNode.text = "First Root";
tree.nodes.add(currentNode);
currentNode = new TreeNode;
currentNode.text = "First Child";
tree.nodes[0].nodes.add(currentNode);
currentNode = new TreeNode;
currentNode.text = "Second Root";
tree.nodes.add(currentNode);
currentNode = new TreeNode;
form.controls.add(tree);
label.dock = DockStyle.FILL;
label.text = "Select a node.";
form.controls.add(label);
Application.run(form);
}
module dfl.treeview;
{
public final char[] label;
[property getter]
public final TreeNode node;
[property getter]
Inherited members
empty
}
{
public final Rect bounds;
[property getter]
public final TreeNode firstNode;
[property getter]
public static TreeNode fromHandle(TreeView tree,HTREEITEM handle);
public final char[] fullPath;
[property getter]
public final HTREEITEM handle;
[property getter]
public final int index;
[property getter]
public final TreeNode lastNode;
[property getter]
public final TreeNode nextNode;
[property getter]
public final TreeNodeCollection nodes;
[property getter]
public int opCmp(TreeNode node);
public int opCmp(char[] val);
public int opCmp(Object o);
public final TreeNode parent;
[property getter]
public final TreeNode prevNode;
[property getter]
public final Object tag;
[property getter]
public final Object tag;
[property setter]
public final char[] text;
[property setter]
public final char[] text;
[property getter]
public final TreeView treeView;
[property getter]
}
{
public void add(TreeNode node);
public void add(char[] text);
public void add(Object val);
public void add(char[] s);
public void insert(int index,char[] s);
}
{
public final BorderStyle borderStyle;
[property getter]
public final BorderStyle borderStyle;
[property setter]
public final TreeNode getNodeAt(int x,int y);
public final int indent;
[property getter]
public final int indent;
[property setter]
public final bool labelEdit;
[property setter]
public final bool labelEdit;
[property getter]
public final TreeNodeCollection nodes;
[property getter]
public final bool showLines;
[property setter]
public final bool showLines;
[property getter]
public final bool sorted;
[property setter]
public final bool sorted;
[property getter]
public final TreeNode topNode;
[property getter]
protected void wndProc(ref Message m);
Inherited members
backColor
backColorChanged
bottom
bounds
bringToFront
bringUpOne
canFocus
canSelect
capture
click
clientRectangle
clientSize
contains
containsFocus
contextMenu
contextMenuChanged
controlAdded
ControlCollection
controlRemoved
controls
createControl
createControlsInstance
created
createGraphics
createHandle
createParams
cursor
cursorChanged
defaultBackColor
defaultFont
defaultForeColor
defaultSize
defWndProc
delayInvoke
destroyHandle
disable
disableVisualStyle
displayRectangle
dispose
disposed
dock
doubleClick
enable
enabled
enabledChanged
findForm
focus
focused
font
fontChanged
foreColor
foreColorChanged
fromChildHandle
fromHandle
getAutoScaleSize
getChildAtPoint
getStyle
getTopLevel
gotFocus
handle
handleCreated
handleDestroyed
hasChildren
hasLayout
hasLayoutChanged
height
helpRequested
hide
initLayout
invalidate
invoke
invokeRequired
isHandleCreated
isMnemonic
keyDown
keyPress
keyUp
layout
left
location
lostFocus
modifierKeys
mouseButtons
mouseDown
mouseEnter
mouseHover
mouseLeave
mouseMove
mousePosition
mouseUp
mouseWheel
move
name
onBackColorChanged
onClick
onContextMenuChanged
onControlAdded
onControlRemoved
onCursorChanged
onDisposed
onDoubleClick
onEnabledChanged
onFontChanged
onForeColorChanged
onGotFocus
onHandleCreated
onHandleDestroyed
onHasLayoutChanged
onHelpRequested
onKeyDown
onKeyPress
onKeyUp
onLayout
onLostFocus
onMouseDown
onMouseEnter
onMouseHover
onMouseLeave
onMouseMove
onMouseUp
onMouseWheel
onMove
onPaint
onPaintBackground
onParentChanged
onReflectedMessage
onResize
onRightToLeftChanged
onSystemColorsChanged
onTextChanged
onVisibleChanged
opCmp
opEquals
paint
parent
parentChanged
performLayout
pointToClient
pointToScreen
preProcessMessage
processKeyEventArgs
processMnemonic
recreateHandle
recreatingHandle
rectangleToClient
rectangleToScreen
redraw
refresh
region
resetBackColor
resetCursor
resetFont
resetForeColor
resetRightToLeft
resetText
resize
resizeRedraw
resumeLayout
right
rightToLeft
rightToLeftChanged
select
selectNextControl
sendBackOne
sendToBack
setBounds
setBoundsCore
setClientSizeCore
setStyle
setVisibleCore
show
size
supportsMouseTracking
suspendLayout
systemColorsChanged
tabStop
tag
text
textChanged
top
topLevelControl
toString
update
updateStyles
visible
visibleChanged
width
wndProc
zIndex
}
{
public void add(Control ctrl);
public int length;
[property getter]
public int opApply(int delegate(ref Control) dg);
public int opIndex;
[property getter]
protected final Control owner;
[property getter]
public void remove(Control ctrl);
}
{
public final TreeViewAction action;
[property getter]
public final TreeNode node;
[property getter]
Inherited members
cancel
empty
}
{
public final TreeViewAction action;
[property getter]
public final TreeNode node;
[property getter]
Inherited members
empty
}