Data Structures | |
struct | widget_context |
Widget application context. More... | |
Macros | |
#define | TOTAL_NUM_ICONS 3 |
Enumerations | |
enum | command_id { DUMMY_ID, ICON_BUTTON_1_ID, ICON_BUTTON_2_ID, ICON_BUTTON_3_ID, BUTTON_PREV_ID, BUTTON_NEXT_ID, BUTTON_SELECT_ID } |
Command event IDs. More... | |
Functions | |
bool | app_widget_launch (void) |
Setup widget demo. More... | |
static bool | widget_frame_command_handler (struct wtk_basic_frame *frame, win_command_t command_data) |
Frame handler for the application. More... | |
Variables | |
static struct widget_context * | widget_ctx |
Statically allocated context pointer. More... | |
#define TOTAL_NUM_ICONS 3 |
Referenced by app_widget_launch(), and widget_frame_command_handler().
enum command_id |
Command event IDs.
bool app_widget_launch | ( | void | ) |
Setup widget demo.
Allocates memory for the application context, and creates all widgets that make up its interface. If memory allocation or widget creation fails, the application exits immediately.
References win_attributes::area, BUTTON_PREV_ID, chip_icon1, chip_icon2, chip_icon3, gfx_bitmap::color, gfx_bitmap::data, widget_context::frame, widget_context::frame_bg, GFX_BITMAP_SOLID, GFX_COLOR_BLACK, GFX_COLOR_WHITE, ICON_BUTTON_1_ID, widget_context::icon_group, widget_context::icons, widget_context::lbl_selected, membag_alloc(), membag_free(), win_window::parent, win_area::pos, win_area::size, TOTAL_NUM_ICONS, gfx_bitmap::type, widget_frame_command_handler(), win_destroy(), win_get_attributes(), win_get_root(), win_inflate_area(), win_show(), wtk_basic_frame_as_child(), wtk_basic_frame_create(), wtk_button_as_child(), wtk_button_create(), wtk_icon_button_as_child(), wtk_icon_button_create(), wtk_icon_button_size_hint(), wtk_icon_group_create(), wtk_label_as_child(), wtk_label_create(), wtk_label_size_hint(), win_point::x, and win_point::y.
Referenced by main().
|
static |
Frame handler for the application.
Handles all command events from the widgets in the application frame.
frame | Pointer to the application frame |
command_data | Command event ID |
References BUTTON_NEXT_ID, BUTTON_PREV_ID, BUTTON_SELECT_ID, win_command_event::data, ICON_BUTTON_1_ID, ICON_BUTTON_2_ID, ICON_BUTTON_3_ID, widget_context::icon_group, widget_context::icons, widget_context::lbl_selected, win_command_event::recipient, win_command_event::sender, TOTAL_NUM_ICONS, win_queue_command_event(), wtk_basic_frame_get_custom_data(), wtk_icon_button_as_child(), wtk_icon_button_get_command(), wtk_icon_button_select(), wtk_icon_group_get_selected(), and wtk_label_change().
Referenced by app_widget_launch().
|
static |
Statically allocated context pointer.