![]() |
GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A tabs widget. More...
Go to the source code of this file.
Enumerations | |
| enum | gp_widget_tabs_event_type { GP_WIDGET_TABS_DEACTIVATED , GP_WIDGET_TABS_ACTIVATED } |
| A gp_widget_event::sub_type for a tabs widget. More... | |
Functions | |
| gp_widget * | gp_widget_tabs_new (unsigned int tabs_cnt, unsigned int active_tab, const char *tab_labels[], int flags) |
| Allocates and initializes a new tabs widget. | |
| unsigned int | gp_widget_tabs_cnt (gp_widget *self) |
| Returns number of tabs. | |
| gp_widget * | gp_widget_tabs_put (gp_widget *self, unsigned int tab, gp_widget *child) |
| Puts a child into a tab. | |
| static gp_widget * | gp_widget_tabs_rem (gp_widget *self, unsigned int tab) |
| Removes child from a tab and returns pointer to it. | |
| gp_widget * | gp_widget_tabs_child_get (gp_widget *self, unsigned int tab) |
| Returns a pointer to a child in a tab. | |
| void | gp_widget_tabs_tab_ins (gp_widget *self, unsigned int tab, const char *label, gp_widget *child) |
| Adds a tab at an offset. | |
| unsigned int | gp_widget_tabs_tab_append (gp_widget *self, const char *label, gp_widget *child) |
| Appends a tab at the end. | |
| static void | gp_widget_tabs_tab_prepend (gp_widget *self, const char *label, gp_widget *child) |
| Appends a tab at the begining. | |
| gp_widget * | gp_widget_tabs_tab_rem (gp_widget *self, unsigned int tab) |
| Remove a tab at position. | |
| int | gp_widget_tabs_tab_rem_by_child (gp_widget *self, gp_widget *child) |
| Remove a tab identified by a child widget. | |
| static int | gp_widget_tabs_tab_del_by_child (gp_widget *self, gp_widget *child) |
| Delete a tab identified by a child widget. | |
| static void | gp_widget_tabs_tab_del (gp_widget *self, unsigned int tab) |
| Delete a tab at position. | |
| unsigned int | gp_widget_tabs_active_get (gp_widget *self) |
| Returns active tab index. | |
| gp_widget * | gp_widget_tabs_active_child_get (gp_widget *self) |
| Returns active tab child widget. | |
| void | gp_widget_tabs_active_set (gp_widget *self, unsigned int tab) |
| Set active tab. | |
| void | gp_widget_tabs_active_set_rel (gp_widget *self, int dir, int wrap_around) |
| Set active tab position relative to the currently active tab. | |
| int | gp_widget_tabs_tab_by_child (gp_widget *self, gp_widget *child) |
| Returns tab idx by child pointer. | |
| const char * | gp_widget_tabs_label_get (gp_widget *self, unsigned int tab) |
| Returns a tab label. | |
| const char * | gp_widget_tabs_active_label_get (gp_widget *self) |
| Returns active tab label. | |
A tabs widget.
| Attribute | Type | Default | Description |
|---|---|---|---|
| labels | array | Array of string labels. | |
| widgets | array | Array of child widgets. | |
| active | uint | 0 | Active tab, index into the labels and widgets array. |
Definition in file gp_widget_tabs.h.
A gp_widget_event::sub_type for a tabs widget.
| Enumerator | |
|---|---|
| GP_WIDGET_TABS_DEACTIVATED | A tab is deactivated. |
| GP_WIDGET_TABS_ACTIVATED | A tab activated. |
Definition at line 27 of file gp_widget_tabs.h.
Returns active tab child widget.
| self | A tabs widget. |
| unsigned int gp_widget_tabs_active_get | ( | gp_widget * | self | ) |
Returns active tab index.
| self | A tabs widget. |
| const char * gp_widget_tabs_active_label_get | ( | gp_widget * | self | ) |
Returns active tab label.
| self | A tabs widget. |
| void gp_widget_tabs_active_set | ( | gp_widget * | self, |
| unsigned int | tab ) |
Set active tab.
| self | A tabs widget. |
| tab | A tab index. |
| void gp_widget_tabs_active_set_rel | ( | gp_widget * | self, |
| int | dir, | ||
| int | wrap_around ) |
Set active tab position relative to the currently active tab.
| self | A tabs widget |
| dir | A direction to go to |
| wrap_around | Continue to beginning if we reach end and the other way around. |
Returns a pointer to a child in a tab.
| self | A tabs widget. |
| tab | Index of tab to put the child into. |
| unsigned int gp_widget_tabs_cnt | ( | gp_widget * | self | ) |
Returns number of tabs.
| self | A tabs widget. |
| const char * gp_widget_tabs_label_get | ( | gp_widget * | self, |
| unsigned int | tab ) |
Returns a tab label.
| self | A tabs widget. |
| tab | A tab index. |
| gp_widget * gp_widget_tabs_new | ( | unsigned int | tabs_cnt, |
| unsigned int | active_tab, | ||
| const char * | tab_labels[], | ||
| int | flags ) |
Allocates and initializes a new tabs widget.
| tabs_cnt | Number of tabs. |
| active_tab | Initially active tab. |
| tab_labels | Array of tab labels. |
| flags | Currently unused, must be 0. |
Puts a child into a tab.
| self | A tabs widget. |
| tab | Index of tab to put the child into. |
| child | A tab child widget. |
Referenced by gp_widget_tabs_rem().
Removes child from a tab and returns pointer to it.
| self | A tabs widget. |
| tab | Tab position. |
Definition at line 76 of file gp_widget_tabs.h.
References gp_widget_tabs_put().
Appends a tab at the end.
| self | A tabs widget. |
| label | Tabs label. |
| child | A tab child, may be NULL. |
Returns tab idx by child pointer.
| self | A tabs widget. |
| child | A tabs child. |
|
inlinestatic |
Delete a tab at position.
Removes a tab and frees the child widget.
| self | A tabs widget. |
| tab | A tab index. |
Definition at line 183 of file gp_widget_tabs.h.
References gp_widget_free(), and gp_widget_tabs_tab_rem().
Delete a tab identified by a child widget.
| self | A tabs widget. |
| child | A tab child widget. |
On successful deletion child is freed as well.
Definition at line 165 of file gp_widget_tabs.h.
References gp_widget_free(), and gp_widget_tabs_tab_rem_by_child().
| void gp_widget_tabs_tab_ins | ( | gp_widget * | self, |
| unsigned int | tab, | ||
| const char * | label, | ||
| gp_widget * | child ) |
Adds a tab at an offset.
| self | A tabs widget. |
| tab | An offset. |
| label | Tabs label. |
| child | A tab child, may be NULL. |
Referenced by gp_widget_tabs_tab_prepend().
|
inlinestatic |
Appends a tab at the begining.
| self | A tabs widget. |
| label | Tabs label. |
| child | A tab child, may be NULL. |
Definition at line 128 of file gp_widget_tabs.h.
References gp_widget_tabs_tab_ins().
Remove a tab at position.
| self | A tabs widget. |
| tab | A tab index. |
Referenced by gp_widget_tabs_tab_del().
Remove a tab identified by a child widget.
| self | A tabs widget. |
| child | A tab child widget. |
Referenced by gp_widget_tabs_tab_del_by_child().