Note: This page includes content based on the F1 documentation for Centura development. It may be partially converted to support APF development, but should be regarded to be of uncertain actuality. It is provided as is. Eventually, it should be replaced by documentation available from within Visual Studio.
SalBoolean TreeListNodeSet( SalNumber hItem, SalNumber nNodeType, cMessage msgNodeData, SalBoolean bLeafNode )
The TreeListNodeSet method sets new node type and data for a specified node in the tree list.
Name | Description | SalNumber: hItem | Handle of the node item to alter. | SalNumber nNodeType | Node type to set. | cMessage msgNodeData | Data for the node. The cTreeListBox class does not care what attributes you specify in this parameter - it will simply keep track of them for you so that you can use them later. However the attribute specified as 'display attribute' must always be included. | SalBoolean bLeafNode | Specify TRUE if the node is a leaf node (has no children), FALSE otherwise. |
---|
The return value is TRUE if the node is found and altered, FALSE otherwise.
Note: This method will not perform any validity checks against requested change. E.g. No checks that the new node type is valid at this position.
! In this case the TreeListBox is used to select articles in a list. To create the checked/unchecked effect two different node types are used for the same. By switching between them we create the wanted behavior. On PM_TreeListNodeActivate Call CheckUncheckArticle( lParam, wParam ) . Function: CheckUncheckArticle ! Fetch stored data for node Call TreeListNodeGet( lParam, msgNodeData ) Select Case NodeType Case 1 ! Article not checked Call TreeListNodeSet( lParam, 2, msgNodeData, TRUE ) Break Case 2 ! Article checked Call TreeListNodeSet( lParam, 1, msgNodeData, TRUE ) Break . . Default Return FALSE// Modify existing node with new data. lbSchedule.TreeListNodeGet(hItem, NodeMsg); NodeMsg.SetAttribute("SCHEDULE_NAME", sScheduleName); NodeMsg.SetAttribute("LABEL", ConstructLabel(sScheduleId, sScheduleName, NodeMsg.FindAttribute("INSTALLATION_ID", Const.strNULL))); NodeMsg.SetAttribute("ACTIVE_DB", sActive); lbSchedule.TreeListNodeSet(hItem, nLeafNode, NodeMsg, true);