ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / TreeView functions
  • Row number at specified point
  • Details about the elements returned by the treeZone constant
  • Miscellaneous
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns the element of a TreeView control found at a given position.
Example of TreeView control:
Vocabulary linked to a TreeView control
Example
// -- Click on the TREE_TreeView1 control
X, Y are int
X = LoWord(CursorPos())
Y = HiWord(CursorPos())
// Find the number of the row corresponding to the click
RowClick is int
RowClick = TreeInfoXY(TREE_TreeView1, treeLineNumber + treeOriginScreen, X, Y)
// Find the branch name
Branch is string
Branch = TreeInfoXY(TREE_TreeView1, treeBranchName + treeOriginScreen, X, Y)
Trace("You've clicked the branch " + ...
Branch + "(row #" + RowClick + ")")
Syntax
<Result> = TreeInfoXY(<TreeView control> , <Type of information> , <X> , <Y>)
<Result>: Character string, integer or Integer constant
Requested information:
  • Number of the row at specified point, -1 if there is no row.
  • Name of the branch at specified point, empty string ("") if there is no branch.
  • Type of hovered area. This type corresponds to one of the following constants:
    tizButton"+ / -" button next to the caption of the TreeView control element.
    tizCaptionElement caption.
    tizCheckmarkCheckmark of element.
    tizImageImage displayed in front of the element caption.
    tizLeftSpace found on the left of element caption.
    tizOutSpace below the elements of the TreeView control.
    tizRightSpace found on the right of element caption.
<TreeView control>: Control name
Name of the TreeView control to be used.
If this parameter corresponds to an empty string (""), TreeInfoXY manipulates the TreeView control to which the current event belongs.
<Type of information>: Constant or combination of constants
Requested type of information:
treeBranchIDIdentifier of element found at (X, Y).
treeBranchNameName of element found at (X, Y).
treeLineNumberNumber of the row found at (X, Y).
treeOriginScreenIf this option is specified, the origin of specified coordinates corresponds to the screen (and not the TreeView control).
This constant cannot be used on its own.
treeZoneType of hovered area
<X>: Integer
X-coordinate (in pixels) to be analyzed. This coordinate is given in relation to the TreeView control (if the treeOriginScreen constant is not specified).
<Y>: Integer
Y-coordinate (in pixels) to be analyzed. This coordinate is given in relation to the TreeView control (if the treeOriginScreen constant is not specified).
Remarks

Row number at specified point

If the treeLineNumber constant is used, TreeInfoXY returns the number of the row for the specified point. This row number is an "instantaneous" row number, it takes into account all the elements expanded above the row.
This row can be handled by the following syntax:
<TreeView control> [<Number of row to handle>]

Details about the elements returned by the treeZone constant

The following illustration presents the different areas that can be retrieved by the treeZone constant.
Retrieved zones

Miscellaneous

TreeInfoXY can be used with a TreeView control that supports the duplicates. For more details, see Managing duplicates in the TreeView controls.
Component: wd290obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help