ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
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
// Liste les "fils" du noeud "Desserts" dans le champ Arbre "ARBRE_RecetteTV"
// La procédure "DérouleTout" est appelée
// pour chaque "fils" trouvé du noeud "Desserts"
Res is int
Res = TreeListItem(ARBRE_RecetteTV, "Recette" + TAB + "Dessert", ArbreListeFils_DérouleTout)

//--------------------------------------------------------------------------------------------
// Procédure Interne "ArbreListeFils_DérouleTout"
// Cette procédure déroule tous les noeuds "fils" enroulés du noeud "Desserts"

INTERNAL PROCEDURE ArbreListeFils_DérouleTout(ARBRE_RecetteTV, CheminFils, FilsTrouvé, Niveau, Pointeur)
	// L'élément trouvé est-il une feuille ?
	IF TreeTypeItem(ARBRE_RecetteTV, CheminFils + FilsTrouvé) = tvLeaf THEN
		RETURN // Retour à la fonction ArbreListeFils
	ELSE
		// L'élément trouvé est-il enroulé ?
		IF TreeStatus(ARBRE_RecetteTV, CheminFils + FilsTrouvé) = tvCollapse THEN
			TreeExpand(ARBRE_RecetteTV, CheminFils + FilsTrouvé)
		END
	END
	// Enroule l'arbre
	TreeCollapse(ARBRE_RecetteTV, "Recette")
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 Management of duplicates in trees.
<Element>: Character string
Name of the element found. This parameter will be initialized and filled whenever the procedure is called.
<Level>: entier
Level of element found in relation to the initial search element:
1. Direct child
2. Grand child
3. ...
<Optional parameter>: entier
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:
RETURN 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: 03/26/2024

Send a report | Local help