DEFINE TREE
Creates a Tree Control
Standard Syntax (xBase Style):
DEFINE TREE <ControlName>
[ OF | PARENT <ParentWindowName> ]
AT <nRow> ,<nCol>
WIDTH <nWidth>
HEIGHT <nHeight>
[ VALUE <nValue> ]
[ FONT <cFontname> SIZE <nFonSize> ]
[ TOOLTIP <cToolTipText> ]
[ ON GOTFOCUS <OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <OnLostFocusProcedure> | <bBlock> ]
[ ON DBLCLICK <OnDblClickProcedure> | <bBlock> ]
[ BREAK ]
[ NODEIMAGES <aImgNode> [ ITEMIMAGES <aImgItem> ]
[ <noBut: NOROOTBUTTON> ]
[ ITEMIDS ]
[ HELPID <nHelpId> ]
...
...
[ NODE <cNodeCaption> ]
[ IMAGES <aImage> ]
[ ID <nItemId> ]
...
[ TREEITEM <cTreeItemCaption>
[ IMAGES <aImage> ]
[ ID <nItemId> ] ]
...
[ END NODE ]
...
...
END TREE
Alternate Syntax:
DEFINE TREE <ControlName>
[ PARENT <ParentWindowName> ]
ROW <nRow>
COL <nCol>
WIDTH <nWidth>
HEIGHT <nHeight>
[ VALUE <nValue> ]
[ FONTNAME <cFontname> ]
[ FONTSIZE <nFonSize> ]
[ TOOLTIP <cToolTipText> ]
[ ON GOTFOCUS <OnGotFocusProcedure> | <bBlock> ]
[ ON CHANGE <OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <OnLostFocusProcedure> | <bBlock> ]
[ ON DBLCLICK <OnDblClickProcedure> | <bBlock> ]
[ BREAK <lValue> ]
[ NODEIMAGES <aImgNode> ]
[ ITEMIMAGES <aImgItem> ]
[ ROOTBUTTON <lValue> ]
[ ITEMIDS <lValue> ]
[ HELPID <nHelpId> ]
...
...
[ NODE <cNodeCaption> ]
[ IMAGES <aImage> ]
[ ID <nItemId> ]
...
[ TREEITEM <cTreeItemCaption>
[ IMAGES <aImage> ]
[ ID <nItemId> ] ]
...
[ END NODE ]
...
...
END TREE
Properties:
- Value
- Enabled
- Visible
- Row
- Col
- Width
- Height
- Item ( nItemIndex | ItemId )
- FontName
- FontSize
- FontBold
- ToolTip
- Name (R)
- Break (D)
- NodeImages (D)
- ItemImages (D)
- HelpId (D)
- Parent (D)
- RootButton (D)
D: Available at control definition only
R: Read-Only
Events:
- OnChange
Methods:
- Show
- Hide
- AddItem ( cItemText , nParentItemIndex | nParentItemId )
- DeleteItem ( nItemIndex | nItemId )
- Expand ( nItemIndex | nItemId )
- Collapse ( nItemIndex | nItemId )
- SetFocus
- Release
When ITEMIDS clause is specified, you can assign a numeric ID (ID clause) to tree items and nodes. That way, all tree properties and methods will work using these id's instead item position.