PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

  • Operating mode
  • Special cases
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
..AddChildDelayed indicates the procedure that must be called during a click for expanding a row found in a TreeView control or in a TreeView Table control. This procedure is used to fill the expanded branches only.
Therefore, the procedure for filling the control can be optimized.
Note: To optimize the filling of browsing TreeView and TreeView Table controls, check "Delayed fill of sub-levels (faster)" in the "Content" tab of the control description window.
Example
sDir is string = fListDirectory("C:", frNotRecursive)
FOR EACH STRING sADir OF sDir SEPARATED BY CR
nLine is int = TableAddLine(TVT_EXPLORER, sADir)
// If this directory has children
sChild is string = fListDirectory(sADir, frNotRecursive)
IF sChild <> "" THEN
// Call to the AddDirectory procedure
// when the user clicks [+]
TVT_EXPLORER[nLine]..AddChildDelayed = AddDirectory
END
END
PROCÉDURE AddDirectory(sParentID is string)
nSubscript is int

sParentDir is string = TVT_EXPLORER.COL_NoName1[sParentID]
sParentDir = Replace(sParentDir, TAB, fSep())
sDirList is string = fListDirectory(sParentDir, frNotRecursive)
nSubscript = Val(sParentID) + 1
nSubscript2 is int = nSubscript
FOR EACH STRING sDir OF sDirList SEPARATED BY CR
sID is string = Replace(sDir, "\", TAB)
TableAddChild(TVT_EXPLORER, nSubscript-1, sDir)
sSubDirList is string = fListDirectory(sDir, frNotRecursive)
IF sSubDirList <> "" THEN
TVT_EXPLORER[nSubscript2]..AddChildDelayed = AddDirectory
END
nSubscript2 = nSubscript2 + 1
END
Syntax

Modifying the procedure to run 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 that will be run during the click on the element.
For the 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 the 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 corresponds to an empty string (""), no procedure will be associated with the element.
Remarks

Operating mode

If ..AddChildDelayed corresponds to the name of a procedure:
  • 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 run (the branch was filled), ..AddChildDelayed is assigned with an empty string: it will not be run anymore.

Special cases

  • The specified procedure will be run BEFORE the "Collapsing, expanding a node" event of the control.
  • During the call to TableExpand or TreeExpand, if the specified branch includes a procedure associated by ..AddChildDelayed, this procedure will be run.
  • Versions 20 and later
    During the call to TableExpandAll or TreeExpandAll, if the specified branch and/or its children include a procedure associated by ..AddChildDelayed, this procedure will be run.
    New in version 20
    During the call to TableExpandAll or TreeExpandAll, if the specified branch and/or its children include a procedure associated by ..AddChildDelayed, this procedure will be run.
    During the call to TableExpandAll or TreeExpandAll, if the specified branch and/or its children include a procedure associated by ..AddChildDelayed, this procedure will be run.
Minimum version required
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment