ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Table functions
  • Use conditions
  • The different types of column indexes
  • Using MouseXPos and MouseYPos
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns for a given position in a Table or TreeView Table control (coordinates of a control point):
  • the name of the column displayed for the specified position.
  • the index of the row or column for the specified position.
Example
WINDEVAndroid
// Optional click code on the TABLE_TABLE1 control
MyRow is int
MyColumn is string
MyRow = TABLE_TABLE1.InfoXY(tiLineNumber, MouseXPos(), MouseYPos())
MyColumn = TABLE_TABLE1.InfoXY(tiColName, MouseXPos(), MouseYPos())
Trace("You have selected the cell (" + MyColumn+", " + MyRow + ")")
// Indice de la ligne au point (50, 100) du champ Table "TABLE_TableProduit" 
ResInfo = TABLE_TableProduit.InfoXY(tiLineNumber, 50, 100)
Syntax
<Result> = <Table control>.InfoXY(<Type of information> , <X> , <Y>)
<Result>: Character string or integer
  • Requested information.
  • An empty string ("") if there is no column name.
  • -1 if there is no column index or row number, or if the specified position corresponds to an empty row or column.
<Table control>: Control name
Name of the Table or TreeView Table control to be used.
<Type of information>: Constant
Type of information requested:
tiColNameColumn name.
WEBDEV - Browser codeiPhone/iPadMac Catalyst This constant is not available.
tiColNumberColumn creation index.
iPhone/iPadMac Catalyst This constant is not available.
tiLineNumberRow number.
tiOnButtonCollapseExpand"+/-" buttons to expand/collapse a row. In this case, <Result> is set to True (1).
This constant is only available for TreeView Table controls.
WEBDEV - Browser code This constant is not available.
tiOriginScreenThe coordinates to be analyzed are relative to the screen.
Reminder: By default, the coordinates to be analyzed are given in relation to the Table control: the point (0,0) corresponds to line 1, column 1 of the manipulated Table control (with the scrollbars at the origin).
This constant cannot be used on its own.
WEBDEV - Browser code This constant is not available.
<X>: Integer
X-coordinate (in pixels) to be analyzed. This coordinate is given in relation to the control (if the tiOriginScreen constant is not specified).
<Y>: Integer
Y-coordinate (in pixels) to be analyzed. This coordinate is given in relation to the control (if the tiOriginScreen constant is not specified).
Remarks

Use conditions

<Table>.InfoXY can be used on:
  • Table or TreeView Table controls based on a data file.
  • Table or TreeView Table controls populated programmatically.
  • single-selection or multi-selection controls.
  • the function doesn't return any result if the Table control is empty.

The different types of column indexes

There are 2 types of indexes for columns:
  • Visible position index: column index when the window is run.
  • Creation index: column index when the table is created in the window editor.
These indexes change if the user moves the columns.
Additionally, if the horizontal scrollbar is used, <Table>.InfoXY takes this change into account.

Using MouseXPos and MouseYPos

To use MouseXPos and MouseYPos in the X and Y parameters of the function, make sure that a single mouse click will trigger the execution of the code containing this function.
For example, the "Select a row" event of a Table control can be started by a simple click but also by a keyboard selection. Therefore, MouseXPos and MouseYPos should not be used in this event. Use an optional event instead. In this example, use the optional event "Left button down" on aTable control.
Component: wd300obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/18/2024

Send a report | Local help