Appends a child node to a parent node in a TreeView control.
Takes parentNode (Int), text (String), and parentTreeview (Int).
Returns new node ID (treeviewIDCount).
BGI GUI
Parameters & Returns
Parameters
parentNodeInt
textString
parentTreeviewInt
Returns
Int
Quick Summary
Appends a child node to a parent node in a TreeView control.
Takes parentNode (Int), text (String), and parentTreeview (Int).
Returns new node ID (treeviewIDCount).
Technical Exegesis...
Appends a child node to a parent node in a TreeView control. Searches gizmoMap for parentTreeview ID to get TreeView HWND. Searches treeviewNodes vector for parentNode ID to get parent's HTREEITEM handle. Increments global treeviewIDCount for unique node ID. Creates TVINSERTSTRUCT with hParent=parent's HTREEITEM, hInsertAfter=TVI_LAST (append to end of children), mask=TVIF_TEXT|TVIF_PARAM, pszText=text, lParam=treeviewIDCount. Sends TVM_INSERTITEM message to create child node.
Appends a child node to a parent node in a TreeView control. Searches gizmoMap for parentTreeview ID to get TreeView HWND. Searches treeviewNodes vector for parentNode ID to get parent's HTREEITEM handle. Increments global treeviewIDCount for unique node ID. Creates TVINSERTSTRUCT with hParent=parent's HTREEITEM, hInsertAfter=TVI_LAST (append to end of children), mask=TVIF_TEXT|TVIF_PARAM, pszText=text, lParam=treeviewIDCount. Sends TVM_INSERTITEM message to create child node. Creates CTreeViewNode structure and adds to treeviewNodes vector. Returns new node ID (treeviewIDCount). Returns 0 if TreeView not found or insertion failed.
This function adds a child node to the end of a parent's children list. TVI_LAST means new children append after existing siblings. Parent node can be a root node (from bgiAttachGizmoRootNode) or another child node (enabling nested hierarchies). The returned node ID can be used as parentNode in subsequent calls to create deeper nesting. Node handles stored in treeviewNodes for lookup. Returns 0 if parent node doesn't exist. Use for building tree hierarchies, adding sub-items, or expanding tree structure.