mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-15 10:58:54 +00:00
655 lines
48 KiB
C
655 lines
48 KiB
C
/*
|
||
* Copyright 2025 NXP
|
||
* NXP Confidential and Proprietary. This software is owned or controlled by NXP and may only be used strictly in
|
||
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
|
||
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
|
||
* comply with and are bound by, such license terms. If you do not agree to be bound by the applicable license
|
||
* terms, then you may not retain, install, activate or otherwise use the software.
|
||
*/
|
||
|
||
#include <stdbool.h>
|
||
#include <stdio.h>
|
||
#include <stdlib.h>
|
||
#include <string.h>
|
||
#include <sys/time.h>
|
||
|
||
#include "lvgl.h"
|
||
#include "gui_guider.h"
|
||
#include "events_init.h"
|
||
#include "widgets_init.h"
|
||
#include "custom.h"
|
||
|
||
|
||
//显示最新的时间和时区
|
||
void setup_scr_datesetpage(lv_ui *ui)
|
||
{
|
||
time_t now;
|
||
struct tm timeinfo;
|
||
|
||
time(&now);
|
||
localtime_r(&now, &timeinfo);
|
||
|
||
LOG_I("timezone utc:%d",tz_get());
|
||
LOG_I("time==%d:%d:%d:%d:%02d:%02d:%02d:%02d:%02d",
|
||
timeinfo.tm_isdst, //是否为夏时制
|
||
timeinfo.tm_yday, //一年过去的天数
|
||
timeinfo.tm_wday, //星期,1对应星期一
|
||
timeinfo.tm_year+1900, //年,距离1900年的差值,默认是70
|
||
timeinfo.tm_mon+1, //日期:月,从0开始 0~11
|
||
timeinfo.tm_mday, //日期:日,从1开始
|
||
timeinfo.tm_hour, //小时
|
||
timeinfo.tm_min, //分钟
|
||
timeinfo.tm_sec); //秒钟
|
||
|
||
|
||
//Write codes datesetpage
|
||
ui->datesetpage = lv_obj_create(NULL);
|
||
lv_obj_set_size(ui->datesetpage, 480, 480);
|
||
lv_obj_set_scrollbar_mode(ui->datesetpage, LV_SCROLLBAR_MODE_OFF);
|
||
|
||
//Write style for datesetpage, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_bg_opa(ui->datesetpage, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(ui->datesetpage, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_grad_dir(ui->datesetpage, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write codes datesetpage_returnbg
|
||
ui->datesetpage_returnbg = lv_img_create(ui->datesetpage);
|
||
lv_obj_add_flag(ui->datesetpage_returnbg, LV_OBJ_FLAG_CLICKABLE);
|
||
lv_img_set_src(ui->datesetpage_returnbg, LVGL_PATH(returnbg.png));
|
||
lv_img_set_pivot(ui->datesetpage_returnbg, 50,50);
|
||
lv_img_set_angle(ui->datesetpage_returnbg, 0);
|
||
lv_obj_set_pos(ui->datesetpage_returnbg, 23, 27);
|
||
lv_obj_set_size(ui->datesetpage_returnbg, 14, 26);
|
||
|
||
//Write style for datesetpage_returnbg, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_img_opa(ui->datesetpage_returnbg, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write codes datesetpage_retrunbtn
|
||
ui->datesetpage_retrunbtn = lv_btn_create(ui->datesetpage);
|
||
ui->datesetpage_retrunbtn_label = lv_label_create(ui->datesetpage_retrunbtn);
|
||
lv_label_set_text(ui->datesetpage_retrunbtn_label, "");
|
||
lv_label_set_long_mode(ui->datesetpage_retrunbtn_label, LV_LABEL_LONG_WRAP);
|
||
lv_obj_align(ui->datesetpage_retrunbtn_label, LV_ALIGN_CENTER, 0, 0);
|
||
lv_obj_set_style_pad_all(ui->datesetpage_retrunbtn, 0, LV_STATE_DEFAULT);
|
||
lv_obj_set_width(ui->datesetpage_retrunbtn_label, LV_PCT(100));
|
||
lv_obj_set_pos(ui->datesetpage_retrunbtn, 7, 10);
|
||
lv_obj_set_size(ui->datesetpage_retrunbtn, 60, 60);
|
||
|
||
//Write style for datesetpage_retrunbtn, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_retrunbtn, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_border_width(ui->datesetpage_retrunbtn, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_radius(ui->datesetpage_retrunbtn, 5, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_retrunbtn, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_color(ui->datesetpage_retrunbtn, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_font(ui->datesetpage_retrunbtn, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_retrunbtn, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_align(ui->datesetpage_retrunbtn, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write codes datesetpage_label_1
|
||
ui->datesetpage_label_1 = lv_label_create(ui->datesetpage);
|
||
//lv_label_set_text(ui->datesetpage_label_1, "Time Zone");
|
||
lv_label_set_text(ui->datesetpage_label_1, Menu_List[GET_nvs_Sys_Info_language()][MENU_LIST_SetClockZone]);
|
||
lv_label_set_long_mode(ui->datesetpage_label_1, LV_LABEL_LONG_WRAP);
|
||
lv_obj_set_pos(ui->datesetpage_label_1, 44, 82);
|
||
lv_obj_set_size(ui->datesetpage_label_1, 180, 20);
|
||
|
||
//Write style for datesetpage_label_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_border_width(ui->datesetpage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_radius(ui->datesetpage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_color(ui->datesetpage_label_1, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_font(ui->datesetpage_label_1, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_label_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_letter_space(ui->datesetpage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_line_space(ui->datesetpage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_align(ui->datesetpage_label_1, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_top(ui->datesetpage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_right(ui->datesetpage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_bottom(ui->datesetpage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_left(ui->datesetpage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_label_1, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write codes datesetpage_zoneddlist
|
||
ui->datesetpage_zoneddlist = lv_dropdown_create(ui->datesetpage);
|
||
lv_dropdown_set_options(ui->datesetpage_zoneddlist, "UTC-12\nUTC-11\nUTC-10\nUTC-09\nUTC-08\nUTC-07\nUTC-06\nUTC-05\nUTC-04\nUTC-03\nUTC-02\nUTC-01\nUTC+00\nUTC+01\nUTC+02\nUTC+03\nUTC+04\nUTC+05\nUTC+06\nUTC+07\nUTC+08\nUTC+09\nUTC+10\nUTC+11\nUTC+12");
|
||
lv_obj_set_pos(ui->datesetpage_zoneddlist, 39, 113);
|
||
lv_obj_set_size(ui->datesetpage_zoneddlist, 403, 35);
|
||
//0--UTC-12 ....12---UTC+0...... 关系:+12
|
||
lv_dropdown_set_selected(ui->datesetpage_zoneddlist,tz_get()+12);//-12~+12----->0~24
|
||
|
||
//Write style for datesetpage_zoneddlist, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_text_color(ui->datesetpage_zoneddlist, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_font(ui->datesetpage_zoneddlist, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_zoneddlist, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_border_width(ui->datesetpage_zoneddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_top(ui->datesetpage_zoneddlist, 8, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_left(ui->datesetpage_zoneddlist, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_right(ui->datesetpage_zoneddlist, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_radius(ui->datesetpage_zoneddlist, 10, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_zoneddlist, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(ui->datesetpage_zoneddlist, lv_color_hex(0x00A8FF), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_grad_dir(ui->datesetpage_zoneddlist, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_zoneddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style state: LV_STATE_CHECKED for &style_datesetpage_zoneddlist_extra_list_selected_checked
|
||
static lv_style_t style_datesetpage_zoneddlist_extra_list_selected_checked;
|
||
ui_init_style(&style_datesetpage_zoneddlist_extra_list_selected_checked);
|
||
|
||
lv_style_set_border_width(&style_datesetpage_zoneddlist_extra_list_selected_checked, 1);
|
||
lv_style_set_border_opa(&style_datesetpage_zoneddlist_extra_list_selected_checked, 255);
|
||
lv_style_set_border_color(&style_datesetpage_zoneddlist_extra_list_selected_checked, lv_color_hex(0xe1e6ee));
|
||
lv_style_set_border_side(&style_datesetpage_zoneddlist_extra_list_selected_checked, LV_BORDER_SIDE_FULL);
|
||
lv_style_set_radius(&style_datesetpage_zoneddlist_extra_list_selected_checked, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_zoneddlist_extra_list_selected_checked, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_zoneddlist_extra_list_selected_checked, lv_color_hex(0x00a1b5));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_zoneddlist_extra_list_selected_checked, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_zoneddlist), &style_datesetpage_zoneddlist_extra_list_selected_checked, LV_PART_SELECTED|LV_STATE_CHECKED);
|
||
|
||
//Write style state: LV_STATE_DEFAULT for &style_datesetpage_zoneddlist_extra_list_main_default
|
||
static lv_style_t style_datesetpage_zoneddlist_extra_list_main_default;
|
||
ui_init_style(&style_datesetpage_zoneddlist_extra_list_main_default);
|
||
|
||
lv_style_set_max_height(&style_datesetpage_zoneddlist_extra_list_main_default, 320);
|
||
lv_style_set_text_color(&style_datesetpage_zoneddlist_extra_list_main_default, lv_color_hex(0x0D3055));
|
||
lv_style_set_text_font(&style_datesetpage_zoneddlist_extra_list_main_default, &lv_font_albbhptR_20);
|
||
lv_style_set_text_opa(&style_datesetpage_zoneddlist_extra_list_main_default, 255);
|
||
lv_style_set_border_width(&style_datesetpage_zoneddlist_extra_list_main_default, 1);
|
||
lv_style_set_border_opa(&style_datesetpage_zoneddlist_extra_list_main_default, 255);
|
||
lv_style_set_border_color(&style_datesetpage_zoneddlist_extra_list_main_default, lv_color_hex(0xe1e6ee));
|
||
lv_style_set_border_side(&style_datesetpage_zoneddlist_extra_list_main_default, LV_BORDER_SIDE_FULL);
|
||
lv_style_set_radius(&style_datesetpage_zoneddlist_extra_list_main_default, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_zoneddlist_extra_list_main_default, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_zoneddlist_extra_list_main_default, lv_color_hex(0xffffff));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_zoneddlist_extra_list_main_default, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_zoneddlist), &style_datesetpage_zoneddlist_extra_list_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style state: LV_STATE_DEFAULT for &style_datesetpage_zoneddlist_extra_list_scrollbar_default
|
||
static lv_style_t style_datesetpage_zoneddlist_extra_list_scrollbar_default;
|
||
ui_init_style(&style_datesetpage_zoneddlist_extra_list_scrollbar_default);
|
||
|
||
lv_style_set_radius(&style_datesetpage_zoneddlist_extra_list_scrollbar_default, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_zoneddlist_extra_list_scrollbar_default, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_zoneddlist_extra_list_scrollbar_default, lv_color_hex(0x00ff00));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_zoneddlist_extra_list_scrollbar_default, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_zoneddlist), &style_datesetpage_zoneddlist_extra_list_scrollbar_default, LV_PART_SCROLLBAR|LV_STATE_DEFAULT);
|
||
|
||
//Write codes datesetpage_label_2
|
||
ui->datesetpage_label_2 = lv_label_create(ui->datesetpage);
|
||
//lv_label_set_text(ui->datesetpage_label_2, "Date");
|
||
lv_label_set_text(ui->datesetpage_label_2, Menu_List[GET_nvs_Sys_Info_language()][MENU_LIST_SetClockDate]);
|
||
|
||
lv_label_set_long_mode(ui->datesetpage_label_2, LV_LABEL_LONG_WRAP);
|
||
lv_obj_set_pos(ui->datesetpage_label_2, 44, 179);
|
||
lv_obj_set_size(ui->datesetpage_label_2, 180, 20);
|
||
|
||
//Write style for datesetpage_label_2, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_border_width(ui->datesetpage_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_radius(ui->datesetpage_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_color(ui->datesetpage_label_2, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_font(ui->datesetpage_label_2, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_label_2, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_letter_space(ui->datesetpage_label_2, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_line_space(ui->datesetpage_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_align(ui->datesetpage_label_2, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_top(ui->datesetpage_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_right(ui->datesetpage_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_bottom(ui->datesetpage_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_left(ui->datesetpage_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_label_2, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write codes datesetpage_yearddlist
|
||
ui->datesetpage_yearddlist = lv_dropdown_create(ui->datesetpage);
|
||
lv_dropdown_set_options(ui->datesetpage_yearddlist, "2024\n2025\n2026\n2027\n2028\n2029\n2030\n2031\n2032\n2033\n2034\n2035\n2036\n2037\n2038\n2039\n2040\n2041\n2042\n2043\n2044\n2045\n2046\n2047\n2048\n2049\n2050\n2051\n2052\n2053\n2054\n2055\n2056\n2057\n2058\n2059\n2060\n2061\n2062\n2063\n2064\n2065\n2066\n2067\n2068\n2069\n2070\n2071\n2072\n2073\n2074\n2075\n2076\n2077\n2078\n2079\n2080\n2081\n2082\n2083\n2084\n2085\n2086\n2087\n2088\n2089\n2090\n2091\n2092\n2093\n2094\n2095\n2096\n2097\n2098\n2099");
|
||
lv_obj_set_pos(ui->datesetpage_yearddlist, 39, 210);
|
||
lv_obj_set_size(ui->datesetpage_yearddlist, 120, 35);
|
||
//(timeinfo.tm_year+1900)-2004
|
||
lv_dropdown_set_selected(ui->datesetpage_yearddlist,(timeinfo.tm_year+1900)-2024);
|
||
|
||
//Write style for datesetpage_yearddlist, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_text_color(ui->datesetpage_yearddlist, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_font(ui->datesetpage_yearddlist, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_yearddlist, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_border_width(ui->datesetpage_yearddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_top(ui->datesetpage_yearddlist, 8, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_left(ui->datesetpage_yearddlist, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_right(ui->datesetpage_yearddlist, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_radius(ui->datesetpage_yearddlist, 10, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_yearddlist, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(ui->datesetpage_yearddlist, lv_color_hex(0x00A8FF), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_grad_dir(ui->datesetpage_yearddlist, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_yearddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style state: LV_STATE_CHECKED for &style_datesetpage_yearddlist_extra_list_selected_checked
|
||
static lv_style_t style_datesetpage_yearddlist_extra_list_selected_checked;
|
||
ui_init_style(&style_datesetpage_yearddlist_extra_list_selected_checked);
|
||
|
||
lv_style_set_border_width(&style_datesetpage_yearddlist_extra_list_selected_checked, 1);
|
||
lv_style_set_border_opa(&style_datesetpage_yearddlist_extra_list_selected_checked, 255);
|
||
lv_style_set_border_color(&style_datesetpage_yearddlist_extra_list_selected_checked, lv_color_hex(0xe1e6ee));
|
||
lv_style_set_border_side(&style_datesetpage_yearddlist_extra_list_selected_checked, LV_BORDER_SIDE_FULL);
|
||
lv_style_set_radius(&style_datesetpage_yearddlist_extra_list_selected_checked, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_yearddlist_extra_list_selected_checked, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_yearddlist_extra_list_selected_checked, lv_color_hex(0x00a1b5));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_yearddlist_extra_list_selected_checked, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_yearddlist), &style_datesetpage_yearddlist_extra_list_selected_checked, LV_PART_SELECTED|LV_STATE_CHECKED);
|
||
|
||
//Write style state: LV_STATE_DEFAULT for &style_datesetpage_yearddlist_extra_list_main_default
|
||
static lv_style_t style_datesetpage_yearddlist_extra_list_main_default;
|
||
ui_init_style(&style_datesetpage_yearddlist_extra_list_main_default);
|
||
|
||
lv_style_set_max_height(&style_datesetpage_yearddlist_extra_list_main_default, 150);
|
||
lv_style_set_text_color(&style_datesetpage_yearddlist_extra_list_main_default, lv_color_hex(0x0D3055));
|
||
lv_style_set_text_font(&style_datesetpage_yearddlist_extra_list_main_default, &lv_font_albbhptR_20);
|
||
lv_style_set_text_opa(&style_datesetpage_yearddlist_extra_list_main_default, 255);
|
||
lv_style_set_border_width(&style_datesetpage_yearddlist_extra_list_main_default, 1);
|
||
lv_style_set_border_opa(&style_datesetpage_yearddlist_extra_list_main_default, 255);
|
||
lv_style_set_border_color(&style_datesetpage_yearddlist_extra_list_main_default, lv_color_hex(0xe1e6ee));
|
||
lv_style_set_border_side(&style_datesetpage_yearddlist_extra_list_main_default, LV_BORDER_SIDE_FULL);
|
||
lv_style_set_radius(&style_datesetpage_yearddlist_extra_list_main_default, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_yearddlist_extra_list_main_default, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_yearddlist_extra_list_main_default, lv_color_hex(0xffffff));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_yearddlist_extra_list_main_default, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_yearddlist), &style_datesetpage_yearddlist_extra_list_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style state: LV_STATE_DEFAULT for &style_datesetpage_yearddlist_extra_list_scrollbar_default
|
||
static lv_style_t style_datesetpage_yearddlist_extra_list_scrollbar_default;
|
||
ui_init_style(&style_datesetpage_yearddlist_extra_list_scrollbar_default);
|
||
|
||
lv_style_set_radius(&style_datesetpage_yearddlist_extra_list_scrollbar_default, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_yearddlist_extra_list_scrollbar_default, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_yearddlist_extra_list_scrollbar_default, lv_color_hex(0x00ff00));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_yearddlist_extra_list_scrollbar_default, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_yearddlist), &style_datesetpage_yearddlist_extra_list_scrollbar_default, LV_PART_SCROLLBAR|LV_STATE_DEFAULT);
|
||
|
||
//Write codes datesetpage_moonddlist
|
||
ui->datesetpage_moonddlist = lv_dropdown_create(ui->datesetpage);
|
||
lv_dropdown_set_options(ui->datesetpage_moonddlist, "01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12");
|
||
lv_obj_set_pos(ui->datesetpage_moonddlist, 200, 210);
|
||
lv_obj_set_size(ui->datesetpage_moonddlist, 80, 35);
|
||
//timeinfo.tm_mon //日期:月,从0开始 0~11 刚好对应
|
||
lv_dropdown_set_selected(ui->datesetpage_moonddlist,timeinfo.tm_mon);
|
||
|
||
//Write style for datesetpage_moonddlist, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_text_color(ui->datesetpage_moonddlist, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_font(ui->datesetpage_moonddlist, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_moonddlist, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_border_width(ui->datesetpage_moonddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_top(ui->datesetpage_moonddlist, 8, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_left(ui->datesetpage_moonddlist, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_right(ui->datesetpage_moonddlist, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_radius(ui->datesetpage_moonddlist, 10, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_moonddlist, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(ui->datesetpage_moonddlist, lv_color_hex(0x00A8FF), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_grad_dir(ui->datesetpage_moonddlist, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_moonddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style state: LV_STATE_CHECKED for &style_datesetpage_moonddlist_extra_list_selected_checked
|
||
static lv_style_t style_datesetpage_moonddlist_extra_list_selected_checked;
|
||
ui_init_style(&style_datesetpage_moonddlist_extra_list_selected_checked);
|
||
|
||
lv_style_set_border_width(&style_datesetpage_moonddlist_extra_list_selected_checked, 1);
|
||
lv_style_set_border_opa(&style_datesetpage_moonddlist_extra_list_selected_checked, 255);
|
||
lv_style_set_border_color(&style_datesetpage_moonddlist_extra_list_selected_checked, lv_color_hex(0xe1e6ee));
|
||
lv_style_set_border_side(&style_datesetpage_moonddlist_extra_list_selected_checked, LV_BORDER_SIDE_FULL);
|
||
lv_style_set_radius(&style_datesetpage_moonddlist_extra_list_selected_checked, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_moonddlist_extra_list_selected_checked, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_moonddlist_extra_list_selected_checked, lv_color_hex(0x00a1b5));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_moonddlist_extra_list_selected_checked, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_moonddlist), &style_datesetpage_moonddlist_extra_list_selected_checked, LV_PART_SELECTED|LV_STATE_CHECKED);
|
||
|
||
//Write style state: LV_STATE_DEFAULT for &style_datesetpage_moonddlist_extra_list_main_default
|
||
static lv_style_t style_datesetpage_moonddlist_extra_list_main_default;
|
||
ui_init_style(&style_datesetpage_moonddlist_extra_list_main_default);
|
||
|
||
lv_style_set_max_height(&style_datesetpage_moonddlist_extra_list_main_default, 150);
|
||
lv_style_set_text_color(&style_datesetpage_moonddlist_extra_list_main_default, lv_color_hex(0x0D3055));
|
||
lv_style_set_text_font(&style_datesetpage_moonddlist_extra_list_main_default, &lv_font_albbhptR_20);
|
||
lv_style_set_text_opa(&style_datesetpage_moonddlist_extra_list_main_default, 255);
|
||
lv_style_set_border_width(&style_datesetpage_moonddlist_extra_list_main_default, 1);
|
||
lv_style_set_border_opa(&style_datesetpage_moonddlist_extra_list_main_default, 255);
|
||
lv_style_set_border_color(&style_datesetpage_moonddlist_extra_list_main_default, lv_color_hex(0xe1e6ee));
|
||
lv_style_set_border_side(&style_datesetpage_moonddlist_extra_list_main_default, LV_BORDER_SIDE_FULL);
|
||
lv_style_set_radius(&style_datesetpage_moonddlist_extra_list_main_default, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_moonddlist_extra_list_main_default, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_moonddlist_extra_list_main_default, lv_color_hex(0xffffff));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_moonddlist_extra_list_main_default, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_moonddlist), &style_datesetpage_moonddlist_extra_list_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style state: LV_STATE_DEFAULT for &style_datesetpage_moonddlist_extra_list_scrollbar_default
|
||
static lv_style_t style_datesetpage_moonddlist_extra_list_scrollbar_default;
|
||
ui_init_style(&style_datesetpage_moonddlist_extra_list_scrollbar_default);
|
||
|
||
lv_style_set_radius(&style_datesetpage_moonddlist_extra_list_scrollbar_default, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_moonddlist_extra_list_scrollbar_default, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_moonddlist_extra_list_scrollbar_default, lv_color_hex(0x00ff00));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_moonddlist_extra_list_scrollbar_default, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_moonddlist), &style_datesetpage_moonddlist_extra_list_scrollbar_default, LV_PART_SCROLLBAR|LV_STATE_DEFAULT);
|
||
|
||
//Write codes datesetpage_sunddlist
|
||
ui->datesetpage_sunddlist = lv_dropdown_create(ui->datesetpage);
|
||
|
||
//统一用31天 保存的时候弹窗警告
|
||
//依据月份定
|
||
// if(
|
||
// ((timeinfo.tm_mon+1)==1)
|
||
// ||((timeinfo.tm_mon+1)==3)
|
||
// ||((timeinfo.tm_mon+1)==5)
|
||
// ||((timeinfo.tm_mon+1)==7)
|
||
// ||((timeinfo.tm_mon+1)==8)
|
||
// ||((timeinfo.tm_mon+1)==10)
|
||
// ||((timeinfo.tm_mon+1)==12)
|
||
// )
|
||
// {
|
||
lv_dropdown_set_options(ui->datesetpage_sunddlist, "01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31");// 1 3 5 7 8 10 12
|
||
// }
|
||
// else if(
|
||
// ((timeinfo.tm_mon+1)==4)
|
||
// ||((timeinfo.tm_mon+1)==6)
|
||
// ||((timeinfo.tm_mon+1)==9)
|
||
// ||((timeinfo.tm_mon+1)==11)
|
||
// )
|
||
// {
|
||
// lv_dropdown_set_options(ui->datesetpage_sunddlist, "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30");//4 6 9 11
|
||
// }
|
||
// else//2月
|
||
// {
|
||
// lv_dropdown_set_options(ui->datesetpage_sunddlist, "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28");//2
|
||
// }
|
||
|
||
lv_obj_set_pos(ui->datesetpage_sunddlist, 310, 210);
|
||
lv_obj_set_size(ui->datesetpage_sunddlist, 80, 35);
|
||
|
||
LOG_I("tm_mday:%d",timeinfo.tm_mday-1);
|
||
//timeinfo.tm_mday//日期:日,从1开始 ;所以-1转换
|
||
lv_dropdown_set_selected(ui->datesetpage_sunddlist,timeinfo.tm_mday-1);
|
||
|
||
//Write style for datesetpage_sunddlist, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_text_color(ui->datesetpage_sunddlist, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_font(ui->datesetpage_sunddlist, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_sunddlist, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_border_width(ui->datesetpage_sunddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_top(ui->datesetpage_sunddlist, 8, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_left(ui->datesetpage_sunddlist, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_right(ui->datesetpage_sunddlist, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_radius(ui->datesetpage_sunddlist, 10, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_sunddlist, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(ui->datesetpage_sunddlist, lv_color_hex(0x00A8FF), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_grad_dir(ui->datesetpage_sunddlist, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_sunddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style state: LV_STATE_CHECKED for &style_datesetpage_sunddlist_extra_list_selected_checked
|
||
static lv_style_t style_datesetpage_sunddlist_extra_list_selected_checked;
|
||
ui_init_style(&style_datesetpage_sunddlist_extra_list_selected_checked);
|
||
|
||
lv_style_set_border_width(&style_datesetpage_sunddlist_extra_list_selected_checked, 1);
|
||
lv_style_set_border_opa(&style_datesetpage_sunddlist_extra_list_selected_checked, 255);
|
||
lv_style_set_border_color(&style_datesetpage_sunddlist_extra_list_selected_checked, lv_color_hex(0xe1e6ee));
|
||
lv_style_set_border_side(&style_datesetpage_sunddlist_extra_list_selected_checked, LV_BORDER_SIDE_FULL);
|
||
lv_style_set_radius(&style_datesetpage_sunddlist_extra_list_selected_checked, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_sunddlist_extra_list_selected_checked, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_sunddlist_extra_list_selected_checked, lv_color_hex(0x00a1b5));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_sunddlist_extra_list_selected_checked, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_sunddlist), &style_datesetpage_sunddlist_extra_list_selected_checked, LV_PART_SELECTED|LV_STATE_CHECKED);
|
||
|
||
//Write style state: LV_STATE_DEFAULT for &style_datesetpage_sunddlist_extra_list_main_default
|
||
static lv_style_t style_datesetpage_sunddlist_extra_list_main_default;
|
||
ui_init_style(&style_datesetpage_sunddlist_extra_list_main_default);
|
||
|
||
lv_style_set_max_height(&style_datesetpage_sunddlist_extra_list_main_default, 150);
|
||
lv_style_set_text_color(&style_datesetpage_sunddlist_extra_list_main_default, lv_color_hex(0x0D3055));
|
||
lv_style_set_text_font(&style_datesetpage_sunddlist_extra_list_main_default, &lv_font_albbhptR_20);
|
||
lv_style_set_text_opa(&style_datesetpage_sunddlist_extra_list_main_default, 255);
|
||
lv_style_set_border_width(&style_datesetpage_sunddlist_extra_list_main_default, 1);
|
||
lv_style_set_border_opa(&style_datesetpage_sunddlist_extra_list_main_default, 255);
|
||
lv_style_set_border_color(&style_datesetpage_sunddlist_extra_list_main_default, lv_color_hex(0xe1e6ee));
|
||
lv_style_set_border_side(&style_datesetpage_sunddlist_extra_list_main_default, LV_BORDER_SIDE_FULL);
|
||
lv_style_set_radius(&style_datesetpage_sunddlist_extra_list_main_default, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_sunddlist_extra_list_main_default, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_sunddlist_extra_list_main_default, lv_color_hex(0xffffff));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_sunddlist_extra_list_main_default, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_sunddlist), &style_datesetpage_sunddlist_extra_list_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style state: LV_STATE_DEFAULT for &style_datesetpage_sunddlist_extra_list_scrollbar_default
|
||
static lv_style_t style_datesetpage_sunddlist_extra_list_scrollbar_default;
|
||
ui_init_style(&style_datesetpage_sunddlist_extra_list_scrollbar_default);
|
||
|
||
lv_style_set_radius(&style_datesetpage_sunddlist_extra_list_scrollbar_default, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_sunddlist_extra_list_scrollbar_default, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_sunddlist_extra_list_scrollbar_default, lv_color_hex(0x00ff00));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_sunddlist_extra_list_scrollbar_default, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_sunddlist), &style_datesetpage_sunddlist_extra_list_scrollbar_default, LV_PART_SCROLLBAR|LV_STATE_DEFAULT);
|
||
|
||
//Write codes datesetpage_label_3
|
||
ui->datesetpage_label_3 = lv_label_create(ui->datesetpage);
|
||
//lv_label_set_text(ui->datesetpage_label_3, "Time ");
|
||
lv_label_set_text(ui->datesetpage_label_3, Menu_List[GET_nvs_Sys_Info_language()][MENU_LIST_SetClockTime]);
|
||
|
||
lv_label_set_long_mode(ui->datesetpage_label_3, LV_LABEL_LONG_WRAP);
|
||
lv_obj_set_pos(ui->datesetpage_label_3, 44, 280);
|
||
lv_obj_set_size(ui->datesetpage_label_3, 180, 20);
|
||
|
||
//Write style for datesetpage_label_3, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_border_width(ui->datesetpage_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_radius(ui->datesetpage_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_color(ui->datesetpage_label_3, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_font(ui->datesetpage_label_3, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_label_3, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_letter_space(ui->datesetpage_label_3, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_line_space(ui->datesetpage_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_align(ui->datesetpage_label_3, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_top(ui->datesetpage_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_right(ui->datesetpage_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_bottom(ui->datesetpage_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_left(ui->datesetpage_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_label_3, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write codes datesetpage_hourddlist
|
||
ui->datesetpage_hourddlist = lv_dropdown_create(ui->datesetpage);
|
||
lv_dropdown_set_options(ui->datesetpage_hourddlist, "00\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23");
|
||
lv_obj_set_pos(ui->datesetpage_hourddlist, 39, 310);
|
||
lv_obj_set_size(ui->datesetpage_hourddlist, 120, 35);
|
||
//timeinfo.tm_hour 0~23
|
||
lv_dropdown_set_selected(ui->datesetpage_hourddlist,timeinfo.tm_hour);
|
||
|
||
//Write style for datesetpage_hourddlist, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_text_color(ui->datesetpage_hourddlist, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_font(ui->datesetpage_hourddlist, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_hourddlist, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_border_width(ui->datesetpage_hourddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_top(ui->datesetpage_hourddlist, 8, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_left(ui->datesetpage_hourddlist, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_right(ui->datesetpage_hourddlist, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_radius(ui->datesetpage_hourddlist, 10, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_hourddlist, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(ui->datesetpage_hourddlist, lv_color_hex(0x00A8FF), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_grad_dir(ui->datesetpage_hourddlist, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_hourddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style state: LV_STATE_CHECKED for &style_datesetpage_hourddlist_extra_list_selected_checked
|
||
static lv_style_t style_datesetpage_hourddlist_extra_list_selected_checked;
|
||
ui_init_style(&style_datesetpage_hourddlist_extra_list_selected_checked);
|
||
|
||
lv_style_set_border_width(&style_datesetpage_hourddlist_extra_list_selected_checked, 1);
|
||
lv_style_set_border_opa(&style_datesetpage_hourddlist_extra_list_selected_checked, 255);
|
||
lv_style_set_border_color(&style_datesetpage_hourddlist_extra_list_selected_checked, lv_color_hex(0xe1e6ee));
|
||
lv_style_set_border_side(&style_datesetpage_hourddlist_extra_list_selected_checked, LV_BORDER_SIDE_FULL);
|
||
lv_style_set_radius(&style_datesetpage_hourddlist_extra_list_selected_checked, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_hourddlist_extra_list_selected_checked, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_hourddlist_extra_list_selected_checked, lv_color_hex(0x00a1b5));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_hourddlist_extra_list_selected_checked, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_hourddlist), &style_datesetpage_hourddlist_extra_list_selected_checked, LV_PART_SELECTED|LV_STATE_CHECKED);
|
||
|
||
//Write style state: LV_STATE_DEFAULT for &style_datesetpage_hourddlist_extra_list_main_default
|
||
static lv_style_t style_datesetpage_hourddlist_extra_list_main_default;
|
||
ui_init_style(&style_datesetpage_hourddlist_extra_list_main_default);
|
||
|
||
lv_style_set_max_height(&style_datesetpage_hourddlist_extra_list_main_default, 120);
|
||
lv_style_set_text_color(&style_datesetpage_hourddlist_extra_list_main_default, lv_color_hex(0x0D3055));
|
||
lv_style_set_text_font(&style_datesetpage_hourddlist_extra_list_main_default, &lv_font_albbhptR_20);
|
||
lv_style_set_text_opa(&style_datesetpage_hourddlist_extra_list_main_default, 255);
|
||
lv_style_set_border_width(&style_datesetpage_hourddlist_extra_list_main_default, 1);
|
||
lv_style_set_border_opa(&style_datesetpage_hourddlist_extra_list_main_default, 255);
|
||
lv_style_set_border_color(&style_datesetpage_hourddlist_extra_list_main_default, lv_color_hex(0xe1e6ee));
|
||
lv_style_set_border_side(&style_datesetpage_hourddlist_extra_list_main_default, LV_BORDER_SIDE_FULL);
|
||
lv_style_set_radius(&style_datesetpage_hourddlist_extra_list_main_default, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_hourddlist_extra_list_main_default, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_hourddlist_extra_list_main_default, lv_color_hex(0xffffff));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_hourddlist_extra_list_main_default, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_hourddlist), &style_datesetpage_hourddlist_extra_list_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style state: LV_STATE_DEFAULT for &style_datesetpage_hourddlist_extra_list_scrollbar_default
|
||
static lv_style_t style_datesetpage_hourddlist_extra_list_scrollbar_default;
|
||
ui_init_style(&style_datesetpage_hourddlist_extra_list_scrollbar_default);
|
||
|
||
lv_style_set_radius(&style_datesetpage_hourddlist_extra_list_scrollbar_default, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_hourddlist_extra_list_scrollbar_default, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_hourddlist_extra_list_scrollbar_default, lv_color_hex(0x00ff00));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_hourddlist_extra_list_scrollbar_default, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_hourddlist), &style_datesetpage_hourddlist_extra_list_scrollbar_default, LV_PART_SCROLLBAR|LV_STATE_DEFAULT);
|
||
|
||
//Write codes datesetpage_minuteddlist
|
||
ui->datesetpage_minuteddlist = lv_dropdown_create(ui->datesetpage);
|
||
lv_dropdown_set_options(ui->datesetpage_minuteddlist, "00\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59");
|
||
lv_obj_set_pos(ui->datesetpage_minuteddlist, 200, 310);
|
||
lv_obj_set_size(ui->datesetpage_minuteddlist, 120, 35);
|
||
//timeinfo.tm_min 0~59
|
||
lv_dropdown_set_selected(ui->datesetpage_minuteddlist,timeinfo.tm_min);
|
||
|
||
//Write style for datesetpage_minuteddlist, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_text_color(ui->datesetpage_minuteddlist, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_font(ui->datesetpage_minuteddlist, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_minuteddlist, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_border_width(ui->datesetpage_minuteddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_top(ui->datesetpage_minuteddlist, 8, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_left(ui->datesetpage_minuteddlist, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_pad_right(ui->datesetpage_minuteddlist, 6, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_radius(ui->datesetpage_minuteddlist, 10, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_minuteddlist, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(ui->datesetpage_minuteddlist, lv_color_hex(0x00A8FF), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_grad_dir(ui->datesetpage_minuteddlist, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_minuteddlist, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style state: LV_STATE_CHECKED for &style_datesetpage_minuteddlist_extra_list_selected_checked
|
||
static lv_style_t style_datesetpage_minuteddlist_extra_list_selected_checked;
|
||
ui_init_style(&style_datesetpage_minuteddlist_extra_list_selected_checked);
|
||
|
||
lv_style_set_border_width(&style_datesetpage_minuteddlist_extra_list_selected_checked, 1);
|
||
lv_style_set_border_opa(&style_datesetpage_minuteddlist_extra_list_selected_checked, 255);
|
||
lv_style_set_border_color(&style_datesetpage_minuteddlist_extra_list_selected_checked, lv_color_hex(0xe1e6ee));
|
||
lv_style_set_border_side(&style_datesetpage_minuteddlist_extra_list_selected_checked, LV_BORDER_SIDE_FULL);
|
||
lv_style_set_radius(&style_datesetpage_minuteddlist_extra_list_selected_checked, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_minuteddlist_extra_list_selected_checked, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_minuteddlist_extra_list_selected_checked, lv_color_hex(0x00a1b5));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_minuteddlist_extra_list_selected_checked, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_minuteddlist), &style_datesetpage_minuteddlist_extra_list_selected_checked, LV_PART_SELECTED|LV_STATE_CHECKED);
|
||
|
||
//Write style state: LV_STATE_DEFAULT for &style_datesetpage_minuteddlist_extra_list_main_default
|
||
static lv_style_t style_datesetpage_minuteddlist_extra_list_main_default;
|
||
ui_init_style(&style_datesetpage_minuteddlist_extra_list_main_default);
|
||
|
||
lv_style_set_max_height(&style_datesetpage_minuteddlist_extra_list_main_default, 120);
|
||
lv_style_set_text_color(&style_datesetpage_minuteddlist_extra_list_main_default, lv_color_hex(0x0D3055));
|
||
lv_style_set_text_font(&style_datesetpage_minuteddlist_extra_list_main_default, &lv_font_albbhptR_20);
|
||
lv_style_set_text_opa(&style_datesetpage_minuteddlist_extra_list_main_default, 255);
|
||
lv_style_set_border_width(&style_datesetpage_minuteddlist_extra_list_main_default, 1);
|
||
lv_style_set_border_opa(&style_datesetpage_minuteddlist_extra_list_main_default, 255);
|
||
lv_style_set_border_color(&style_datesetpage_minuteddlist_extra_list_main_default, lv_color_hex(0xe1e6ee));
|
||
lv_style_set_border_side(&style_datesetpage_minuteddlist_extra_list_main_default, LV_BORDER_SIDE_FULL);
|
||
lv_style_set_radius(&style_datesetpage_minuteddlist_extra_list_main_default, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_minuteddlist_extra_list_main_default, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_minuteddlist_extra_list_main_default, lv_color_hex(0xffffff));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_minuteddlist_extra_list_main_default, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_minuteddlist), &style_datesetpage_minuteddlist_extra_list_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style state: LV_STATE_DEFAULT for &style_datesetpage_minuteddlist_extra_list_scrollbar_default
|
||
static lv_style_t style_datesetpage_minuteddlist_extra_list_scrollbar_default;
|
||
ui_init_style(&style_datesetpage_minuteddlist_extra_list_scrollbar_default);
|
||
|
||
lv_style_set_radius(&style_datesetpage_minuteddlist_extra_list_scrollbar_default, 3);
|
||
lv_style_set_bg_opa(&style_datesetpage_minuteddlist_extra_list_scrollbar_default, 255);
|
||
lv_style_set_bg_color(&style_datesetpage_minuteddlist_extra_list_scrollbar_default, lv_color_hex(0x00ff00));
|
||
lv_style_set_bg_grad_dir(&style_datesetpage_minuteddlist_extra_list_scrollbar_default, LV_GRAD_DIR_NONE);
|
||
lv_obj_add_style(lv_dropdown_get_list(ui->datesetpage_minuteddlist), &style_datesetpage_minuteddlist_extra_list_scrollbar_default, LV_PART_SCROLLBAR|LV_STATE_DEFAULT);
|
||
|
||
//Write codes datesetpage_changebtn
|
||
ui->datesetpage_changebtn = lv_btn_create(ui->datesetpage);
|
||
ui->datesetpage_changebtn_label = lv_label_create(ui->datesetpage_changebtn);
|
||
//lv_label_set_text(ui->datesetpage_changebtn_label, "更改");
|
||
lv_label_set_text(ui->datesetpage_changebtn_label,Menu_List[GET_nvs_Sys_Info_language()][MENU_LIST_SetClockChange]);
|
||
lv_label_set_long_mode(ui->datesetpage_changebtn_label, LV_LABEL_LONG_WRAP);
|
||
lv_obj_align(ui->datesetpage_changebtn_label, LV_ALIGN_CENTER, 0, 0);
|
||
lv_obj_set_style_pad_all(ui->datesetpage_changebtn, 0, LV_STATE_DEFAULT);
|
||
lv_obj_set_width(ui->datesetpage_changebtn_label, LV_PCT(100));
|
||
lv_obj_set_pos(ui->datesetpage_changebtn, 84, 402);
|
||
lv_obj_set_size(ui->datesetpage_changebtn, 119, 48);
|
||
|
||
//Write style for datesetpage_changebtn, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_changebtn, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(ui->datesetpage_changebtn, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_grad_dir(ui->datesetpage_changebtn, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_border_width(ui->datesetpage_changebtn, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_radius(ui->datesetpage_changebtn, 24, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_changebtn, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_color(ui->datesetpage_changebtn, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_font(ui->datesetpage_changebtn, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_changebtn, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_align(ui->datesetpage_changebtn, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style for datesetpage_changebtn, Part: LV_PART_MAIN, State: LV_STATE_PRESSED.
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_changebtn, 255, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_bg_color(ui->datesetpage_changebtn, lv_color_hex(0x1F3051), LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_bg_grad_dir(ui->datesetpage_changebtn, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_border_width(ui->datesetpage_changebtn, 0, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_radius(ui->datesetpage_changebtn, 24, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_changebtn, 0, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_text_color(ui->datesetpage_changebtn, lv_color_hex(0xa8a8a8), LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_text_font(ui->datesetpage_changebtn, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_changebtn, 255, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
|
||
//Write codes datesetpage_cancelbtn
|
||
ui->datesetpage_cancelbtn = lv_btn_create(ui->datesetpage);
|
||
ui->datesetpage_cancelbtn_label = lv_label_create(ui->datesetpage_cancelbtn);
|
||
//lv_label_set_text(ui->datesetpage_cancelbtn_label, "取消");
|
||
lv_label_set_text(ui->datesetpage_cancelbtn_label,Menu_List[GET_nvs_Sys_Info_language()][MENU_LIST_SetClockcancel]);
|
||
lv_label_set_long_mode(ui->datesetpage_cancelbtn_label, LV_LABEL_LONG_WRAP);
|
||
lv_obj_align(ui->datesetpage_cancelbtn_label, LV_ALIGN_CENTER, 0, 0);
|
||
lv_obj_set_style_pad_all(ui->datesetpage_cancelbtn, 0, LV_STATE_DEFAULT);
|
||
lv_obj_set_width(ui->datesetpage_cancelbtn_label, LV_PCT(100));
|
||
lv_obj_set_pos(ui->datesetpage_cancelbtn, 289, 402);
|
||
lv_obj_set_size(ui->datesetpage_cancelbtn, 119, 48);
|
||
|
||
//Write style for datesetpage_cancelbtn, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_cancelbtn, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(ui->datesetpage_cancelbtn, lv_color_hex(0x2195f6), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_grad_dir(ui->datesetpage_cancelbtn, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_border_width(ui->datesetpage_cancelbtn, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_radius(ui->datesetpage_cancelbtn, 24, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_cancelbtn, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_color(ui->datesetpage_cancelbtn, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_font(ui->datesetpage_cancelbtn, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_cancelbtn, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_text_align(ui->datesetpage_cancelbtn, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
|
||
//Write style for datesetpage_cancelbtn, Part: LV_PART_MAIN, State: LV_STATE_PRESSED.
|
||
lv_obj_set_style_bg_opa(ui->datesetpage_cancelbtn, 255, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_bg_color(ui->datesetpage_cancelbtn, lv_color_hex(0x1F3051), LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_bg_grad_dir(ui->datesetpage_cancelbtn, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_border_width(ui->datesetpage_cancelbtn, 0, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_radius(ui->datesetpage_cancelbtn, 24, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_shadow_width(ui->datesetpage_cancelbtn, 0, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_text_color(ui->datesetpage_cancelbtn, lv_color_hex(0xa8a8a8), LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_text_font(ui->datesetpage_cancelbtn, &lv_font_albbhptR_20, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
lv_obj_set_style_text_opa(ui->datesetpage_cancelbtn, 255, LV_PART_MAIN|LV_STATE_PRESSED);
|
||
|
||
//The custom code of datesetpage.
|
||
|
||
|
||
//Update current screen layout.
|
||
lv_obj_update_layout(ui->datesetpage);
|
||
|
||
//Init events for screen.
|
||
events_init_datesetpage(ui);
|
||
}
|