int GetTableCellFromPoint (int panelHandle, int controlID, Point panelCoordinates, Point *cell);
Converts panel coordinates into a table control cell.
GetTableCellFromPoint returns a cell containing the indices {0, 0} if the specified coordinates lie outside the cell grid.
Input | ||
Name | Type | Description |
panelHandle | integer | Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel. |
controlID | integer | The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl. |
panelCoordinates | Point | A Point structure specifying the panel coordinates. The Point structure is defined as follows: typedef struct { int x; int y; } Point; The values in the Point structure are in terms of pixel coordinates. The origin (0,0) is the upper left corner of the panel. You can create a Point without having to declare a variable by using the following function: Point MakePoint (int x, int y); ExampleGetTableCellFromPoint (panelHandle, controlID, MakePoint (20, 30), &cell); This function can return a cell that is scrolled out of view. If you want to restrict the specified coordinates to the visible portion of the table, you must use the following code: Output |
Name | Type | Description |
cell | Point (passed by reference) | A Point structure indicating the row and column of the cell corresponding to
the specified value. The Point structure is defined as follows: typedef struct { int x; int y; } Point; The function writes the one-based column index of the corresponding cell into the x field of the structure, and the one-based row index of the corresponding cell into the y field of the structure. If the specified coordinates lie outside the cell grid, the function returns a cell containing the indices {0, 0}. This function can return a cell that is scrolled out of view. If you want to restrict the specified coordinates to the visible portion of the table, you must use the following code: GetCtrlAttribute (panelHandle, controlID, ATTR_GRID_AREA_TOP, &top); |
Name | Type | Description | ||||
status | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
|