PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

This content has been translated automatically. Click here to view the French version.
  • 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
The property AddsDifferenceStrings indicates the Procedure to call when clicking on the row of an TreeView control or an TreeView Table control. This procedure is used to fill the expanded branches only.
Therefore, the procedure for filling the control can be optimized.
Remark: 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
PROCEDURE 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 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 corresponds to an empty string (""), no procedure will be associated with the element.
Remarks

Operating mode

If the property AddChildDelayed corresponds to the name of an 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 executed (the branch has been filled), the Property AddChildDelayed is assigned with a string Void: it will not be run anymore.

Special cases

  • The specified procedure will be run BEFORE the "Collapsing, expanding a node" event of the control.
  • When calling the TableExpand or TreeExpand function, if the specified branch has an Procedure associated by the AddChildDelayedproperty, this Procedure will be executed..
  • Versions 20 and later
    When calling the TableExpandAll or TreeExpandAll function, if the specified branch and/or its wires have an Procedure associated by the AddChildDelayedproperty, this Procedure will be executed..
    New in version 20
    When calling the TableExpandAll or TreeExpandAll function, if the specified branch and/or its wires have an Procedure associated by the AddChildDelayedproperty, this Procedure will be executed..
    When calling the TableExpandAll or TreeExpandAll function, if the specified branch and/or its wires have an Procedure associated by the AddChildDelayedproperty, this Procedure will be executed..
Minimum version required
  • Version 19
This page is also available for…
Comments
Video AddChildDelayed
https://youtu.be/qlzRiAP8JWM

https://windevdesenvolvimento.blogspot.com/2019/09/dicas-2273-windev-webdev-mobile.html
amarildo
05 Sep. 2019