GetTableSelection
int GetTableSelection (int panelHandle, int controlID, Rect *cellRange);
Purpose
Returns the cells in the current cell selection.
Supported Controls
You can use GetTableSelection with table controls.
Parameters
Input | ||
Name | Type | Description |
panelHandle | int | Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel. |
controlID | int | 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 functions such as NewCtrl and DuplicateCtrl. |
Output | ||
Name | Type | Description |
cellRange | Rect | A Rect structure containing the location and size of the current cell selection. The Rect structure is defined as follows: typedef struct { int top; int left; int height; int width; } Rect; The function writes the one-based row and column indices of the first cell in the selection into the top and left fields of the structure, respectively. The function writes the number of columns in the selection into the width field of the structure, and it writes the number of rows in the selection into the height field of the structure. The function returns an empty rect (VAL_EMPTY_RECT) if the cell selection is empty (the default state). Note that the table selection is distinct from the active cell, and whereas there always exists an active cell (i.e. the cell holding the keyboard focus), the selection consists of a rectangular cell range that can be empty. The only relationship between the active cell and the selection is that, if the selection is non-empty, the active cell is always contained within the selection |
Return Value
Name | Type | Description |
status | int | Return value indicating whether the function was successful. A negative number indicates that an error occurred. |
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 5.5 and later
Example
Refer to userint\databinding.cws for an example of using the GetTableSelection function.