skip to main content
OpenEdge Development: ADM Reference
Visual Objects and Their Methods and Properties : Methods for TreeView objects
 
Methods for TreeView objects
This section describes the methods for TreeView objects.
addNode
Procedure that adds a node to the tree.
Location: treeview.p
Parameters:  
INPUT phBuffer AS HANDLE
Handle to buffer of temp-table tTreeData used to defined the node.
Table 3–3 lists and describes the fields and temp-table includes defined in TVController.
 
Table 3–3: Temp-table includes for TVController fields
Field
Temp-table includes
node_key
Unique key of node.
parent_node_key
Key of either parent node or sibling node (depending on node_insert).
node_label
Label of node that appears in TreeView.
private_data
Information stored for the node in the node's TAG property.
image
Relative path and filename of the image of the node.
selected_image
Relative path and filename of the node when it is selected. If blank, it uses the same image as the image field.
node_insert
Specifies where to insert the node, relative to the parent:
*0 - As first node at same level as the parent_node_key
*1 - As last node at same level as the parent_node_key
*2 - After (next) the parent_node_key
*3 - Before (previous) the parent_node_key
*4 - As child of parent_node_key
node_sort
If TRUE, sort node (This must be specified for all nodes within the same level). Default is FALSE.
node_expanded
If TRUE, expand node upon adding it to TreeView. Default is FALSE.
node_checked
If TRUE, and property 'ShowCheckBoxes' is TRUE, the node appears checked. Default is FALSE.
Note: This procedure is called from populateTree but can be called by itself.
deleteNode
Procedure that removes an individual node from the tree.
Location: treeview.p
Parameters:  
INPUT pckey AS CHARACTER
The unique key that identifies the node.
Notes: None
deleteTree
Procedure that can be called to remove nodes from the Tree.
Location: treeview.p
Parameters:  
INPUT phTable AS HANDLE
The handle of tTreeData temp-table (defined in TVController.i).
Note: This differs from the deleteNode procedure in that the temp-table can specify multiple nodes to delete at one time.
disableObject
TreeView version of disableObject procedure.
Location: treeview.p
Parameters: None
Notes: None
emptyTree
Procedure that clears all nodes on the TreeView.
Location: treeview.p
Parameters: None
Notes: None
enableObject
TreeView version of enableObject procedure.
Location: treeview.p
Parameters: None
Notes: None
isNodeExpanded
Returns TRUE if some node is expanded.
Location: treeview.p
Parameters:  
INPUT pcNodeKey AS CHARACTER
The node in question.
Returns: LOGICAL
Notes: None
loadImage
Returns the index of some image file in the ImageList, first loading it if necessary. If the load fails, the function returns 0 (zero).
Location: treeview.p
Parameters:  
INPUT pcImageFile AS CHARACTER
The file of interest.
Returns: INTEGER PRIVATE
Note: The filename must specify the relative path and filename with the extension. Since the image list does not contain any images, the ImageList property is assigned to the TreeView only once, after an image is added.
populateTree
Procedure that controls the population of the TreeView. Creates the node given in the argument and all its descendents.
Location: treeview.p
Parameters:  
INPUT phTable AS HANDLE
The handle of the temp-table containing the data (defined in tvcontroller.i).
INPUT pcStartNodeKey AS CHARACTER
The highest-level node.
Notes:  
*This routine is called recursively to descend the tree pointed to by phTable.
*The temp-table tTreeData includes the following fields as defined in tvcontroller.i:
*node_key — Unique key of node.
*parent_node_key — Key of either parent node or sibling node (depending on node_insert).
*node_label — Label of node that appears in TreeView.
*private_data — Information stored for the node in the node’s TAG property.
*image — Relative path and filename of the image of the node.
*selected_image — Relative path and filename of the node when it is selected. If blank, no special image is used.
*node_insert — Specifies where to insert the node, relative to the parent node:
0 — As first node at same level as the parent_node_key
1 — As last node at same level as the parent_node_key
2 — After (next) the parent_node_key
3 — Before (previous) the parent_node_key
4 — As child of parent_node_key
*node_sort — TRUE if the node is to be shown sorted within its sibling group. All of this node’s siblings must have this option set for sorting to be complete. Default is FALSE.
*node_expanded — TRUE if the node is to be expanded upon adding it to TreeView. Default is FALSE.
*node_checked — TRUE if the node is to be shown checked. Default is FALSE. (The property ‘ShowCheckBoxes’ must be set TRUE to enable this option).
repositionObject
Procedure used for super override for TreeView object repositioning.
Location: treeview.p
Parameters:  
INPUT pdRow AS DECIMAL
New row.
INPUT pdCol AS DECIMAL
New column.
Notes: None
resizeObject
Procedure that resizes a SmartTreeView object.
Location: treeview.p
Parameters:  
INPUT pdHeight AS DECIMAL
New height.
INPUT pdWidth AS DECIMAL
New width.
Notes: None
selectFirstNode
Procedure that selects the first node in the TreeView.
Location: treeview.p
Parameters: None
Notes: None
selectNode
Switches focus to node passed in by phNodeKey, selects this node, and generates a tvNodeSelected event.
Location: treeview.p
Parameters:  
INPUT pcNodeKey AS CHARACTER
Node to receive focus.
Returns: LOGICAL
Notes: None
showTVError
Procedure that displays the error message passed as the argument.
Location: treeview.p
Parameters:  
INPUT pcMessage AS CHARACTER
The error message to display.
Notes: None
updateTree
Procedue that updates details of nodes that are currently in the tree.
Location: treeview.p
Parameters:  
INPUT phTable AS HANDLE
Handle of tTreeData.
Notes: None