The Gnome Chemistry Utils
0.14.0
|
Grid widget. More...
#include <gtk/gtk.h>
Go to the source code of this file.
Macros | |
#define | GCR_TYPE_GRID (gcr_grid_get_type ()) |
#define | GCR_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GCR_TYPE_GRID, GcrGrid)) |
#define | GCR_IS_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GCR_TYPE_GRID)) |
Typedefs | |
typedef void(* | GridCb )(unsigned i, void *user_data) |
Functions | |
GtkWidget * | gcr_grid_new (char const *col_title, GType col_type,...) |
int | gcr_grid_get_int (GcrGrid *grid, unsigned row, unsigned column) |
unsigned | gcr_grid_get_uint (GcrGrid *grid, unsigned row, unsigned column) |
double | gcr_grid_get_double (GcrGrid *grid, unsigned row, unsigned column) |
char const * | gcr_grid_get_string (GcrGrid *grid, unsigned row, unsigned column) |
bool | gcr_grid_get_boolean (GcrGrid *grid, unsigned row, unsigned column) |
void | gcr_grid_set_int (GcrGrid *grid, unsigned row, unsigned column, int value) |
void | gcr_grid_set_uint (GcrGrid *grid, unsigned row, unsigned column, unsigned value) |
void | gcr_grid_set_double (GcrGrid *grid, unsigned row, unsigned column, double value) |
void | gcr_grid_set_string (GcrGrid *grid, unsigned row, unsigned column, char const *value) |
void | gcr_grid_set_boolean (GcrGrid *grid, unsigned row, unsigned column, bool value) |
unsigned | gcr_grid_append_row (GcrGrid *grid,...) |
void | gcr_grid_delete_row (GcrGrid *grid, unsigned row) |
void | gcr_grid_delete_selected_rows (GcrGrid *grid) |
void | gcr_grid_delete_all (GcrGrid *grid) |
void | gcr_grid_select_all (GcrGrid *grid) |
void | gcr_grid_customize_column (GcrGrid *grid, unsigned column, unsigned chars, bool editable) |
void | gcr_grid_set_allow_multiple_selection (GcrGrid *grid, bool allow) |
void | gcr_grid_add_row_to_selection (GcrGrid *grid, unsigned row) |
void | gcr_grid_unselect_row (GcrGrid *grid, unsigned row) |
void | gcr_grid_for_each_selected (GcrGrid *grid, GridCb cb, void *user_data) |
Grid widget.
The grid widget used in GCrystal dialogs to display lists of atoms, cleavages, or lines.
Definition in file grid.h.
#define GCR_GRID | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_CAST((obj), GCR_TYPE_GRID, GcrGrid)) |
#define GCR_IS_GRID | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_TYPE((obj), GCR_TYPE_GRID)) |
#define GCR_TYPE_GRID (gcr_grid_get_type ()) |
typedef void(* GridCb)(unsigned i, void *user_data) |
i | a row index. |
user_data | user data. |
Callback for gcr_grid_for_each_selected().
void gcr_grid_add_row_to_selection | ( | GcrGrid * | grid, |
unsigned | row | ||
) |
grid | a GcrGrid. |
row | the row to select. |
Adds the row to the selection if multiple selection is allowed or just select the row and replace the previous selection.
unsigned gcr_grid_append_row | ( | GcrGrid * | grid, |
... | |||
) |
grid | a GcrGrid. |
Adds a new row to the grid. The grid argument must be followed by the values to fill inside the cells.
void gcr_grid_customize_column | ( | GcrGrid * | grid, |
unsigned | column, | ||
unsigned | chars, | ||
bool | editable | ||
) |
grid | a GcrGrid. |
column | the column. |
chars | the maximum number of characters to display. |
editable | whether data in the column can be edited. |
Changes the properties for the column.
void gcr_grid_delete_all | ( | GcrGrid * | grid | ) |
grid | a GcrGrid. |
Deletes all rows from the grid.
void gcr_grid_delete_row | ( | GcrGrid * | grid, |
unsigned | row | ||
) |
grid | a GcrGrid. |
row | the row. |
Deletes a row from the grid.
void gcr_grid_delete_selected_rows | ( | GcrGrid * | grid | ) |
grid | a GcrGrid. |
Deletes all selected rows from the grid.
grid | a GcrGrid. |
cb | callback. |
user_data | user data. |
Executes cb for each selected row.
bool gcr_grid_get_boolean | ( | GcrGrid * | grid, |
unsigned | row, | ||
unsigned | column | ||
) |
grid | a GcrGrid. |
row | the row. |
column | the column. |
Retrieves the boolean value stored in the cell. If the column type is not G_TYPE_BOOLEAN, a critical will be emitted and the function will return false.
double gcr_grid_get_double | ( | GcrGrid * | grid, |
unsigned | row, | ||
unsigned | column | ||
) |
grid | a GcrGrid. |
row | the row. |
column | the column. |
Retrieves the floating point value stored in the cell. If the column type is not G_TYPE_DOUBLE, a critical will be emitted and the function will return NAN.
int gcr_grid_get_int | ( | GcrGrid * | grid, |
unsigned | row, | ||
unsigned | column | ||
) |
grid | a GcrGrid. |
row | the row. |
column | the column. |
Retrieves the integer value stored in the cell. If the column type is not G_TYPE_INT, a critical will be emitted and the function will return 0.
char const* gcr_grid_get_string | ( | GcrGrid * | grid, |
unsigned | row, | ||
unsigned | column | ||
) |
grid | a GcrGrid. |
row | the row. |
column | the column. |
Retrieves the string stored in the cell. If the column type is not G_TYPE_DOUBLE, a critical will be emitted and the function will return NULL.
unsigned gcr_grid_get_uint | ( | GcrGrid * | grid, |
unsigned | row, | ||
unsigned | column | ||
) |
grid | a GcrGrid. |
row | the row. |
column | the column. |
Retrieves the unsigned integer value stored in the cell. If the column type is not G_TYPE_UINT, a critical will be emitted and the function will return 0.
GtkWidget* gcr_grid_new | ( | char const * | col_title, |
GType | col_type, | ||
... | |||
) |
col_title | the first column title. |
col_type | the first column data type. |
Builds a new GcrGrid widget. The arguments must include titles and types for each column in the grid. Supported types are G_TYPE_INT, G_TYPE_UINT, G_TYPE_DOUBLE, G_TYPE_STRING, and G_TYPE_BOOLEAN. Strings can't be edited in this version.
void gcr_grid_set_allow_multiple_selection | ( | GcrGrid * | grid, |
bool | allow | ||
) |
grid | a GcrGrid. |
allow | boolean. |
Sets whether multiple rows selection is allowed for the grid.
void gcr_grid_set_boolean | ( | GcrGrid * | grid, |
unsigned | row, | ||
unsigned | column, | ||
bool | value | ||
) |
grid | a GcrGrid. |
row | the row. |
column | the column. |
value | the new value. |
Sets the boolean value stored in the cell. If the column type is not G_TYPE_BOOLEAN, a critical will be emitted and the cell content will be unchanged.
void gcr_grid_set_double | ( | GcrGrid * | grid, |
unsigned | row, | ||
unsigned | column, | ||
double | value | ||
) |
grid | a GcrGrid. |
row | the row. |
column | the column. |
value | the new value. |
Sets the floating point value stored in the cell. If the column type is not G_TYPE_DOUBLE, a critical will be emitted and the cell content will be unchanged.
void gcr_grid_set_int | ( | GcrGrid * | grid, |
unsigned | row, | ||
unsigned | column, | ||
int | value | ||
) |
grid | a GcrGrid. |
row | the row. |
column | the column. |
value | the new value. |
Sets the integer value stored in the cell. If the column type is not G_TYPE_INT, a critical will be emitted and the cell content will be unchanged.
void gcr_grid_set_string | ( | GcrGrid * | grid, |
unsigned | row, | ||
unsigned | column, | ||
char const * | value | ||
) |
grid | a GcrGrid. |
row | the row. |
column | the column. |
value | the new value. |
Sets the string stored in the cell. If the column type is not G_TYPE_STRING, a critical will be emitted and the cell content will be unchanged.
void gcr_grid_set_uint | ( | GcrGrid * | grid, |
unsigned | row, | ||
unsigned | column, | ||
unsigned | value | ||
) |
grid | a GcrGrid. |
row | the row. |
column | the column. |
value | the new value. |
Sets the unsigned integer value stored in the cell. If the column type is not G_TYPE_UINT, a critical will be emitted and the cell content will be unchanged.