DEFINE TREE
Creates a Tree control
  

Creates a tree control.

SYNTAX

DEFINE TREE <ControlName>
[ID <
nId>]
[ OF, PARENT, DIALOG> <
ParentWindowName> ]
AT <
nRow> ,<nCol>
[ WIDTH<
nWidth> ]
[ HEIGHT<
nHeight> ]
[ VALUE <
nValue> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ BACKCOLOR <
anBackColor> ]
[ FONTCOLOR <
anFontColor> ]
[ LINECOLOR <
anLineColor> ]
[ INDENT <
nIndent> ]
[ ITEMHEIGHT <
nItemHeight>]
[ TOOLTIP <
cToolTipText> ]
[ ON GOTFOCUS <
OnGotFocusProcedure> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnLostFocusProcedure> | <bBlock> ]
[ ON DBLCLICK <
OnDblClickProcedure> | <bBlock> ]
[ ON INIT <
bInit> ]
[ BREAK ]
[ NODEIMAGES <
aImgNode> [ ITEMIMAGES <aImgItem> ] [ NOROOTBUTTON ] ]
[ ITEMIDS ]
[ HELPID <
nHelpId> ]


or in dialog:

REDEFINE TREE <ControlName>
ID <
nId>
[ OF, PARENT, DIALOG> <
ParentWindowName> ]
[ VALUE <
nValue> ]
[ FONT <
cFontName> SIZE <nFonSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ BACKCOLOR <
anBackColor> ]
[ FONTCOLOR <
anFontColor> ]
[ LINECOLOR <
anLineColor> ]
[ INDENT <
nIndent> ]
[ ITEMHEIGHT <
nItemHeight>]
[ TOOLTIP <
cToolTipText> ]
[ ON GOTFOCUS <
OnGotFocusProcedure> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnLostFocusProcedure> | <bBlock> ]
[ ON DBLCLICK <
OnDblClickProcedure> | <bBlock> ]
[ ON INIT <
bInit> ]
[ BREAK ]
[ NODEIMAGES <
aImageNode> [ ITEMIMAGES <aImageItem> ] [ NOROOTBUTTON ] ]
[ ITEMIDS ]
[ HELPID <
nHelpId> ]

      ...
...

[ NODE <cNodeCaption> ] [ IMAGES <aImage> ] [ ID <nItemId> ] [CARGO <Cargo> ]

...
TREEITEM <cTreeItemCaption> [ IMAGES <aImage> ] [ ID <nItemId> ] [CARGO <Cargo> ]


     ...

[ END NODE ]
...
...

END TREE


SPLITBOX VERSION

DEFINE TREE <ControlName>
[ OF | PARENT <
ParentWindowName> ]
[ WIDTH<
nWidth> ]
[ HEIGHT<
nHeight> ]
[ VALUE <
nValue> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ BACKCOLOR <
anBackColor> ]
[ FONTCOLOR <
anFontColor> ]
[ LINECOLOR <
anLineColor> ]
[ INDENT <
nIndent> ]
[ ITEMHEIGHT <
nItemHeight> ] 
[ TOOLTIP <
cToolTipText> ]
[ ON GOTFOCUS <
OnGotFocusProcedure> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnLostFocusProcedure> | <bBlock> ]
[ ON DBLCLICK <
OnDblClickProcedure> | <bBlock> ]
[ ON INIT <
bInit> ]
[ NODEIMAGES <
aImageNode> [ ITEMIMAGES <aImageItem> ] [ NOROOTBUTTON ] ]
[ ITEMIDS ]
[ HELPID <
nHelpId> ]
[ BREAK ]


DESCRIPTION:
nRow, nCol
Position in the area of ??the window in pixels.
nWidth, nHeight
The desired size of the Tree Control in pixels.
nId
The ID identifier this Control in Dialog Window
ControlName
A reference to the Tree Control
ParentWindowName
A reference to the Parent Window.
nHelpID
The help topic identifier for this Control
nValue
 
cFontName
Specifies the Font Name
nFontSize
Specifies the Font Size
anBackColor
Specifies the Background Color
anFontColor
Specifies the Font Color
anLineColor
Specifies the Line Color
nIndent
Specifies the Indentation
nItemHeight
Specifies the Height of the Items
cToolTipText
Specifies the Text for the ToolTip
OnGotFocusProcedure
An action to be performed when control Got Focused
OnChangeProcedure
An action to be performed when control value Changes
OnLostFocusProcedure
An action to be performed when control Got Focused
OnDblClickProcedure
An action to be performed when control is Double Clicked
aImageNode
Specifies the Image to be displayed on Tree Nodes
aImageItem
Specifies the Image to be displayed on Item
cNodeCaption
Specifies the Tree Node caption
aImage
?
nItemID
?
cTreeItemCaption
?
 
 
BREAK
?
NOROOTBUTTON
?
ITEMIDS
?
BREAK
?


PROPERTIES:

·   Value
Set / Gets Tree value.
·   Enabled
Set / Gets enabled state of a Tree control
·   Visible
Set / Gets visible a Tree control.
·   Item ( nItemIndex | ItemId )
Set / Gets item text in a Tree
·   ItemCount (R)
Get item count in a Tree
·   Row
Set / Gets row position of a Tree control.
·   Col
Set / Gets column position of a Tree control.
·   Width
Set / Gets width of a Tree control.
·   Height
Set / Gets height of a Tree control.
·   FontName
Set / Gets Tree control's font name.
·   FontSize
Set / Gets Tree control's font size.
·   FontBold
Set / Gets Tree control's font bold property
·   FontItalic
Set / Gets Tree control's font italic property
Set / Gets Tree control's font underline property
Set / Gets Tree control's font strikeout property
·   FontColor
Set / Gets the foreground color for text within the Tree
·   BackColor
Set / Gets the background color for text within the Tree
·   ToolTip
Set / Gets Tree control's Tooltip text.
·   Cargo
Set / Gets user property 'Cargo' for Tree control
·   Name (R)
Retrieves the name of a Tree control.
·   Parent(D)
Set the name as character identifier of the parent window.
·   HelpId (D)
Set the numeric help topic identifier of the control.
·   LineColor 
Sets the line color for the ident
·   Indent (D)
Sets a value of ident of a Tree control
·   ItemHeight (D)
Sets item height of a Tree control
·   NodeImages (D)
Sets the image displayed for the node
·   ItemImages (D)
Sets the image for the Tree Item
·   Break(D)
Control passes to the statement that follows the terminated statement.

EVENTS

·   OnGotFocus
Action to be performed when getting the focus
·   OnChange
Action to be performed when generic changing of the control
Action to be performed when losing the focus.
·   OnDblClick
Action to be performed when Double Left clicking.

METHODS:

·   Show
Shows a Tree control
·   Hide
Hides a Tree control
·   Redraw
Redraw a Control
·   AddItem( cItemText , nParentItemIndex | nParentItemId  )
Add a new item to a Tree control
·   DeleteItem( nItemIndex | nItemId )
Deletes an item from a Tree control
Deletes all items from a Tree control
·   Expand( nItemIndex | nItemId )
Expand control Tree.
·   Collapse( nItemIndex | nItemId )
Collapse control Tree
·   SetFocus
Gives the focus to a Tree control
·   Release
Releases a Tree control from memory
Update enables for Tree control
Update disables for Tree control
·   SaveAs
Save a Tree control as BitMap file.

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.

EXAMPLE:

See demo in :
\Samples\Basic\Tree
      \Samples\Basic\Dialog
      \Samples\Basic\ImageTree_1
      \Samples\Basic\ImageTree_3
      \Samples\Basic\LVUpdate