当前位置: 首页 > news >正文

麻涌镇网站建设网站小空间

麻涌镇网站建设,网站小空间,网站开发全栈教程,宁波网站推广公司有哪些LVGL 日历组件 calendar 添加到默认组中 lvgl的 calendar 组件会默认添加到旋钮按键组中#xff0c;需要手动将其删除#xff0c;否则会聚焦到不可见的控件上。 lv_obj_set_style_pad_all(calendar, 8, LV_STATE_DEFAULT); lv_group_remove_obj(calendar);修改时间范围 年…LVGL 日历组件 calendar 添加到默认组中 lvgl的 calendar 组件会默认添加到旋钮按键组中需要手动将其删除否则会聚焦到不可见的控件上。 lv_obj_set_style_pad_all(calendar, 8, LV_STATE_DEFAULT); lv_group_remove_obj(calendar);修改时间范围 年时间范围需要手动修改源码下面就是将年信息修改到2023-2099年 /*** file lv_calendar_obj_dropdown.c**//********************** INCLUDES*********************/ #include lv_calendar_header_dropdown.h #if LV_USE_CALENDAR_HEADER_DROPDOWN#include lv_calendar.h #include ../../../widgets/lv_dropdown.h #include ../../layouts/flex/lv_flex.h/********************** DEFINES*********************//*********************** TYPEDEFS**********************//*********************** STATIC PROTOTYPES**********************/ static void my_constructor(const lv_obj_class_t* class_p, lv_obj_t* obj); static void year_event_cb(lv_event_t* e); static void month_event_cb(lv_event_t* e); static void value_changed_event_cb(lv_event_t* e);/*********************** STATIC VARIABLES**********************/ const lv_obj_class_t lv_calendar_header_dropdown_class {.base_class lv_obj_class,.width_def LV_PCT(100),.height_def LV_SIZE_CONTENT,.constructor_cb my_constructor };static const char* month_list 01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12; static const char* year_list {2023\n2024\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};/*********************** MACROS**********************//*********************** GLOBAL FUNCTIONS**********************/lv_obj_t* lv_calendar_header_dropdown_create(lv_obj_t* parent) {lv_obj_t* obj lv_obj_class_create_obj(lv_calendar_header_dropdown_class, parent);lv_obj_class_init_obj(obj);return obj; }/*********************** STATIC FUNCTIONS**********************/static void my_constructor(const lv_obj_class_t* class_p, lv_obj_t* obj) {LV_TRACE_OBJ_CREATE(begin);LV_UNUSED(class_p);lv_obj_t* calendar lv_obj_get_parent(obj);lv_obj_move_to_index(obj, 0);lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_ROW);lv_obj_t* year_dd lv_dropdown_create(obj);lv_dropdown_set_options(year_dd, year_list);lv_obj_add_event_cb(year_dd, year_event_cb, LV_EVENT_VALUE_CHANGED, calendar);lv_obj_set_flex_grow(year_dd, 1);lv_obj_t* month_dd lv_dropdown_create(obj);lv_dropdown_set_options(month_dd, month_list);lv_obj_add_event_cb(month_dd, month_event_cb, LV_EVENT_VALUE_CHANGED, calendar);lv_obj_set_flex_grow(month_dd, 1);lv_obj_add_event_cb(obj, value_changed_event_cb, LV_EVENT_VALUE_CHANGED, NULL);/*Refresh the drop downs*/lv_event_send(obj, LV_EVENT_VALUE_CHANGED, NULL); }static void month_event_cb(lv_event_t* e) {lv_obj_t* dropdown lv_event_get_target(e);lv_obj_t* calendar lv_event_get_user_data(e);uint16_t sel lv_dropdown_get_selected(dropdown);const lv_calendar_date_t* d;d lv_calendar_get_showed_date(calendar);lv_calendar_date_t newd *d;newd.month sel 1;newd.day 1;lv_calendar_set_showed_date(calendar, newd.year, newd.month);lv_calendar_set_today_date(calendar, newd.year, newd.month, newd.day);/*Refresh the drop downs*/lv_event_send(calendar, LV_EVENT_VALUE_CHANGED, NULL); }static void year_event_cb(lv_event_t* e) {lv_obj_t* dropdown lv_event_get_target(e);lv_obj_t* calendar lv_event_get_user_data(e);uint16_t sel lv_dropdown_get_selected(dropdown);const lv_calendar_date_t* d;d lv_calendar_get_showed_date(calendar);lv_calendar_date_t newd *d;newd.year 2023 sel;newd.day 1;lv_calendar_set_showed_date(calendar, newd.year, newd.month);lv_calendar_set_today_date(calendar, newd.year, newd.month, newd.day);/*Refresh the drop downs*/lv_event_send(calendar, LV_EVENT_VALUE_CHANGED, NULL); }static void value_changed_event_cb(lv_event_t* e) {lv_obj_t* header lv_event_get_target(e);lv_obj_t* calendar lv_obj_get_parent(header);const lv_calendar_date_t* cur_date lv_calendar_get_showed_date(calendar);lv_obj_t* year_dd lv_obj_get_child(header, 0);lv_dropdown_set_selected(year_dd, cur_date-year - 2023);lv_obj_t* month_dd lv_obj_get_child(header, 1);lv_dropdown_set_selected(month_dd, cur_date-month - 1); }#endif /*LV_USE_CALENDAR_HEADER_ARROW*/
http://www.pierceye.com/news/86637/

相关文章:

  • 网站推广策划的策略咨询行业网站开发
  • 做我女朋友的套路网站阜宁网站开发
  • 宁夏做网站的wordpress 分页制作
  • 求推荐专门做借条的网站网站建设以推广
  • 12306网站做的好还是百度做的好网络设计的目的
  • 红酒哪个网站做的好医药公司网站设计
  • 绍兴seo网站管理wordpress目录和页面
  • 网站建设人员招聘seo是指什么岗位
  • 单页网站排名优化建设股票交易网站
  • 自己做博客网站互联网公司市值排名城市
  • 李沧区网站服务公司网站首页包含的内容怎么做
  • 做 个收废品网站wordpress变装博客
  • 手机网站建设视频教程_wordpress后台504
  • 长沙网站公司网站建设唐山做网站那家好
  • 顺德公司做网站语言互动网站建设
  • 静态网页模板生成工具汨罗网站seo
  • 做网站前端用什么网站要不要备案
  • 手机网站开放南通物流网站建设
  • 公司网站制作需要什么微信小程序 网站建设
  • 莆田哪里有学做网站的深圳本地网站建设
  • 企业品牌网站建设公司门户网站域名
  • 做seo是要先有网站吗网站模板首页
  • 建设网站用英文怎么说在线app制作平台
  • 网站开发技术的选择网站做点击收费
  • 商务网站规划与设计品牌建设的本质英语作文
  • 陕西西安网站建设公司排名深圳建站公司有推荐的公司吗
  • 网站app封装怎么做怎么把网站上传到域名
  • 网站模版免费下载装修平台网站排名
  • 网站首页收录没有了昆明移动网站建设
  • 企业网站开发流程简述网络编程技术及应用