Time settings widget for SAM toolkit demo application.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | widget_context_settings_time |
Time settings widget context. More... | |
Macros | |
#define | TOTAL_NUM_TIME_LABEL 6 |
Total number of time settings widget labels. More... | |
Enumerations | |
enum | time_command_id { ICON_DUMMY_ID = 0, ICON_SETTINGS_TIME_HOUR_UP_ID, ICON_SETTINGS_TIME_MIN_UP_ID, ICON_SETTINGS_TIME_SEC_UP_ID, ICON_SETTINGS_TIME_HOUR_DOWN_ID, ICON_SETTINGS_TIME_MIN_DOWN_ID, ICON_SETTINGS_TIME_SEC_DOWN_ID, ICON_SETTINGS_TIME_RET_ID, ICON_SETTINGS_TIME_MAX_ID, LABEL_YEAR_ID = 0, LABEL_MONTH_ID, LABEL_DATE_ID } |
Command event IDs for time settings widget. More... | |
enum | time_settings_label_type { LABEL_HOUR_ID = 0, LABEL_MIN_ID, LABEL_SEC_ID } |
Label widget IDs. More... | |
Functions | |
static void | app_widget_launch_settings_time (void) |
Setup time settings widget. More... | |
void | app_widget_settings_time_on (uint8_t on) |
Enable/disable time settings widget. More... | |
static bool | widget_settings_time_setup_command_handler (struct wtk_basic_frame *frame, win_command_t command_data) |
Frame handler for the application. More... | |
Variables | |
static char | demo_func_name [] = "Set Time" |
Function name string. More... | |
static char | str_hour [3] |
String array for hour. More... | |
static char | str_min [3] |
String array for minutes. More... | |
static char | str_sec [3] |
String array for second. More... | |
static struct widget_context_settings_time * | widget_ctx_settings_time |
Statically allocated context pointer. More... | |
static struct gfx_bitmap | win_root_logo_icon |
Root logo bitmap. More... | |
static struct gfx_bitmap | win_settings_time_hour_down_icon |
Hour down icon bitmap. More... | |
static struct gfx_bitmap | win_settings_time_hour_up_icon |
Hour up icon bitmap. More... | |
static struct gfx_bitmap | win_settings_time_min_down_icon |
Mintues down icon bitmap. More... | |
static struct gfx_bitmap | win_settings_time_min_up_icon |
Minutes up icon bitmap. More... | |
static struct gfx_bitmap | win_settings_time_ret_icon |
Return to up layer screen icon bitmap. More... | |
static struct gfx_bitmap | win_settings_time_sec_down_icon |
Second down icon bitmap. More... | |
static struct gfx_bitmap | win_settings_time_sec_up_icon |
Second up icon bitmap. More... | |
#define TOTAL_NUM_TIME_LABEL 6 |
Total number of time settings widget labels.
enum time_command_id |
Command event IDs for time settings widget.
|
static |
Setup time settings widget.
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, gfx_bitmap::color, gfx_bitmap::data, demo_board_name, demo_func_name, widget_context_settings_time::frame, widget_context_settings_time::frame_bg, GFX_BITMAP_SOLID, GFX_COLOR, widget_context_settings_time::icon_group, ICON_SETTINGS_TIME_HOUR_DOWN_ID, ICON_SETTINGS_TIME_HOUR_UP_ID, ICON_SETTINGS_TIME_MIN_DOWN_ID, ICON_SETTINGS_TIME_MIN_UP_ID, ICON_SETTINGS_TIME_RET_ID, ICON_SETTINGS_TIME_SEC_DOWN_ID, ICON_SETTINGS_TIME_SEC_UP_ID, widget_context_settings_time::icons, LABEL_HOUR_ID, LABEL_MIN_ID, LABEL_SEC_ID, widget_context_settings_time::lbl_board_name, widget_context_settings_time::lbl_func_name, widget_context_settings_time::lbl_indication, widget_context_settings_time::logo_frame, membag_alloc(), membag_free(), NULL, win_window::parent, win_area::pos, rtc_get_time(), win_area::size, str_hour, str_min, str_sec, gfx_bitmap::type, widget_settings_time_setup_command_handler(), win_destroy(), win_get_attributes(), win_get_root(), win_show(), wtk_basic_frame_as_child(), wtk_basic_frame_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 app_widget_settings_time_on().
void app_widget_settings_time_on | ( | uint8_t | on | ) |
Enable/disable time settings widget.
on | Turn on/off time settings widget. |
References app_widget_launch_settings_time(), widget_context_settings_time::frame, win_destroy(), and wtk_basic_frame_as_child().
Referenced by widget_settings_frame_command_handler(), and widget_settings_time_setup_command_handler().
|
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 app_widget_settings_on(), app_widget_settings_time_on(), demo_parameters_commit_changes(), g_demo_parameters, demo_param_t::hour, ICON_SETTINGS_TIME_HOUR_DOWN_ID, ICON_SETTINGS_TIME_HOUR_UP_ID, ICON_SETTINGS_TIME_MIN_DOWN_ID, ICON_SETTINGS_TIME_MIN_UP_ID, ICON_SETTINGS_TIME_RET_ID, ICON_SETTINGS_TIME_SEC_DOWN_ID, ICON_SETTINGS_TIME_SEC_UP_ID, widget_context_settings_time::lbl_indication, demo_param_t::minute, rtc_set_time(), demo_param_t::second, str_hour, str_min, str_sec, wtk_basic_frame_get_custom_data(), and wtk_label_change().
Referenced by app_widget_launch_settings_time().
|
static |
Function name string.
Referenced by app_widget_launch_settings_time().
|
static |
String array for hour.
Referenced by app_widget_launch_settings_time(), and widget_settings_time_setup_command_handler().
|
static |
String array for minutes.
Referenced by app_widget_launch_settings_time(), and widget_settings_time_setup_command_handler().
|
static |
String array for second.
Referenced by app_widget_launch_settings_time(), and widget_settings_time_setup_command_handler().
|
static |
Statically allocated context pointer.
|
static |
Root logo bitmap.
|
static |
Hour down icon bitmap.
|
static |
Hour up icon bitmap.
|
static |
Mintues down icon bitmap.
|
static |
Minutes up icon bitmap.
|
static |
Return to up layer screen icon bitmap.
|
static |
Second down icon bitmap.
|
static |
Second up icon bitmap.