![]() |
GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A table widget. More...
Go to the source code of this file.
Data Structures | |
| struct | gp_widget_table_cell |
| A table cell content. More... | |
| struct | gp_widget_table_col_desc |
| A table column description. More... | |
| struct | gp_widget_table_col_ops |
| Table operations, defined by the application. More... | |
| struct | gp_widget_table_header |
| A table column header. More... | |
| struct | gp_widget_table_col_size |
| Cached column size and minimal size, used internally by the widget. More... | |
| struct | gp_widget_table_priv |
| A structure to store data for the users of this widget. More... | |
Typedefs | |
| typedef struct gp_widget_table_cell | gp_widget_table_cell |
| A table cell content. | |
| typedef struct gp_widget_table_col_desc | gp_widget_table_col_desc |
| A table column description. | |
| typedef struct gp_widget_table_col_ops | gp_widget_table_col_ops |
| Table operations, defined by the application. | |
| typedef struct gp_widget_table_header | gp_widget_table_header |
| A table column header. | |
| typedef struct gp_widget_table_col_size | gp_widget_table_col_size |
| Cached column size and minimal size, used internally by the widget. | |
| typedef struct gp_widget_table_priv | gp_widget_table_priv |
| A structure to store data for the users of this widget. | |
Enumerations | |
| enum | gp_widget_table_row_op { GP_TABLE_ROW_RESET , GP_TABLE_ROW_ADVANCE , GP_TABLE_ROW_MAX } |
| Table row operation. More... | |
| enum | gp_widget_table_event_type { GP_WIDGET_TABLE_TRIGGER , GP_WIDGET_TABLE_SELECT } |
| A gp_widget_event::sub_type for a table widget. More... | |
Functions | |
| gp_widget * | gp_widget_table_new (unsigned int cols, unsigned int min_rows, const gp_widget_table_col_ops *col_ops, const gp_widget_table_header *header) |
| Creates a new table widget. | |
| void | gp_widget_table_sort_by (gp_widget *self, int desc, unsigned int col) |
| Sorts a table widget by a column. | |
| void | gp_widget_table_refresh (gp_widget *self) |
| Request table widget refres. | |
| void | gp_widget_table_off_set (gp_widget *self, unsigned int off) |
| Sets first row that should be shown by the table. | |
| void | gp_widget_table_sel_set (gp_widget *self, unsigned int row) |
| Sets selected row. | |
| unsigned int | gp_widget_table_sel_get (gp_widget *self) |
| Gets a selected row. | |
| bool | gp_widget_table_sel_has (gp_widget *self) |
| Returns if table has a fow selected. | |
| gp_widget_table_priv * | gp_widget_table_priv_get (gp_widget *self) |
| Returns a pointer to user data. | |
A table widget.
The table content is not stored in the widget, instead there are callbacks that are called to get the cells content when table is being rendered.
| Attribute | Type | Default | Description |
|---|---|---|---|
| col_ops | string | An column ops id. | |
| header | array | Array of table header objects. | |
| min_rows | uint | Minimal number of table rows. |
| Attribute | Type | Default | Description |
|---|---|---|---|
| fill | uint | 0 | Column fill coeficient. |
| id | string | Column id to match againts gp_widget_table_col_desc::id. | |
| label | string | If set it's the the column header label. | |
| min_size | uint | Minimal column width in text letters. | |
| order | string | If column is sortable it can be sorted as asc or desc. | |
| tattr | string | bold | Column header label text attribute see gp_widget_tattr. |
Definition in file gp_widget_table.h.
| typedef struct gp_widget_table_col_desc gp_widget_table_col_desc |
A table column description.
Describes:
| typedef struct gp_widget_table_col_ops gp_widget_table_col_ops |
Table operations, defined by the application.
This defines operations for all possible columns in the table. The table header then chooses which columns to display based on this description.
| typedef struct gp_widget_table_header gp_widget_table_header |
A table column header.
Defines a single widget column that is shown on the screen. The table that is shown in the widget is described by an array of these entries.
A gp_widget_event::sub_type for a table widget.
| Enumerator | |
|---|---|
| GP_WIDGET_TABLE_TRIGGER | Emitted on enter or double click presseed. |
| GP_WIDGET_TABLE_SELECT | Emitted when table entry is selected. |
Definition at line 242 of file gp_widget_table.h.
Table row operation.
Definition at line 47 of file gp_widget_table.h.
| gp_widget * gp_widget_table_new | ( | unsigned int | cols, |
| unsigned int | min_rows, | ||
| const gp_widget_table_col_ops * | col_ops, | ||
| const gp_widget_table_header * | header ) |
Creates a new table widget.
| cols | A number of table columns. |
| min_rows | A minimal number of rows shown in the widget. |
| col_ops | Columns description and callbacks to get retrieve table cells. |
| header | Description on which rows and in which order should be shown in the widget. |
| void gp_widget_table_off_set | ( | gp_widget * | self, |
| unsigned int | off ) |
Sets first row that should be shown by the table.
| self | A table widget. |
| off | A row offset. |
| gp_widget_table_priv * gp_widget_table_priv_get | ( | gp_widget * | self | ) |
Returns a pointer to user data.
| self | A table widget. |
| void gp_widget_table_refresh | ( | gp_widget * | self | ) |
Request table widget refres.
Application calls this when table content has changed and table needs to be rerendered.
| self | A table widget. |
| unsigned int gp_widget_table_sel_get | ( | gp_widget * | self | ) |
Gets a selected row.
Return valid result only if a row is selected, i.e. gp_widget_table_sel_has() returns True.
| self | A table widget. |
| bool gp_widget_table_sel_has | ( | gp_widget * | self | ) |
Returns if table has a fow selected.
| self | A table widget. |
| void gp_widget_table_sel_set | ( | gp_widget * | self, |
| unsigned int | row ) |
Sets selected row.
| self | A table widget. |
| row | A row to be selected. |
| void gp_widget_table_sort_by | ( | gp_widget * | self, |
| int | desc, | ||
| unsigned int | col ) |
Sorts a table widget by a column.
This only works for a sortable columns, if column is not sortable the call is no-op.
| self | A table widget. |
| desc | If non-zero the table is sorted in descending order. |
| col | A column index to sort the table by. |