The type of data contained in a DataGrid Object can be float, short, integer, long, or double.
float grid[NX*NY];
Object grid_data;
...
for (i=0; i<NX*NY; i++) grid [i] = i
grid_data = (Object) XtVaCreateWidget("Grid",
(WidgetClass)xintDataGridObjectClass,
edit,
XmNgridArray, grid,
XmNxCount, NX,
XmNyCount, NY,
XmNgridOrder, XintX_VECTOR,
XmNdataGroup, data_group, NULL);
| Name | Type | Default | Access | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| XmNcopyData |
| Resource Value | Description |
|---|---|
| XintDATA_TYPE_FLOAT (default) | Data type is float. |
| XintDATA_TYPE_SHORT | Data type is short. |
| XintDATA_TYPE_INTEGER | Data type is integer. |
| XintDATA_TYPE_LONG | Data type is long. |
| XintDATA_TYPE_DOUBLE | Data type is double. |
The following constants describe the grid orientation for the XmNgridOrder resource.
| Resource Value | Description |
|---|---|
| XintX_VECTOR | Grid is ordered in the X direction. |
| XintY_VECTOR (default) | Grid is ordered in the Y direction. |
The actual start/increment values are defined through the data structure XintRange, which takes the following form:
typedef struct {
float start;
float increment;
} XintRange;
where:
| Member | Description |
|---|---|
| start | Starting value. |
| increment | Increment. |
typedef struct {
int reason;
XEvent *event;
Object object;
int x_start;
int y_start;
int x_count;
int y_count;
float minimum;
float maximum;
} XintDataGridUpdateCallbackStruct;
If you have multiple DataGrid or other objects in a group, this callback must be registered separately for each individual data object. If you prefer to control updates at the group level, you should register this callback only once for the DataGroup object and use the XintDataGroupUpdateCallbackStruct discussed earlier in this manual.
Structure XintDataGridUpdateCallbackStruct contains information that indicates why and how the object was modified. This information can help optimize the redrawing and updating of the appropriate views. The following ordered table lists the members of structure XintDataGridUpdateCallbackStruct:
| Data Type | Member | Description |
|---|---|---|
| int | reason | Indicates why callback was invoked (see table below). |
| XEvent * | event | Standard member in Motif callback structure; not used in this context (will alwa ys be NULL). |
| Object | object | ID of the updated object. |
| int | x_start | Starting index of X value updated (starts at 0). |
| int | y_start | Starting index of Y value updated (starts at 0). |
| int | x_count | Total number of X values updated. |
| int | y_count | Total number of Y values being updated. |
| float | minimum | New minimum of updated values. |
| float | maximum | New maximum of updated values. |
Member reason provides information explaining why and how the update occurred. Possible values for member reason are:
| Reason | Description |
|---|---|
| XintCR_DATA_UPDATE XintCR_DATA_BATCH | Entire data grid has been changed, no more information is available. |
| XintCR_DATA_REPLACE | A portion of the grid (as specified by x_start, y_start, x_count and y_count) has been replaced. |
| Function Name | Description |
|---|---|
| XintCreateDataGrid | Creates a new data grid object. |
| XintDataGridGetGridArray | Retrieves any part of a grid. |
| XintDataGridDataReplace | Replaces data in a grid. |
Object XintCreateDataGrid(...)
| Widget | parent | Parent of new data grid object. |
| char * | name | Name of new data grid object. |
| ArgList | arglist | List of resources to be set for this data grid. |
| Cardinal | argcount | Total number of resources being set. |
float *XintDataGridGetGridArray (...)
| Object | object | Object ID of the data grid in which data is being retrieved. |
| int | x_start | Starting X value in the area of the grid to be retrieved. |
| int | y_start | Starting Y value in the area of the grid to be retrieved. |
| int | x_count | Total number of X values to be retrieved. |
| int | y_count | Total number of Y values to be retrieved. |
Boolean XintDataGridDataReplace (...)
| Object | object | Object ID of the data grid in which data is being replaced. |
| XtPointer | array | Array containing the replacement data. The data type for this array should be the same as the type specified by XmNdataType. |
| int | x_start | Starting X value in the area of the grid being replaced. |
| int | y_start | Starting Y value in the area of the grid being replaced. |
| int | x_count | Total number of X values being replaced. |
| int | y_count | Total number of Y values being replaced. |
Boolean XintIsDataGrid (Object object)