ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / TreeView functions
  • Interrupting TreeListItem
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Parameters of the procedure used by TreeListItem
Procedure ("Callback") called by TreeListItem for each "child" element found. This procedure can be a local, global or internal procedure.
Example
// List the "children" of the "Desserts" node in the "TREE_TVRecipe" TreeView
// The "ExpandAll" procedure is called
// for each "child" element found in the "Desserts" node
Res is int
Res = TreeListItem(TREE_TVRecipe, "Recipe" + TAB + "Dessert", TreeListItem_ExpandAll)
 
 
//--------------------------------------------------------------------------------------------
// Internal procedure "TreeListItem_ExpandAll"
// This procedure expands all the collapsed "child" nodes of the "Desserts" node
 
INTERNAL PROCEDURE TreeListItem_ExpandAll(TREE_TVRecipe, ChildPath, ChildFound, ...
Level, Pointer)
// Is the element found a leaf?
IF TreeTypeItem(TREE_TVRecipe, ChildPath + ChildFound) = tvLeaf THEN
RETURN // Go back to the TreeListItem function
ELSE
// Is the element found collapsed?
IF TreeStatus(TREE_TVRecipe, ChildPath + ChildFound) = tvCollapse THEN
TreeExpand(TREE_TVRecipe, ChildPath + ChildFound)
END
END
// Collapses the treeview
TreeCollapse(TREE_TVRecipe, "Recipe")
END
Syntax
TreeListItem_Callback(<TreeView control> , <Child path> , <Element> , <Level> , <Optional parameter>)
<TreeView control>: Character string
Name of the TreeView control to be used.
<Child path>: Character string
Full path of the "child" found (without the name) or an empty string ("") if it is the root of TreeView control. This parameter always ends with the "TAB" separator. This parameter will be initialized and filled whenever the procedure is called.
Remark: if the <Duplicate identifier> parameter of TreeListItem is set to True, the names of elements will contain the associated identifier if it exists. For more details, see Managing duplicates in the treeviews.
<Element>: Character string
Name of the element found. This parameter will be initialized and filled whenever the procedure is called.
<Level>: Integer
Level of element found in relation to the initial search element:
1. Direct child
2. Grand child
3. ...
<Optional parameter>: Integer
Value passed in <Custom parameter> of TreeListItem. If <Custom parameter> is not specified, <Optional parameter> corresponds to the NULL constant.
Remarks

Interrupting TreeListItem

TreeListItem cannot be interrupted as long as there are"child" elements to browse through.
To force the interruption of the browse performed by TreeListItem, use the following line in the procedure:
RESULT False
In this case, TreeListItem returns the number of elements browsed until "RESULT False" was called.
Business / UI classification: Neutral code
Component: wd290obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/04/2023

Send a report | Local help