PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Copying an element onto itself
  • Duplicates
  • Priority order for the sort
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
Copies an element (leaf or node) into a TreeView control. All branches issued from this element are also copied.
Example of TreeView control:
Vocabulary linked to a TreeView control
Example
// Copies the "Pineapple" leaf into the "Starters" node
// in the "TREE_RecipeTV" control
Res = TreeCopyItem(TREE_RecipeTV, ...
"Recipes" + TAB + "Desserts" + TAB + "Fruit salad", ...
"Recipes" + TAB + "Starters", tvFirst)
Syntax
<Result> = TreeCopyItem(<TreeView Control> , <Source Element> , <Destination Element> [, <Sort Mode>])
<Result>: Boolean
  • True if the element was copied,
  • False otherwise.
<TreeView Control>: Control name
Name of TreeView control to use.
<Source Element>: Character string
Path of element (leaf or node) to copy. This element and all the branches issued from this element will be moved. This parameter has the following format:
"<Name of Root>" + TAB + ["<Name of 1st Node>" + TAB + ...
["<Name of 2nd Node>" + TAB + [...]]]"<Leaf Name>"
In case of duplicates on a path element, this path can contain the element identifier (specified at the end of its name by TreeID).
<Destination Element>: Character string
Path of element (leaf or node) corresponding to the new "parent" node of the copied element. This element must exist. This parameter:
  • has the following format:
    "<Name of Root>" + TAB + ["<Name of 1st Node>" + TAB + ..
    ["<Name of 2nd Node>" + TAB + [...]]]"<Leaf Name>"
    In case of duplicates on a path element, this path can contain the element identifier (specified at the end of its name by TreeID).
  • corresponds to the NULL constant if the "parent" node is the root of the TreeView control.
<Sort Mode>: Optional constant (or combination of constants)
Position of the copied element in relation to the "child" elements of the destination node.
tvAcceptDuplicateThe duplicates are accepted (two elements on the same level can have the same name). The copied element is inserted in alphabetical order, among the elements of the same level.
tvLastThe element is copied to the last spot of the level.
tvFirstThe element is copied to the first spot of the level.
tvAlphaSort
(Default value)
The copied element is sorted in alphabetical order, among the elements of the same level.
Remarks

Copying an element onto itself

An element cannot be copied onto itself or onto one of its children. In this case, TreeCopyItem returns False and the element is not copied.

Duplicates

Two cases may occur if the <Destination Element> already contains a child element named like the <Source Element>:
  • If the duplicates are accepted (tvAcceptDuplicate constant), the copy is performed as usual. TreeCopyItem returns True.
  • If the duplicates are not accepted, TreeCopyItem returns False. The element is not copied.
If the<Source Element> contains duplicates associated with the identifier, the duplicates will be copied with the same identifier.

Priority order for the sort

The priority order of parameters for the add mode is as follows:
  • tvFirst
  • tvLast
  • tvAlphaSort
For example, in tvFirst + tvLast + tvAlphaSort, only the tvFirst constant is taken into account and run.
Components
WINDEVReports and Queries wd230obj.dll
WEBDEV - Server code wd230page.dll
Windows Mobile wp230obj.dll
Java wd230java.jar
Linux wd230obj.so
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment