| Data Type | Member | Description |
|---|---|---|
| int | reason | Indicates why the callback was invoked. |
| XEvent * | event | Points to the event that triggered the callback. |
| int | row | Indicates the row number of the selected cell. |
| int | column | Indicates the column number of the selected cell. |
| int | alignment | Text alignment constant in the cell. |
| Pixel | background | Cell background color. |
| Pixel | foreground | Cell foreground color. |
| int | font_table_index | Index to the font table. If there is no font table added to EditTable, the index will have no effect. To add font table, see the resource XmNfontTable. |
The reason will be set to one of the following defined constants.
| Defined Constant | Description |
|---|---|
| XintCR_CELL_RESIZE | Indicates that the end user has performed a cell resize operation. |
| XintCR_COLUMN_RESIZE | Indicates that the end user has performed a column resize operation. |
| XintCR_ROW_RESIZE | Indicates that the end user has performed a row resize operation. |
| XintCR_DISPLAY_CELL | The cell is about to be displayed on the screen. Allows the programmer to set the cell attributes before the cell is displayed. |
| Data Type | Member | Description |
|---|---|---|
| int | reason | Indicates why the callback was invoked. |
| XEvent * | event | Points to the event that triggered the callback. |
| int | row | Indicates the row number of the selected cell. |
| int | column | Indicates the column number of the selected cell. |
| Widget | widget | ID of the Widget In a Cell. |
| XintCellWidgetResources * | resources | Points to the resources that may be set automatically on the widget. |
| Boolean | doit | Indicates whether or not the resources defined above will be set on the widget before it is drawn. This value is initialized to the setting of resource XmNcellWidgetSetResources. |
The reason member will be set to one of the following defined constants.
| Defined Constant | Description |
|---|---|
| XintCR_QUERY_CELL_WIDGET | The column width or row height was set to 0 (for auto calculate). Allows the programmer to set the resources on the widget so that proper cell size can be calculated. |
| XintCR_UPDATE_CELL_WIDGET | The widget is about to be drawn on the virtual screen. Allows the programmer to set the resources on this widget before it is drawn. |
Structure XintCellWidgetResources is defined as follows.
typedef struct {
String string;
String font;
Pixel background;
Pixel foreground;
int alignment;
int sensitive;
} XintCellWidgetResources;
Where:
| Member | Description |
|---|---|
| string | Format of the display string for the cell value. |
| font | X window font name for the display string. |
| background | Cell background color. |
| foreground | Cell foreground color. |
| alignment | Motif alignment constant for the cell. |
| sensitive | Cell read-only. |
If the XmNcellWidgetSetResources constraint resource is set to True, primitive widgets, such as labels and buttons, do not require a callback. Their resources will be set correctly.
In other cases, such as inserting toggle buttons or option menus, a callback is required. Inside this callback the application should extract the current cell contents, then set the widget state and graphic resources accordingly. When the state of a widget in a cell is changed (for example, an option menu is changed to a new selection), the application should update the cell contents. A cell is identified by its location. If a widget is used for more than one cell, the cell location can be obtained by using function XintEditTableGetCellPointerPosition.
The doit member will be set to the value of the constraint resource, XmNcellWidgetSetResources, before the callback is called.
| Data Type | Member | Description |
|---|---|---|
| int | reason | Set to XintCR_CHECK_EDIT_MODE. |
| XEvent * | event | Points to the event that triggered the callback. |
| int | column | Indicates the column containing the cell to be edited. |
| int | row | Indicates the row containing the cell to be edited. |
| int | column_edit_mode | Indicates the edit mode of column containing the cell to be edited. |
| Boolean | doit | Indicates whether the cell is editable (used only when the column containing the cell is editable). |
The column_edit_mode member will be set to one of the following:
| Defined Constant | Description |
|---|---|
| XintCOLUMN_EDITABLE | Indicates that the column containing the cell is editable. |
| XintCOLUMN_NON_EDITABLE | Indicates that the column containing the cell is not editable. |
The doit flag is used when column_edit_mode has the value XintCOLUMN_EDITABLE. The associated action routine sets this flag to True before the callback list is invoked. A callback procedure should set this flag to False if the cell (in an editable column) should not be enabled for editing. When column_edit_mode has the value XintCOLUMN_NON_EDITABLE the cell selected for editing always is non-editable.
| Data Type | Member | Description |
|---|---|---|
| int | reason | Indicates why the callback was invoked. |
| XEvent * | event | Points to the event that triggered the callback. |
| int | column | Indicates the column number where the button was pressed. |
| int | row | Indicates the row number where the button was pressed. |
| Data Type | Member | Description |
|---|---|---|
| int | reason | Indicates why the callback was invoked. |
| XEvent * | event | Points to the event that triggered the callback. |
| int | src_column | Source column index (set if a column or cell operation). |
| int | src_row | Source row index (set if a row or cell operation). |
| int | current_column | Destination column index (set if a column or cell operation). |
| int | current_row | Destination row index (set if a row or cell operation). |
| Boolean | doit | Set to False to cancel move, resize or copy operation. |
The reason member will be set to one of the following defined constants:
| Defined Constant | Description |
|---|---|
| XintCR_CELL_MOVE | Indicates that the end user has performed a cell move operation (moving the content of a cell into another). |
| XintCR_CELL_RESIZE | Indicates that the end user has performed a cell resize operation. |
| XintCR_CELL_COPY | Indicates that the end user has performed a cell copy operation. |
| XintCR_COLUMN_FREEZE | Indicates that the end user has performed a column move operation into a frozen column. |
| XintCR_COLUMN_MOVE | Indicates that the end user has performed a column move operation. |
| XintCR_COLMUN_RELEASE | Indicates that the end user has performed a column move operation from a frozen column. |
| XintCR_COLUMN_RESIZE | Indicates that the end user has performed a column resize operation. |
| XintCR_COLUMN_COPY | Indicates that the end user has performed a column copy operation. |
| XintCR_ROW_FREEZE | Indicates that the end user has performed a row move operation into a frozen row. |
| XintCR_ROW_MOVE | Indicates that the end user has performed a row move operation. |
| XintCR_ROW_RELEASE | Indicates that the end user has performed a row move operation from a frozen row. |
| XintCR_ROW_RESIZE | Indicates that the end user has performed a row resize operation. |
| XintCR_ROW_COPY | Indicates that the end user has performed a row copy operation. |
| Data Type | Member | Description |
|---|---|---|
| int | reason | Indicates why the callback was invoked. |
| XEvent * | event | Points to the XEvent that triggered the callback. |
| Object | object | Graphic object being dragged or dropped to. This field is NULL if drag or drop is not from or to a graphic object. |
| int | operation | This field is 0 on a drag. On a drop, it can be set to XintDROP_COPY, XintDROP_MOVE or XintDROP_LINK. You can modify this field on a drop to change the operation. |
| Atom * | atoms | Array of source or destination atoms supported. |
| int | atom_count | Size of array atoms. |
| int | x,y | Location of the pointer where drag started or drop occcured. |
| int | row_start | On drag, starting index of the row that is dragged. On drop, row index where the cursor is located and where the cells will be dropped. You can modify this field on a drag or drop operation. |
| int | row_count | On drag, number of rows being dragged. On drop, this field is not used. You can modify this field on a drag operation. |
| int | column_start | On drag, starting index of the column that is dragged. On drop, column index where the cursor is located and where the cells will be dropped. You can modify this field on a drag or drop operation. |
| int | column_count | On drag, number of columns being dragged. On drop, this field is not used. You can modify this field on a drag operation. |
| Boolean | doit | Set to False to cancel the drag or drop operation. |
| Data Type | Member | Description |
|---|---|---|
| int | reason | Indicates why the callback was invoked. |
| XEvent * | event | Points to the event that triggered the callback. |
| int | row | Indicates the row containing the annotation to be edited. |
| int | column | Indicates the column containing the annotation to be edited. |
| Boolean | if_auto | Indicates whether the annotation selected for editing is editable. |
The reason member will be set to one of the following defined constants:
| Defined Constant | Description |
|---|---|
| XintCR_EDIT_COLUMN_ANNOTATION | Indicates that the end user has selected a column annotation for editing. |
| XintCR_EDIT_ROW_ANNOTATION | Indicates that the end user has selected a row annotation for editing. |
When the if_auto flag is True, it indicates that the annotation selected for editing was generated automatically by the EditTable widget. If the annotation was generated by the EditTable widget, then it cannot be edited by the application or the end user.
| Data Type | Member | Description |
|---|---|---|
| int | reason | Indicates why the callback was invoked. |
| XEvent * | event | Points to the XEvent that triggered the callback. |
| int | row | The row index. If the callback is to format column annotation, the row index will always be 1. |
| int | column | The column index. If the callback is to format row annotation, the column index will always be 1. |
| char * | annotation_string | The annotation string to be displayed in the column/row. EditTable will make a copy of the string. |
The reason member will be set to one of the following defined constants:
| Defined Constant | Description |
|---|---|
| XintCR_GET_COLUMN_ANNOTATION | Indicates that EditTable is about to display the column annotation. |
| XintCR_GET_ROW_ANNOTATION | Indicates that EditTable is about to display the row annotation. |
| Data Type | Member | Description |
|---|---|---|
| int | reason | Indicates why the callback was invoked. |
| XEvent * | event | Pointer to the XEvent that triggered the callback. |
| int | row | The index of the row of the cell to be formatted. |
| int | column | The index of the column of the cell to be formatted. |
| int | column_data_type | The column data type for that cell. |
| XintCellValue | cell_value | A Union containing the cell value. |
| char * | display_string | returns the string to display in that cell. |
| Boolean | to_be_freed | if Set to True, string display_string will be freed by the widget after it has been used. This member is initialized to False, which corresponds to the case where display_string is allocated statically by the application. |
The reason member will be set to one of the following defined constants:
| Defined Constants | Description |
|---|---|
| XintCR_DISPLAY_CELL | Formatting is needed to display the cell content. |
| XintCR_CALCULATE_CELL_WIDTH | Formatting is needed to calculate the width of the cell. |
| XintCR_CALCULATE_CELL_HEIGHT | Formatting is needed to calculate the height of the cell. |
Union XintCellValue is defined as follows
typedef union {
short short_value;
int integer_value;
long long_value;
float float_value;
double double_value;
char *string_value;
XtPointer pointer_value;
} XintCellValue;
| Data Type | Member | Description |
|---|---|---|
| int | reason | Indicates why the callback was invoked. |
| XEvent * | event | Pointer to the XEvent that triggered the callback. |
| int | column_start | Indicates the first column involved in the operation. |
| int | row_start | Indicates the first row involved in the operation. |
| int | column_count | Indicates the number of columns involved in the operation. |
| int | row_count | Indicates the number of rows involved in the operation. |
| Boolean | doit | Indicates whether the associated action should be executed (used only for delete row and for delete column operations). |
The reason member will be set to one of the following defined constants:
| Defined Constant | Description |
|---|---|
| XintCR_DELETE_COLUMN | Indicates that a column will be deleted if the doit flag is set to True. |
| XintCR_INSERT_COLUMN | Indicates that one or more columns will be inserted. |
| XintCR_SELECT_COLUMN | Indicates that one or more columns have been selected. |
| XintCR_DELETE_ROW | Indicates that a row will be deleted if the doit flag is set to True. |
| XintCR_INSERT_ROW | Indicates that one or more rows will be inserted. |
| XintCR_SELECT_ROW | Indicates that one or more rows have been selected. |
| XintCR_SELECT_CELL | Indicates that one or more cells have been selected. |
The doit flag is used for the row delete and column delete operations. The associated action routine sets this flag to True before the callback list is invoked. A callback procedure should set this flag to False if the row or column should not be deleted by the action routine.
| Data Type | Member | Description |
|---|---|---|
| int | reason | Indicates why the callback was invoked. |
| XEvent * | event | Points to the event that triggered the callback. |
| int | row | Indicates the row number of the cell where the cell pointer is currently located. |
| int | column | Indicates the column number of the cell where the cell pointer is currently located. |
| int | next_row | Indicates the row number of the cell that the cell pointer will enter. |
| int | next_column | Indicates the column number of the cell that the cell pointer will enter. |
| int | number_of_columns | Indicates the number of columns in the table. |
| int | number_of_rows | Indicates the number of rows in the table. |
The reason member will be set to one of the following defined constants:
| Defined Constant | Description |
|---|---|
| XintCR_TRAVERSE_CELL_DOWN | Indicates that the cell has been entered from the cell above. |
| XintCR_TRAVERSE_CELL_LEFT | Indicates that the cell has been entered from the cell on the left. |
| XintCR_TRAVERSE_CELL_RIGHT | Indicates that the cell has been entered from the cell on the right. |
| XintCR_TRAVERSE_CELL_UP | Indicates that the cell has been entered from the cell below. |
| XintCR_TRAVERSE_CELL_POINTER | Indicates that the cell has been entered with a pointer selection. |
| XintCR_TRAVERSE_CELL_FOCUS_IN | Indicates that the cell has been entered because the focus was brought back to the table. |
| Data Type | Member | Description |
|---|---|---|
| int | reason | Set to XintCR_VALIDATE_VALUE. |
| XEvent * | event | Points to the event that triggered the callback. |
| int | row | Indicates the row number of the cell whose value needs to be validated. |
| int | column | Indicates the column number of the cell whose value needs to be validated. |
| int | column_data_type | Indicates the data type of the cell whose value needs to be validated. |
| char * | format | A character string containing the (C language) format descriptor for the cell whose value needs to be validated. |
| char * | old_value_string | A character string containing the value of the cell before it was changed. |
| char * | new_value_string | A character string containing the value of the cell after it was changed. |
| Boolean | to_be_freed | Set to True if you want EditTable to free the string specified in new_value_string after it has been used. |
| XintCellValue | cell_value | Pointer to the new cell value. |
| Boolean | doit | Indicates whether the cell's value should be changed to the new value. |
The associated action routine sets the doit flag to True before the callback list is invoked. To cancel the editing and restore the old cell value, simply set the doit flag to False. To overwrite the user entry and specify a new cell value you have two options. The first solution is to replace member new_value_string with your own string. In this case, if you have allocated the new value string dynamically, you may want to set to_be_freed to True so that it is deallocated by the table after it is no longer needed. The second solution is to replace directly member cell_value with the new cell value.