|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The pane selector: rows of tabs, their touch and their look. See ui_tabs.h. More...
#include "ui_tabs.h"#include <string.h>#include "ui_text.h"#include "ui_theme.h"#include "ui_widgets.h"Functions | |
| void | ui_tabs_init (ui_tabs_t *t, const char *const *labels, int count, gfx_rect_t row) |
Tabs whose labels are drawn as given, in every language: row split into count tabs 4px apart, the first selected. | |
| void | ui_tabs_init_text (ui_tabs_t *t, const ui_text_id_t *ids, int count, gfx_rect_t row) |
| Tabs whose labels are looked up at every draw, so they follow the language. | |
| static const char * | ui_tabs_label (const ui_tabs_t *t, int i) |
| bool | ui_tabs_event (ui_tabs_t *t, const touch_event_t *evt) |
| One touch event: a tab is selected on the release, as a tap, of the press that began on it. | |
| void | ui_tabs_cancel (ui_tabs_t *t) |
| Abandon a press in progress. | |
| const gfx_font_t * | ui_tabs_font (const ui_tabs_t *t) |
| The face the tabs' labels are drawn in now. | |
| void | ui_tabs_render (const ui_tabs_t *t, gfx_canvas_t *c) |
| The tabs' labels in the face of ui_tabs_font(), centred in each tab; the selected tab raised in a sunk trough 3px around the row. | |
| void | ui_tabs_render_locked (const ui_tabs_t *t, gfx_canvas_t *c, bool locked) |
The tabs as ui_tabs_render() draws them, or with locked as a control that takes no press: the trough outlined, the selected tab's label dim rather than in the accent, a press under way not drawn. The screen feeds a locked control no event. | |
The pane selector: rows of tabs, their touch and their look. See ui_tabs.h.
SPDX-License-Identifier: MIT
| void ui_tabs_cancel | ( | ui_tabs_t * | t | ) |
Abandon a press in progress.
A screen calls it when told its record of the glass is stale: a latched press owns a track id the controller reuses, so a later contact that began elsewhere and lifts over the tab would otherwise be taken for the missing release and switch the pane.
| t | The tabs; NULL does nothing. |
| bool ui_tabs_event | ( | ui_tabs_t * | t, |
| const touch_event_t * | evt ) |
One touch event: a tab is selected on the release, as a tap, of the press that began on it.
| t | The tabs. |
| evt | The event. |
| const gfx_font_t * ui_tabs_font | ( | const ui_tabs_t * | t | ) |
The face the tabs' labels are drawn in now.
| t | The tabs. |
| void ui_tabs_init | ( | ui_tabs_t * | t, |
| const char *const * | labels, | ||
| int | count, | ||
| gfx_rect_t | row ) |
Tabs whose labels are drawn as given, in every language: row split into count tabs 4px apart, the first selected.
| t | The tabs; NULL does nothing. |
| labels | The labels; NULL does nothing. |
| count | The tabs, at most UI_TABS_MAX. |
| row | The row. |
| void ui_tabs_init_text | ( | ui_tabs_t * | t, |
| const ui_text_id_t * | ids, | ||
| int | count, | ||
| gfx_rect_t | row ) |
Tabs whose labels are looked up at every draw, so they follow the language.
| t | The tabs; NULL does nothing. |
| ids | The labels' texts; NULL does nothing. |
| count | The tabs, at most UI_TABS_MAX. |
| row | The row. |
|
static |
Tab i's label as it is drawn now.
| void ui_tabs_render | ( | const ui_tabs_t * | t, |
| gfx_canvas_t * | c ) |
The tabs' labels in the face of ui_tabs_font(), centred in each tab; the selected tab raised in a sunk trough 3px around the row.
| t | The tabs. |
| c | Canvas. |
| void ui_tabs_render_locked | ( | const ui_tabs_t * | t, |
| gfx_canvas_t * | c, | ||
| bool | locked ) |
The tabs as ui_tabs_render() draws them, or with locked as a control that takes no press: the trough outlined, the selected tab's label dim rather than in the accent, a press under way not drawn. The screen feeds a locked control no event.
| t | The tabs. |
| c | Canvas. |
| locked | Draw them as taking no press. |