|
|
|
|
|
- Operating mode
- Special cases
AddChildDelayed (Property) In french: AjouteFilsDifféré
The AddChildDelayed property indicates the procedure to be called when a row in a TreeView or TreeView Table control is clicked to be expanded. This procedure populates only the expanded branches. This optimizes the control population procedure. Note To optimize the filling of TreeView and Table control fields, simply check the "Delayed fill of sub-levels (faster)" option in the "Contents" tab of the control description window. sDir is string = fListDirectory("C:", frNotRecursive)
FOR EACH STRING sUnRep OF sDir SEPARATED BY CR
nLigne is int = TableAddLine(TABLEH_Explorer, sUnRep)
sFils is string = fListDirectory(sUnRep, frNotRecursive)
IF sFils <> "" THEN
TABLEH_Explorer[nLigne].AjouteFilsDifféré = AjouteRépertoire
END
END
PROCEDURE AjouteRépertoire(sIDParent is string)
nIndice is int
sRepParent is string = TABLEH_Explorer.COL_SansNom1[sIDParent]
sRepParent = Replace(sRepParent, TAB, fSep())
sListeRep is string = fListDirectory(sRepParent, frNotRecursive)
nIndice = Val(sIDParent) + 1
nIndice2 is int = nIndice
FOR EACH STRING sRep OF sListeRep SEPARATED BY CR
sID is string = Replace(sRep, "\", TAB)
TableAddChild(TABLEH_Explorer, nIndice-1, sRep)
sListeSousRep is string = fListDirectory(sRep, frNotRecursive)
IF sListeSousRep <> "" THEN
TABLEH_Explorer[nIndice2].AjouteFilsDifféré = AjouteRépertoire
END
nIndice2 = nIndice2 + 1
END
Syntax
Modifying the procedure to execute Hide the details
<Element>.AddChildDelayed = <WLanguage procedure>
<Element>: Character string Row of the Table or TreeView Table control to use. <WLanguage procedure>: Procedure name Name of the WLanguage procedure to be executed when the element is clicked. For TreeView controls, the procedure has the following format: PROCEDURE <Procedure name>(<ParentPath> is string) where <ParentPath> corresponds to the full path of the row to expand. For TreeView Table controls, the procedure has the following format: PROCEDURE <Procedure name>(<ParentID> is int) where <ParentID> corresponds to the number of the row to expand. If this parameter is an empty string (""), no procedure will be associated with the element. Remarks Operating mode If the AddChildDelayed property corresponds to the name of a: - a "+" sign is displayed on the row in the control.
- the first time the user tries to expand the row (by clicking the "+" sign for example), the procedure is called, allowing to add child elements. Then, the branch is expanded.
If no child element is added, the "+" sign is deleted from the element.
Once the procedure has been executed (the branch has been filled), the property AddChildDelayed property is assigned with an empty string: it will no longer be executed. Special cases - The specified procedure will be executed BEFORE the "Collapse/expand a node" event of the control.
- When the TableExpand or TreeExpand functions are called, if the specified branch has a procedure associated via the AddChildDelayed property, this procedure will be executed.
- When the TableExpandAll or TreeExpandAll functions are called, if the specified branch and/or one of its children has an associated procedure via the AddChildDelayed property, this procedure will be executed.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|