|
|
|
|
|
- Copying an element onto itself
- Duplicates
- Priority order for the sort
<TreeView>.CopyItem (Function) In french: <Arbre>.CopieElément Copies an element (leaf or node) into a TreeView control. All branches issued from this element are also copied. Example of TreeView control:
Res = TREE_TVRecipe.CopyItem(...
"Recipes" + TAB + "Desserts" + TAB + "Fruit salad", ...
"Recipes" + TAB + "Starters", tvFirst)
Syntax
<Result> = <TreeView control>.CopyItem(<Source element> , <Destination element> [, <Sort mode>])
<Result>: Boolean - True if the element was copied,
- False otherwise.
<TreeView control>: Control name Name of the TreeView control to be used. <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:
"<Root name>" + TAB + ["<Name of 1st node>" + TAB + ... ["<Name of 2nd node>" + TAB + [...]]]"<Leaf name>" If there are two elements with the same name in the path, you can add the IDs of the elements (after their names using 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:
"<Root name>" + TAB + ["<Name of 1st node>" + TAB + .. ["<Name of 2nd node>" + TAB + [...]]]"<Leaf name>" If there are two elements with the same name in the path, you can add the IDs of the elements (after their names using 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. | | tvAcceptDuplicate | The 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. | tvAlphaSort (Default value) | The copied element is sorted in alphabetical order, among the elements of the same level. | tvFirst | The element is copied to the first spot of the level. | tvLast | The element is copied to the last spot of the level. |
Remarks Copying an element onto itself An element cannot be copied onto itself or onto one of its children. In this case, <TreeView>.CopyItem returns False and the element is not copied. Duplicates Two cases may occur if the <Destination element> already contains a child with the same name as the <Source element>: - If the duplicates are accepted (tvAcceptDuplicate constant), the copy is performed as usual. <TreeView>.CopyItem returns True.
- If duplicates are not accepted, <TreeView>.CopyItem 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: For example, in tvFirst + tvLast + tvAlphaSort, only the tvFirst constant is taken into account and run.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|