BigW Consortium Gitlab

Commit cd83e6fe by Gabor

Merge branch 'lv_group' into beta

parents 5353906d 9fcb8e0d
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
/*lv_obj (base object) settings*/ /*lv_obj (base object) settings*/
#define LV_OBJ_FREE_NUM 1 /*Enable the free number attribute*/ #define LV_OBJ_FREE_NUM 1 /*Enable the free number attribute*/
#define LV_OBJ_FREE_P 1 /*Enable the free pointer attribute*/ #define LV_OBJ_FREE_P 1 /*Enable the free pointer attribute*/
#define LV_OBJ_GROUP 1 /*Enable object groups*/
/*Others*/ /*Others*/
#define LV_COLOR_TRANSP COLOR_LIME #define LV_COLOR_TRANSP COLOR_LIME
...@@ -145,6 +146,9 @@ ...@@ -145,6 +146,9 @@
/*List (dependencies: lv_page, lv_btn, lv_label, lv_img)*/ /*List (dependencies: lv_page, lv_btn, lv_label, lv_img)*/
#define USE_LV_LIST 1 #define USE_LV_LIST 1
#if USE_LV_LIST != 0
#define LV_LIST_FOCUS_TIME 100 /*Animation time of focusing to the a list element [ms] (0: no animation) */
#endif
/*Drop down list (dependencies: lv_page, lv_label)*/ /*Drop down list (dependencies: lv_page, lv_label)*/
#define USE_LV_DDLIST 1 #define USE_LV_DDLIST 1
...@@ -244,7 +248,6 @@ ...@@ -244,7 +248,6 @@
#define LV_APP_FILES_CHUNK_MAX_SIZE 1024 /*Max chunk size when the user sets it*/ #define LV_APP_FILES_CHUNK_MAX_SIZE 1024 /*Max chunk size when the user sets it*/
#endif /*USE_LV_APP_FILES != 0*/ #endif /*USE_LV_APP_FILES != 0*/
/*Benchmark*/ /*Benchmark*/
#define USE_LV_APP_BENCHMARK 1 #define USE_LV_APP_BENCHMARK 1
#if USE_LV_APP_BENCHMARK != 0 #if USE_LV_APP_BENCHMARK != 0
...@@ -252,7 +255,7 @@ ...@@ -252,7 +255,7 @@
#endif #endif
/*WiFi*/ /*WiFi*/
#define USE_LV_APP_WIFI 1 #define USE_LV_APP_WIFI 0
#if USE_LV_APP_WIFI != 0 #if USE_LV_APP_WIFI != 0
#define LV_APP_WIFI_CONF_PATH "S:/wifi_conf.txt" /*Save config. here. Comment to use def. value*/ #define LV_APP_WIFI_CONF_PATH "S:/wifi_conf.txt" /*Save config. here. Comment to use def. value*/
#ifndef LV_APP_WIFI_CONF_PATH #ifndef LV_APP_WIFI_CONF_PATH
...@@ -265,7 +268,7 @@ ...@@ -265,7 +268,7 @@
#endif /*USE_LV_APP_WIFI != 0*/ #endif /*USE_LV_APP_WIFI != 0*/
/*GSM*/ /*GSM*/
#define USE_LV_APP_GSM 1 #define USE_LV_APP_GSM 0
#if USE_LV_APP_GSM != 0 #if USE_LV_APP_GSM != 0
#define LV_APP_GSM_CONF_PATH "S:/gsm_conf.txt" /*Save config. here. Comment to use def. value*/ #define LV_APP_GSM_CONF_PATH "S:/gsm_conf.txt" /*Save config. here. Comment to use def. value*/
#ifndef LV_APP_GSM_CONF_PATH #ifndef LV_APP_GSM_CONF_PATH
...@@ -277,7 +280,7 @@ ...@@ -277,7 +280,7 @@
#endif /*USE_LV_APP_GSM != 0*/ #endif /*USE_LV_APP_GSM != 0*/
/*Ethernet*/ /*Ethernet*/
#define USE_LV_APP_ETHERNET 1 #define USE_LV_APP_ETHERNET 0
#if USE_LV_APP_ETHERNET != 0 #if USE_LV_APP_ETHERNET != 0
/*No settings*/ /*No settings*/
#endif /*USE_LV_APP_ETHERNET != 0*/ #endif /*USE_LV_APP_ETHERNET != 0*/
......
/**
* @file lv_group.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_group.h"
#if LV_OBJ_GROUP != 0
#include <stddef.h>
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static void style_mod_def(lv_style_t * style);
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Create a new object group
* @return pointer to the new object group
*/
lv_group_t * lv_group_create(void)
{
lv_group_t * group = dm_alloc(sizeof(lv_group_t));
ll_init(&group->obj_ll, sizeof(lv_obj_t *));
group->style_mod = style_mod_def;
group->obj_focus = NULL;
return group;
}
/**
* Add an object to a group
* @param group pointer to a group
* @param obj pointer to an object to add
*/
void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
{
obj->group_p = group;
lv_obj_t ** next = ll_ins_tail(&group->obj_ll);
*next = obj;
/* If the head and the tail is equal then there is only one object in the linked list.
* In this case automatically activate it*/
if(ll_get_head(&group->obj_ll) == next) {
lv_group_focus_next(group);
}
}
/**
* Remove an object from its group
* @param obj pointer to an objectto remove
*/
void lv_group_rem_obj(lv_obj_t * obj)
{
lv_group_t * g = obj->group_p;
if(g == NULL) return;
lv_obj_t ** i;
LL_READ(g->obj_ll, i) {
if(*i == obj) {
ll_rem(&g->obj_ll, i);
break;
}
}
}
/**
* Focus on an object (defocus the current)
* @param obj pointer to an object to focus on
*/
void lv_group_focus_obj(lv_obj_t * obj)
{
lv_group_t * g = obj->group_p;
if(g == NULL) return;
lv_obj_t ** i;
LL_READ(g->obj_ll, i) {
if(*i == obj) {
if(g->obj_focus != NULL) {
(*g->obj_focus)->signal_f(*g->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
lv_obj_inv(*g->obj_focus);
}
g->obj_focus = i;
if(g->obj_focus != NULL){
(*g->obj_focus)->signal_f(*g->obj_focus, LV_SIGNAL_FOCUS, NULL);
lv_obj_inv(*g->obj_focus);
}
break;
}
}
}
/**
* Focus the next object in a group (defocus the current)
* @param group pointer to a group
*/
void lv_group_focus_next(lv_group_t * group)
{
if(group->obj_focus != NULL) {
(*group->obj_focus)->signal_f(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
lv_obj_inv(*group->obj_focus);
}
lv_obj_t ** obj_next;
if(group->obj_focus == NULL) obj_next = ll_get_head(&group->obj_ll);
else obj_next = ll_get_next(&group->obj_ll, group->obj_focus);
if(obj_next == NULL) obj_next = ll_get_head(&group->obj_ll);
group->obj_focus = obj_next;
if(group->obj_focus != NULL){
(*group->obj_focus)->signal_f(*group->obj_focus, LV_SIGNAL_FOCUS, NULL);
lv_obj_inv(*group->obj_focus);
}
}
/**
* Focus the previous object in a group (defocus the current)
* @param group pointer to a group
*/
void lv_group_focus_prev(lv_group_t * group)
{
if(group->obj_focus != NULL) {
(*group->obj_focus)->signal_f(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
lv_obj_inv(*group->obj_focus);
}
lv_obj_t ** obj_next;
if(group->obj_focus == NULL) obj_next = ll_get_tail(&group->obj_ll);
else obj_next = ll_get_prev(&group->obj_ll, group->obj_focus);
if(obj_next == NULL) obj_next = ll_get_tail(&group->obj_ll);
group->obj_focus = obj_next;
if(group->obj_focus != NULL){
(*group->obj_focus)->signal_f(*group->obj_focus, LV_SIGNAL_FOCUS, NULL);
lv_obj_inv(*group->obj_focus);
}
}
/**
* Send a control character to the focuses object of a group
* @param group pointer to a group
* @param c a control character (use LV_GROUP_KEY_.. to navigate)
*/
void lv_group_send(lv_group_t * group, char c)
{
lv_obj_t * act = lv_group_get_focused(group);
if(act == NULL) return;
act->signal_f(act, LV_SIGNAL_CONTROLL, &c);
}
/**
* Set a function for a group which will modify the object's style if it is in focus
* @param group pointer to a group
* @param style_cb the style modifier function pointer
*/
void lv_group_set_style_mod_cb(lv_group_t * group, void (*style_cb)(lv_style_t * style))
{
group->style_mod = style_cb;
if(group->obj_focus != NULL) lv_obj_inv(*group->obj_focus);
}
/**
* Modify a style with the set 'style_mod' function. The input style remains unchanged.
* @param group pointer to group
* @param style pointer to a style to modify
* @return a copy of the input style but modified with the 'style_mod' function
*/
lv_style_t * lv_group_mod_style(lv_group_t * group, const lv_style_t * style)
{
lv_style_cpy(&group->style_tmp, style);
if(group->style_mod != NULL) group->style_mod(&group->style_tmp);
else style_mod_def(&group->style_tmp);
return &group->style_tmp;
}
/**
* Get the focused object or NULL if there isn't one
* @param group pointer to a group
* @return pointer to the focused object
*/
lv_obj_t * lv_group_get_focused(lv_group_t * group)
{
if(group == NULL) return NULL;
if(group->obj_focus == NULL) return NULL;
return *group->obj_focus;
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Default style modifier function
* @param style pointer to a style to modify. (Typically &group->style_tmp) It will be OVERWRITTEN.
*/
static void style_mod_def(lv_style_t * style)
{
/*Make the style a little bit orange*/
style->bcolor = COLOR_ORANGE;
style->bopa = OPA_COVER;
if(style->bwidth == 0 && style->empty == 0) style->bwidth = 2 * LV_DOWNSCALE; /*Add border to not transparent styles*/
else style->bwidth = style->bwidth * 2; /*Make the border thicker*/
style->mcolor = color_mix(style->mcolor, COLOR_ORANGE, OPA_80);
style->gcolor = color_mix(style->gcolor, COLOR_ORANGE, OPA_80);
}
#endif /*LV_OBJ_GROUP != 0*/
/**
* @file lv_group.h
*
*/
#ifndef LV_GROUP_H
#define LV_GROUP_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lv_conf.h"
#include "lv_obj.h"
/*********************
* DEFINES
*********************/
/*Predefined keys to control the focused object via lv_group_send(group, c)*/
/*For compatibility in signal function define the keys regardless to LV_OBJ_GROUP*/
#define LV_GROUP_KEY_UP 17 /*0x11*/
#define LV_GROUP_KEY_DOWN 18 /*0x12*/
#define LV_GROUP_KEY_RIGHT 19 /*0x13*/
#define LV_GROUP_KEY_LEFT 20 /*0x14*/
#define LV_GROUP_KEY_ESC 33 /*0x1B*/
#define LV_GROUP_KEY_ENTER 10 /*0x0A, '\n'*/
#if LV_OBJ_GROUP != 0
/**********************
* TYPEDEFS
**********************/
typedef struct
{
ll_dsc_t obj_ll;
lv_obj_t ** obj_focus;
void (*style_mod)(lv_style_t * style);
lv_style_t style_tmp;
}lv_group_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
lv_group_t * lv_group_create(void);
void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj);
void lv_group_rem_obj(lv_obj_t * obj);
void lv_group_focus_obj(lv_obj_t * obj);
void lv_group_focus_next(lv_group_t * group);
void lv_group_focus_prev(lv_group_t * group);
void lv_group_send(lv_group_t * group, char c);
lv_style_t * lv_group_mod_style(lv_group_t * group, const lv_style_t * style);
lv_obj_t * lv_group_get_focused(lv_group_t * group);
/**********************
* MACROS
**********************/
#endif /*LV_OBJ_GROUP != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_GROUP_H*/
...@@ -12,8 +12,10 @@ ...@@ -12,8 +12,10 @@
#include "lvgl/lv_obj/lv_dispi.h" #include "lvgl/lv_obj/lv_dispi.h"
#include "lvgl/lv_obj/lv_obj.h" #include "lvgl/lv_obj/lv_obj.h"
#include "lvgl/lv_obj/lv_refr.h" #include "lvgl/lv_obj/lv_refr.h"
#include "lvgl/lv_obj/lv_group.h"
#include "lvgl/lv_app/lv_app.h" #include "lvgl/lv_app/lv_app.h"
#include "lvgl/lv_draw/lv_draw_rbasic.h" #include "lvgl/lv_draw/lv_draw_rbasic.h"
#include "lv_group.h"
#include "misc/gfx/anim.h" #include "misc/gfx/anim.h"
#include "hal/indev/indev.h" #include "hal/indev/indev.h"
#include <stdint.h> #include <stdint.h>
...@@ -141,10 +143,14 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy) ...@@ -141,10 +143,14 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
#if LV_OBJ_FREE_NUM != 0 #if LV_OBJ_FREE_NUM != 0
new_obj->free_num = 0; new_obj->free_num = 0;
#endif #endif
#if LV_OBJ_FREE_P != 0 #if LV_OBJ_FREE_P != 0
new_obj->free_p = NULL; new_obj->free_p = NULL;
#endif #endif
#if LV_OBJ_GROUP != 0
new_obj->group_p = NULL;
#endif
/*Set attributes*/ /*Set attributes*/
new_obj->click_en = 0; new_obj->click_en = 0;
new_obj->drag_en = 0; new_obj->drag_en = 0;
...@@ -187,6 +193,9 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy) ...@@ -187,6 +193,9 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
#if LV_OBJ_FREE_P != 0 #if LV_OBJ_FREE_P != 0
new_obj->free_p = NULL; new_obj->free_p = NULL;
#endif #endif
#if LV_OBJ_GROUP != 0
new_obj->group_p = NULL;
#endif
/*Set attributes*/ /*Set attributes*/
new_obj->click_en = 1; new_obj->click_en = 1;
...@@ -198,7 +207,6 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy) ...@@ -198,7 +207,6 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
new_obj->protect = LV_PROTECT_NONE; new_obj->protect = LV_PROTECT_NONE;
new_obj->ext = NULL; new_obj->ext = NULL;
} }
if(copy != NULL) { if(copy != NULL) {
...@@ -223,6 +231,13 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy) ...@@ -223,6 +231,13 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
new_obj->style_p = copy->style_p; new_obj->style_p = copy->style_p;
#if LV_OBJ_GROUP != 0
/*Add to the same group*/
if(copy->group_p != NULL) {
lv_group_add_obj(copy->group_p, new_obj);
}
#endif
lv_obj_set_pos(new_obj, lv_obj_get_x(copy), lv_obj_get_y(copy)); lv_obj_set_pos(new_obj, lv_obj_get_x(copy), lv_obj_get_y(copy));
} }
...@@ -1234,20 +1249,28 @@ cord_t lv_obj_get_ext_size(lv_obj_t * obj) ...@@ -1234,20 +1249,28 @@ cord_t lv_obj_get_ext_size(lv_obj_t * obj)
*/ */
lv_style_t * lv_obj_get_style(lv_obj_t * obj) lv_style_t * lv_obj_get_style(lv_obj_t * obj)
{ {
if(obj->style_p != NULL) return obj->style_p; lv_style_t * style_act = obj->style_p;
else { if(style_act == NULL) {
lv_obj_t * par = obj->par; lv_obj_t * par = obj->par;
while(par != NULL) { while(par != NULL) {
if(par->style_p != NULL) { if(par->style_p != NULL) {
if(par->style_p->glass == 0) return par->style_p; if(par->style_p->glass == 0) {
style_act = par->style_p;
break;
}
} }
par = par->par; par = par->par;
} }
} }
#if LV_OBJ_GROUP != 0
/*Never reach this, at least the screen has to be a style*/ if(obj->group_p != NULL) {
return NULL; if(lv_group_get_focused(obj->group_p) == obj) {
style_act = lv_group_mod_style(obj->group_p, style_act);
}
}
#endif
return style_act;
} }
/*----------------- /*-----------------
...@@ -1395,6 +1418,18 @@ void * lv_obj_get_free_p(lv_obj_t * obj) ...@@ -1395,6 +1418,18 @@ void * lv_obj_get_free_p(lv_obj_t * obj)
} }
#endif #endif
#if LV_OBJ_GROUP != 0
/**
* Get the group of the object
* @param obj pointer to an object
* @return the pointer to group of the object
*/
void * lv_obj_get_group(lv_obj_t * obj)
{
return obj->group_p;
}
#endif
/********************** /**********************
* STATIC FUNCTIONS * STATIC FUNCTIONS
**********************/ **********************/
...@@ -1523,13 +1558,16 @@ static void lv_obj_del_child(lv_obj_t * obj) ...@@ -1523,13 +1558,16 @@ static void lv_obj_del_child(lv_obj_t * obj)
/*Remove the animations from this object*/ /*Remove the animations from this object*/
anim_del(obj, NULL); anim_del(obj, NULL);
/*Delete from the group*/
#if LV_OBJ_GROUP != 0
if(obj->group_p != NULL) lv_group_rem_obj(obj);
#endif
/*Remove the object from parent's children list*/ /*Remove the object from parent's children list*/
lv_obj_t * par = lv_obj_get_parent(obj); lv_obj_t * par = lv_obj_get_parent(obj);
ll_rem(&(par->child_ll), obj); ll_rem(&(par->child_ll), obj);
/* All children deleted. /* Clean up the object specific data*/
* Now clean up the object specific data*/
obj->signal_f(obj, LV_SIGNAL_CLEANUP, NULL); obj->signal_f(obj, LV_SIGNAL_CLEANUP, NULL);
/*Delete the base objects*/ /*Delete the base objects*/
......
...@@ -72,19 +72,27 @@ typedef bool (* lv_design_f_t) (struct __LV_OBJ_T * obj, const area_t * mask_p, ...@@ -72,19 +72,27 @@ typedef bool (* lv_design_f_t) (struct __LV_OBJ_T * obj, const area_t * mask_p,
typedef enum typedef enum
{ {
/*General signals*/
LV_SIGNAL_CLEANUP, LV_SIGNAL_CLEANUP,
LV_SIGNAL_CHILD_CHG,
LV_SIGNAL_CORD_CHG,
LV_SIGNAL_STYLE_CHG,
LV_SIGNAL_REFR_EXT_SIZE,
/*Display input related*/
LV_SIGNAL_PRESSED, LV_SIGNAL_PRESSED,
LV_SIGNAL_PRESSING, LV_SIGNAL_PRESSING,
LV_SIGNAL_PRESS_LOST, LV_SIGNAL_PRESS_LOST,
LV_SIGNAL_RELEASED, LV_SIGNAL_RELEASED,
LV_SIGNAL_LONG_PRESS, LV_SIGNAL_LONG_PRESS,
LV_SIGNAL_LONG_PRESS_REP, LV_SIGNAL_LONG_PRESS_REP,
LV_SIGNAL_DRAG_BEGIN, LV_SIGNAL_DRAG_BEGIN,
LV_SIGNAL_DRAG_END, LV_SIGNAL_DRAG_END,
LV_SIGNAL_CHILD_CHG,
LV_SIGNAL_CORD_CHG, /*Group related*/
LV_SIGNAL_STYLE_CHG, LV_SIGNAL_FOCUS,
LV_SIGNAL_REFR_EXT_SIZE, LV_SIGNAL_DEFOCUS,
LV_SIGNAL_CONTROLL,
}lv_signal_t; }lv_signal_t;
typedef bool (* lv_signal_f_t) (struct __LV_OBJ_T * obj, lv_signal_t sign, void * param); typedef bool (* lv_signal_f_t) (struct __LV_OBJ_T * obj, lv_signal_t sign, void * param);
...@@ -106,6 +114,8 @@ typedef struct __LV_OBJ_T ...@@ -106,6 +114,8 @@ typedef struct __LV_OBJ_T
void * free_p; /*Application specific pointer (set it freely)*/ void * free_p; /*Application specific pointer (set it freely)*/
#endif #endif
void * group_p; /*Pointer to the group of the object*/
/*Attributes and states*/ /*Attributes and states*/
uint8_t click_en :1; /*1: Can be pressed by a display input device*/ uint8_t click_en :1; /*1: Can be pressed by a display input device*/
uint8_t drag_en :1; /*1: Enable the dragging*/ uint8_t drag_en :1; /*1: Enable the dragging*/
...@@ -159,13 +169,6 @@ typedef enum ...@@ -159,13 +169,6 @@ typedef enum
LV_ALIGN_OUT_RIGHT_BOTTOM, LV_ALIGN_OUT_RIGHT_BOTTOM,
}lv_align_t; }lv_align_t;
typedef struct
{
color_t color;
opa_t opa;
}lv_objs_t;
typedef enum typedef enum
{ {
LV_ANIM_NONE = 0, LV_ANIM_NONE = 0,
...@@ -473,6 +476,7 @@ void lv_obj_set_free_num(lv_obj_t * obj, uint8_t free_num); ...@@ -473,6 +476,7 @@ void lv_obj_set_free_num(lv_obj_t * obj, uint8_t free_num);
*/ */
void lv_obj_set_free_p(lv_obj_t * obj, void * free_p); void lv_obj_set_free_p(lv_obj_t * obj, void * free_p);
#endif #endif
/** /**
* Animate an object * Animate an object
* @param obj pointer to an object to animate * @param obj pointer to an object to animate
...@@ -665,6 +669,14 @@ uint8_t lv_obj_get_free_num(lv_obj_t * obj); ...@@ -665,6 +669,14 @@ uint8_t lv_obj_get_free_num(lv_obj_t * obj);
void * lv_obj_get_free_p(lv_obj_t * obj); void * lv_obj_get_free_p(lv_obj_t * obj);
#endif #endif
#if LV_OBJ_GROUP != 0
/**
* Get the group of the object
* @param obj pointer to an object
* @return the pointer to group of the object
*/
void * lv_obj_get_group(lv_obj_t * obj);
#endif
/********************** /**********************
* MACROS * MACROS
**********************/ **********************/
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
#include "lv_conf.h" #include "lv_conf.h"
#if USE_LV_BTN != 0 #if USE_LV_BTN != 0
#include "lvgl/lv_obj/lv_obj.h" #include "lv_btn.h"
#include "../lv_obj/lv_group.h"
#include "../lv_draw/lv_draw.h"
#include "misc/gfx/area.h" #include "misc/gfx/area.h"
#include "misc/gfx/color.h" #include "misc/gfx/color.h"
#include "../lv_draw/lv_draw.h"
#include "lv_btn.h"
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
...@@ -185,6 +185,31 @@ bool lv_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * param) ...@@ -185,6 +185,31 @@ bool lv_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * param)
if(ext->lpr_rep_action != NULL && state != LV_BTN_STATE_INA) { if(ext->lpr_rep_action != NULL && state != LV_BTN_STATE_INA) {
valid = ext->lpr_rep_action(btn, param); valid = ext->lpr_rep_action(btn, param);
} }
} else if(sign == LV_SIGNAL_CONTROLL) {
lv_btn_ext_t * ext = lv_obj_get_ext(btn);
char c = *((char*)param);
if(c == LV_GROUP_KEY_RIGHT || c == LV_GROUP_KEY_UP) {
if(lv_btn_get_tgl(btn) != false) lv_btn_set_state(btn, LV_BTN_STATE_TREL);
if(ext->rel_action != NULL && lv_btn_get_state(btn) != LV_BTN_STATE_INA) {
valid = ext->rel_action(btn, param);
}
} else if(c == LV_GROUP_KEY_LEFT || c == LV_GROUP_KEY_DOWN) {
if(lv_btn_get_tgl(btn) != false) lv_btn_set_state(btn, LV_BTN_STATE_REL);
if(ext->rel_action != NULL && lv_btn_get_state(btn) != LV_BTN_STATE_INA) {
valid = ext->rel_action(btn, param);
}
} else if(c == LV_GROUP_KEY_ENTER) {
if(lv_btn_get_tgl(btn) != false) {
lv_btn_state_t state = lv_btn_get_state(btn);
if(state == LV_BTN_STATE_REL) lv_btn_set_state(btn, LV_BTN_STATE_TREL);
else if(state == LV_BTN_STATE_PR) lv_btn_set_state(btn, LV_BTN_STATE_TPR);
else if(state == LV_BTN_STATE_TREL) lv_btn_set_state(btn, LV_BTN_STATE_REL);
else if(state == LV_BTN_STATE_TPR) lv_btn_set_state(btn, LV_BTN_STATE_PR);
}
if(ext->rel_action != NULL && lv_btn_get_state(btn) != LV_BTN_STATE_INA) {
valid = ext->rel_action(btn, param);
}
}
} }
} }
...@@ -322,6 +347,50 @@ bool lv_btn_get_tgl(lv_obj_t * btn) ...@@ -322,6 +347,50 @@ bool lv_btn_get_tgl(lv_obj_t * btn)
} }
/** /**
* Get the release action of a button
* @param btn pointer to a button object
* @return pointer to the release action function
*/
lv_action_t lv_btn_get_rel_action(lv_obj_t * btn)
{
lv_btn_ext_t * ext = lv_obj_get_ext(btn);
return ext->rel_action;
}
/**
* Get the press action of a button
* @param btn pointer to a button object
* @return pointer to the press action function
*/
lv_action_t lv_btn_get_pr_action(lv_obj_t * btn)
{
lv_btn_ext_t * ext = lv_obj_get_ext(btn);
return ext->pr_action;
}
/**
* Get the long press action of a button
* @param btn pointer to a button object
* @return pointer to the release action function
*/
lv_action_t lv_btn_get_lpr_action(lv_obj_t * btn)
{
lv_btn_ext_t * ext = lv_obj_get_ext(btn);
return ext->lpr_action;
}
/**
* Get the long press repeat action of a button
* @param btn pointer to a button object
* @return pointer to the long press repeat action function
*/
lv_action_t lv_btn_get_lpr_rep_action(lv_obj_t * btn)
{
lv_btn_ext_t * ext = lv_obj_get_ext(btn);
return ext->lpr_rep_action;
}
/**
* Get the style of a button in a given state * Get the style of a button in a given state
* @param btn pointer to a button object * @param btn pointer to a button object
* @param state a state from 'lv_btn_state_t' in which style should be get * @param state a state from 'lv_btn_state_t' in which style should be get
......
...@@ -149,6 +149,32 @@ lv_btn_state_t lv_btn_get_state(lv_obj_t * btn); ...@@ -149,6 +149,32 @@ lv_btn_state_t lv_btn_get_state(lv_obj_t * btn);
bool lv_btn_get_tgl(lv_obj_t * btn); bool lv_btn_get_tgl(lv_obj_t * btn);
/** /**
* Get the release action of a button
* @param btn pointer to a button object
* @return pointer to the release action function
*/
lv_action_t lv_btn_get_rel_action(lv_obj_t * btn);
/**
* Get the press action of a button
* @param btn pointer to a button object
* @return pointer to the press action function
*/
lv_action_t lv_btn_get_pr_action(lv_obj_t * btn);
/**
* Get the long press action of a button
* @param btn pointer to a button object
* @return pointer to the release action function
*/
lv_action_t lv_btn_get_lpr_action(lv_obj_t * btn);
/**
* Get the long press repeat action of a button
* @param btn pointer to a button object
* @return pointer to the long press repeat action function
*/
lv_action_t lv_btn_get_lpr_rep_action(lv_obj_t * btn);
/**
* Get the style of a button in a given state * Get the style of a button in a given state
* @param btn pointer to a button object * @param btn pointer to a button object
* @param state a state from 'lv_btn_state_t' in which style should be get * @param state a state from 'lv_btn_state_t' in which style should be get
......
...@@ -10,9 +10,10 @@ ...@@ -10,9 +10,10 @@
#if USE_LV_BTNM != 0 #if USE_LV_BTNM != 0
#include "lv_btnm.h" #include "lv_btnm.h"
#include "misc/gfx/text.h" #include "../lv_obj/lv_group.h"
#include "../lv_draw/lv_draw.h" #include "../lv_draw/lv_draw.h"
#include "../lv_obj/lv_refr.h" #include "../lv_obj/lv_refr.h"
#include "misc/gfx/text.h"
/********************* /*********************
* DEFINES * DEFINES
...@@ -29,6 +30,7 @@ ...@@ -29,6 +30,7 @@
static bool lv_btnm_design(lv_obj_t * btnm, const area_t * mask, lv_design_mode_t mode); static bool lv_btnm_design(lv_obj_t * btnm, const area_t * mask, lv_design_mode_t mode);
static uint8_t lv_btnm_get_width_unit(const char * btn_str); static uint8_t lv_btnm_get_width_unit(const char * btn_str);
static uint16_t lv_btnm_get_btn_from_point(lv_obj_t * btnm, point_t * p); static uint16_t lv_btnm_get_btn_from_point(lv_obj_t * btnm, point_t * p);
static uint16_t lv_btnm_get_btn_txt(lv_obj_t * btnm, uint16_t btn_id);
static void lv_btnm_create_btns(lv_obj_t * btnm, const char ** map); static void lv_btnm_create_btns(lv_obj_t * btnm, const char ** map);
/********************** /**********************
...@@ -155,18 +157,8 @@ bool lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param) ...@@ -155,18 +157,8 @@ bool lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
} }
else if(sign == LV_SIGNAL_RELEASED || sign == LV_SIGNAL_LONG_PRESS_REP) { else if(sign == LV_SIGNAL_RELEASED || sign == LV_SIGNAL_LONG_PRESS_REP) {
if(ext->cb != NULL && ext->btn_pr != LV_BTNM_PR_NONE) { if(ext->cb != NULL && ext->btn_pr != LV_BTNM_PR_NONE) {
uint16_t txt_i = 0; uint16_t txt_i = lv_btnm_get_btn_txt(btnm, ext->btn_pr);
uint16_t btn_i = 0; if(txt_i != LV_BTNM_PR_NONE) ext->cb(btnm, txt_i);
/* Search the text of ext->btn_pr the buttons text in the map
* Skip "\n"-s*/
while(btn_i != ext->btn_pr) {
btn_i ++;
txt_i ++;
if(strcmp(ext->map_p[txt_i], "\n") == 0) txt_i ++;
}
ext->cb(btnm, txt_i);
} }
if(sign == LV_SIGNAL_RELEASED && ext->btn_pr != LV_BTNM_PR_NONE) { if(sign == LV_SIGNAL_RELEASED && ext->btn_pr != LV_BTNM_PR_NONE) {
...@@ -181,11 +173,30 @@ bool lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param) ...@@ -181,11 +173,30 @@ bool lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
ext->btn_pr = LV_BTNM_PR_NONE; ext->btn_pr = LV_BTNM_PR_NONE;
} }
} } else if(sign == LV_SIGNAL_PRESS_LOST || sign == LV_SIGNAL_DEFOCUS) {
else if(sign == LV_SIGNAL_PRESS_LOST) {
ext->btn_pr = LV_BTNM_PR_NONE; ext->btn_pr = LV_BTNM_PR_NONE;
lv_obj_inv(btnm); lv_obj_inv(btnm);
} else if(sign == LV_SIGNAL_FOCUS) {
ext->btn_pr = 0;
lv_obj_inv(btnm);
} else if(sign == LV_SIGNAL_CONTROLL) {
lv_btnm_ext_t * ext = lv_obj_get_ext(btnm);
char c = *((char*)param);
if(c == LV_GROUP_KEY_RIGHT || c == LV_GROUP_KEY_UP) {
if(ext->btn_pr == LV_BTNM_PR_NONE) ext->btn_pr = 0;
else ext->btn_pr++;
if(ext->btn_pr >= ext->btn_cnt - 1) ext->btn_pr = ext->btn_cnt - 1;
lv_obj_inv(btnm);
} else if(c == LV_GROUP_KEY_LEFT || c == LV_GROUP_KEY_DOWN) {
if(ext->btn_pr == LV_BTNM_PR_NONE) ext->btn_pr = 0;
if(ext->btn_pr > 0) ext->btn_pr--;
lv_obj_inv(btnm);
} else if(c == LV_GROUP_KEY_ENTER) {
if(ext->cb != NULL) {
uint16_t txt_i = lv_btnm_get_btn_txt(btnm, ext->btn_pr);
if(txt_i != LV_BTNM_PR_NONE) ext->cb(btnm, txt_i);
}
}
} }
} }
...@@ -441,8 +452,6 @@ static bool lv_btnm_design(lv_obj_t * btnm, const area_t * mask, lv_design_mode_ ...@@ -441,8 +452,6 @@ static bool lv_btnm_design(lv_obj_t * btnm, const area_t * mask, lv_design_mode_
txt_i ++; txt_i ++;
} }
} }
return true; return true;
} }
...@@ -486,6 +495,12 @@ static uint8_t lv_btnm_get_width_unit(const char * btn_str) ...@@ -486,6 +495,12 @@ static uint8_t lv_btnm_get_width_unit(const char * btn_str)
return 1; return 1;
} }
/**
* Gives the button id of a button under a given point
* @param btnm pointer to a button matrix object
* @param p a point with absolute coordinates
* @return the id of the button or LV_BTNM_PR_NONE.
*/
static uint16_t lv_btnm_get_btn_from_point(lv_obj_t * btnm, point_t * p) static uint16_t lv_btnm_get_btn_from_point(lv_obj_t * btnm, point_t * p)
{ {
area_t btnm_cords; area_t btnm_cords;
...@@ -510,5 +525,33 @@ static uint16_t lv_btnm_get_btn_from_point(lv_obj_t * btnm, point_t * p) ...@@ -510,5 +525,33 @@ static uint16_t lv_btnm_get_btn_from_point(lv_obj_t * btnm, point_t * p)
return i; return i;
} }
/**
* Get the text of a button
* @param btnm pointer to a button matrix object
* @param btn_id button id
* @return text id in ext->map_p or LV_BTNM_PR_NONE if 'btn_id' was invalid
*/
static uint16_t lv_btnm_get_btn_txt(lv_obj_t * btnm, uint16_t btn_id)
{
lv_btnm_ext_t * ext = lv_obj_get_ext(btnm);
if(btn_id > ext->btn_cnt) return LV_BTNM_PR_NONE;
uint16_t txt_i = 0;
uint16_t btn_i = 0;
/* Search the text of ext->btn_pr the buttons text in the map
* Skip "\n"-s*/
while(btn_i != btn_id) {
btn_i ++;
txt_i ++;
if(strcmp(ext->map_p[txt_i], "\n") == 0) txt_i ++;
}
if(btn_i == ext->btn_cnt) return LV_BTNM_PR_NONE;
return txt_i;
}
#endif #endif
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#if USE_LV_CB != 0 #if USE_LV_CB != 0
#include "lv_cb.h" #include "lv_cb.h"
#include "../lv_obj/lv_group.h"
/********************* /*********************
* DEFINES * DEFINES
...@@ -23,11 +24,14 @@ ...@@ -23,11 +24,14 @@
* STATIC PROTOTYPES * STATIC PROTOTYPES
**********************/ **********************/
static bool lv_cb_design(lv_obj_t * cb, const area_t * mask, lv_design_mode_t mode); static bool lv_cb_design(lv_obj_t * cb, const area_t * mask, lv_design_mode_t mode);
static bool lv_bullet_design(lv_obj_t * bullet, const area_t * mask, lv_design_mode_t mode);
/********************** /**********************
* STATIC VARIABLES * STATIC VARIABLES
**********************/ **********************/
static lv_design_f_t ancestor_design_f; static lv_design_f_t ancestor_bg_design_f;
static lv_design_f_t ancestor_bullet_design_f;
/********************** /**********************
* MACROS * MACROS
**********************/ **********************/
...@@ -57,7 +61,7 @@ lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy) ...@@ -57,7 +61,7 @@ lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy)
ext->bullet = NULL; ext->bullet = NULL;
ext->label = NULL; ext->label = NULL;
if(ancestor_design_f == NULL) ancestor_design_f = lv_obj_get_design_f(new_cb); if(ancestor_bg_design_f == NULL) ancestor_bg_design_f = lv_obj_get_design_f(new_cb);
lv_obj_set_signal_f(new_cb, lv_cb_signal); lv_obj_set_signal_f(new_cb, lv_cb_signal);
lv_obj_set_design_f(new_cb, lv_cb_design); lv_obj_set_design_f(new_cb, lv_cb_design);
...@@ -65,6 +69,7 @@ lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy) ...@@ -65,6 +69,7 @@ lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy)
/*Init the new checkbox object*/ /*Init the new checkbox object*/
if(copy == NULL) { if(copy == NULL) {
ext->bullet = lv_btn_create(new_cb, NULL); ext->bullet = lv_btn_create(new_cb, NULL);
if(ancestor_bullet_design_f == NULL) ancestor_bullet_design_f = lv_obj_get_design_f(ext->bullet);
lv_btn_set_styles(new_cb, lv_style_get(LV_STYLE_TRANSP, NULL), lv_style_get(LV_STYLE_TRANSP, NULL), lv_btn_set_styles(new_cb, lv_style_get(LV_STYLE_TRANSP, NULL), lv_style_get(LV_STYLE_TRANSP, NULL),
lv_style_get(LV_STYLE_TRANSP, NULL), lv_style_get(LV_STYLE_TRANSP, NULL), lv_style_get(LV_STYLE_TRANSP, NULL), lv_style_get(LV_STYLE_TRANSP, NULL),
lv_style_get(LV_STYLE_TRANSP, NULL)); lv_style_get(LV_STYLE_TRANSP, NULL));
...@@ -72,6 +77,7 @@ lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy) ...@@ -72,6 +77,7 @@ lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy)
lv_cont_set_fit(new_cb, true, true); lv_cont_set_fit(new_cb, true, true);
lv_btn_set_tgl(new_cb, true); lv_btn_set_tgl(new_cb, true);
lv_obj_set_design_f(ext->bullet, lv_bullet_design);
lv_obj_set_click(ext->bullet, false); lv_obj_set_click(ext->bullet, false);
lv_btn_set_styles(ext->bullet, lv_style_get(LV_STYLE_PRETTY, NULL), lv_style_get(LV_STYLE_PRETTY_COLOR, NULL), lv_btn_set_styles(ext->bullet, lv_style_get(LV_STYLE_PRETTY, NULL), lv_style_get(LV_STYLE_PRETTY_COLOR, NULL),
lv_style_get(LV_STYLE_BTN_TREL, NULL), lv_style_get(LV_STYLE_BTN_TPR, NULL), lv_style_get(LV_STYLE_BTN_TREL, NULL), lv_style_get(LV_STYLE_BTN_TPR, NULL),
...@@ -114,11 +120,17 @@ bool lv_cb_signal(lv_obj_t * cb, lv_signal_t sign, void * param) ...@@ -114,11 +120,17 @@ bool lv_cb_signal(lv_obj_t * cb, lv_signal_t sign, void * param)
if(valid != false) { if(valid != false) {
if(sign == LV_SIGNAL_STYLE_CHG) { if(sign == LV_SIGNAL_STYLE_CHG) {
lv_obj_set_size(ext->bullet, font_get_height(style->font), font_get_height(style->font)); lv_obj_set_size(ext->bullet, font_get_height(style->font), font_get_height(style->font));
} } else if(sign == LV_SIGNAL_PRESSED ||
if(sign == LV_SIGNAL_PRESSED ||
sign == LV_SIGNAL_RELEASED || sign == LV_SIGNAL_RELEASED ||
sign == LV_SIGNAL_PRESS_LOST) { sign == LV_SIGNAL_PRESS_LOST) {
lv_btn_set_state(lv_cb_get_bullet(cb), lv_btn_get_state(cb)); lv_btn_set_state(lv_cb_get_bullet(cb), lv_btn_get_state(cb));
} else if(sign == LV_SIGNAL_CONTROLL) {
char c = *((char*)param);
if(c == LV_GROUP_KEY_RIGHT || c == LV_GROUP_KEY_DOWN ||
c == LV_GROUP_KEY_LEFT || c == LV_GROUP_KEY_UP ||
c == LV_GROUP_KEY_ENTER) {
lv_btn_set_state(lv_cb_get_bullet(cb), lv_btn_get_state(cb));
}
} }
} }
...@@ -186,19 +198,62 @@ static bool lv_cb_design(lv_obj_t * cb, const area_t * mask, lv_design_mode_t mo ...@@ -186,19 +198,62 @@ static bool lv_cb_design(lv_obj_t * cb, const area_t * mask, lv_design_mode_t mo
{ {
if(mode == LV_DESIGN_COVER_CHK) { if(mode == LV_DESIGN_COVER_CHK) {
/*Return false if the object is not covers the mask_p area*/ /*Return false if the object is not covers the mask_p area*/
return ancestor_design_f(cb, mask, mode); return ancestor_bg_design_f(cb, mask, mode);
} else if(mode == LV_DESIGN_DRAW_MAIN || mode == LV_DESIGN_DRAW_POST) { } else if(mode == LV_DESIGN_DRAW_MAIN || mode == LV_DESIGN_DRAW_POST) {
lv_cb_ext_t * cb_ext = lv_obj_get_ext(cb); lv_cb_ext_t * cb_ext = lv_obj_get_ext(cb);
lv_btn_ext_t * bullet_ext = lv_obj_get_ext(cb_ext->bullet); lv_btn_ext_t * bullet_ext = lv_obj_get_ext(cb_ext->bullet);
/*Be sure he state of the bullet is the same as the parent button*/ /*Be sure the state of the bullet is the same as the parent button*/
bullet_ext->state = cb_ext->bg_btn.state; bullet_ext->state = cb_ext->bg_btn.state;
return ancestor_design_f(cb, mask, mode); return ancestor_bg_design_f(cb, mask, mode);
} else {
return ancestor_bg_design_f(cb, mask, mode);
} }
/*Draw the object*/ return true;
}
/**
* Handle the drawing related tasks of the check boxes
* @param bullet pointer to an object
* @param mask the object will be drawn only in this area
* @param mode LV_DESIGN_COVER_CHK: only check if the object fully covers the 'mask_p' area
* (return 'true' if yes)
* LV_DESIGN_DRAW: draw the object (always return 'true')
* LV_DESIGN_DRAW_POST: drawing after every children are drawn
* @param return true/false, depends on 'mode'
*/
static bool lv_bullet_design(lv_obj_t * bullet, const area_t * mask, lv_design_mode_t mode)
{
if(mode == LV_DESIGN_COVER_CHK) {
return ancestor_bullet_design_f(bullet, mask, mode);
} else if(mode == LV_DESIGN_DRAW_MAIN) {
#if LV_OBJ_GROUP != 0
/* If the check box is the active in a group and
* the background is not visible (transparent or empty)
* then activate the style of the bullet*/
lv_style_t * style_ori = lv_obj_get_style(bullet);
lv_obj_t * bg = lv_obj_get_parent(bullet);
lv_style_t * style_page = lv_obj_get_style(bg);
lv_group_t * g = lv_obj_get_group(bg);
if(style_page->empty != 0 || style_page->opa == OPA_TRANSP) { /*Background is visible?*/
if(lv_group_get_focused(g) == bg) {
lv_style_t * style_mod;
style_mod = lv_group_mod_style(g, style_ori);
bullet->style_p = style_mod; /*Temporally change the style to the activated */
}
}
#endif
ancestor_bullet_design_f(bullet, mask, mode);
#if LV_OBJ_GROUP != 0
bullet->style_p = style_ori; /*Revert the style*/
#endif
} else if(mode == LV_DESIGN_DRAW_POST) {
ancestor_bullet_design_f(bullet, mask, mode);
}
return true; return true;
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "lv_ddlist.h" #include "lv_ddlist.h"
#include "../lv_draw/lv_draw.h" #include "../lv_draw/lv_draw.h"
#include "misc/gfx/anim.h" #include "misc/gfx/anim.h"
#include "../lv_obj/lv_group.h"
/********************* /*********************
* DEFINES * DEFINES
...@@ -70,6 +71,7 @@ lv_obj_t * lv_ddlist_create(lv_obj_t * par, lv_obj_t * copy) ...@@ -70,6 +71,7 @@ lv_obj_t * lv_ddlist_create(lv_obj_t * par, lv_obj_t * copy)
ext->opened = 0; ext->opened = 0;
ext->auto_size = 0; ext->auto_size = 0;
ext->sel_opt = 0; ext->sel_opt = 0;
ext->num_opt = 0;
ext->anim_time = LV_DDLIST_DEF_ANIM_TIME; ext->anim_time = LV_DDLIST_DEF_ANIM_TIME;
ext->style_sel = lv_style_get(LV_STYLE_PLAIN_COLOR, NULL); ext->style_sel = lv_style_get(LV_STYLE_PLAIN_COLOR, NULL);
...@@ -83,7 +85,8 @@ lv_obj_t * lv_ddlist_create(lv_obj_t * par, lv_obj_t * copy) ...@@ -83,7 +85,8 @@ lv_obj_t * lv_ddlist_create(lv_obj_t * par, lv_obj_t * copy)
if(copy == NULL) { if(copy == NULL) {
lv_obj_t * scrl = lv_page_get_scrl(new_ddlist); lv_obj_t * scrl = lv_page_get_scrl(new_ddlist);
lv_obj_set_drag(scrl, false); lv_obj_set_drag(scrl, false);
lv_obj_set_style(scrl, lv_style_get(LV_STYLE_TRANSP, NULL)); lv_obj_set_style(scrl, lv_style_get(LV_STYLE_TRANSP, NULL));;
lv_cont_set_fit(scrl, true, true);
ext->opt_label = lv_label_create(new_ddlist, NULL); ext->opt_label = lv_label_create(new_ddlist, NULL);
lv_cont_set_fit(new_ddlist, true, false); lv_cont_set_fit(new_ddlist, true, false);
...@@ -129,7 +132,44 @@ bool lv_ddlist_signal(lv_obj_t * ddlist, lv_signal_t sign, void * param) ...@@ -129,7 +132,44 @@ bool lv_ddlist_signal(lv_obj_t * ddlist, lv_signal_t sign, void * param)
lv_ddlist_ext_t * ext = lv_obj_get_ext(ddlist); lv_ddlist_ext_t * ext = lv_obj_get_ext(ddlist);
lv_obj_set_style(ext->opt_label, lv_obj_get_style(ddlist)); lv_obj_set_style(ext->opt_label, lv_obj_get_style(ddlist));
lv_ddlist_refr_size(ddlist, 0); lv_ddlist_refr_size(ddlist, 0);
} } else if(sign == LV_SIGNAL_FOCUS) {
lv_ddlist_ext_t * ext = lv_obj_get_ext(ddlist);
if(ext->opened == false) {
ext->opened = true;
lv_ddlist_refr_size(ddlist, true);
}
} else if(sign == LV_SIGNAL_DEFOCUS) {
lv_ddlist_ext_t * ext = lv_obj_get_ext(ddlist);
if(ext->opened != false) {
ext->opened = false;
lv_ddlist_refr_size(ddlist, true);
}
} else if(sign == LV_SIGNAL_CONTROLL) {
lv_ddlist_ext_t * ext = lv_obj_get_ext(ddlist);
char c = *((char*)param);
if(c == LV_GROUP_KEY_RIGHT || c == LV_GROUP_KEY_DOWN) {
if(ext->sel_opt < ext->num_opt - 1) {
ext->sel_opt ++;
lv_obj_inv(ddlist);
if(ext->cb != NULL) {
ext->cb(ddlist, NULL);
}
}
} else if(c == LV_GROUP_KEY_LEFT || c == LV_GROUP_KEY_UP) {
if(ext->sel_opt > 0) {
ext->sel_opt --;
lv_obj_inv(ddlist);
if(ext->cb != NULL) {
ext->cb(ddlist, NULL);
}
}
} else if(c == LV_GROUP_KEY_ENTER || c == LV_GROUP_KEY_ESC) {
if(ext->opened != false) ext->opened = false;
if(ext->opened == false) ext->opened = true;
lv_ddlist_refr_size(ddlist, true);
}
}
} }
return valid; return valid;
...@@ -158,6 +198,8 @@ void lv_ddlist_set_options(lv_obj_t * ddlist, const char ** options) ...@@ -158,6 +198,8 @@ void lv_ddlist_set_options(lv_obj_t * ddlist, const char ** options)
i++; i++;
} }
ext->num_opt = i;
lv_ddlist_refr_size(ddlist, 0); lv_ddlist_refr_size(ddlist, 0);
} }
...@@ -169,6 +211,15 @@ void lv_ddlist_set_options(lv_obj_t * ddlist, const char ** options) ...@@ -169,6 +211,15 @@ void lv_ddlist_set_options(lv_obj_t * ddlist, const char ** options)
void lv_ddlist_set_options_str(lv_obj_t * ddlist, const char * options) void lv_ddlist_set_options_str(lv_obj_t * ddlist, const char * options)
{ {
lv_ddlist_ext_t * ext = lv_obj_get_ext(ddlist); lv_ddlist_ext_t * ext = lv_obj_get_ext(ddlist);
/*Count the '\n'-s to determine the number of options*/
ext->num_opt = 0;
uint16_t i;
for(i = 0; options[i] != '\0'; i++) {
if(options[i] == '\n') ext->num_opt++;
}
ext->num_opt++; /*Last option in the at row*/
lv_label_set_text(ext->opt_label, options); lv_label_set_text(ext->opt_label, options);
lv_ddlist_refr_size(ddlist, 0); lv_ddlist_refr_size(ddlist, 0);
} }
...@@ -358,7 +409,7 @@ static bool lv_ddlist_design(lv_obj_t * ddlist, const area_t * mask, lv_design_m ...@@ -358,7 +409,7 @@ static bool lv_ddlist_design(lv_obj_t * ddlist, const area_t * mask, lv_design_m
rect_area.y1 -= style->line_space / 2; rect_area.y1 -= style->line_space / 2;
rect_area.y2 = rect_area.y1 + font_h + style->line_space; rect_area.y2 = rect_area.y1 + font_h + style->line_space;
rect_area.x1 = ext->opt_label->cords.x1 - style_page_scrl->hpad; rect_area.x1 = ext->opt_label->cords.x1 - style->hpad;
rect_area.x2 = rect_area.x1 + lv_obj_get_width(lv_page_get_scrl(ddlist)); rect_area.x2 = rect_area.x1 + lv_obj_get_width(lv_page_get_scrl(ddlist));
lv_draw_rect(&rect_area, mask, ext->style_sel); lv_draw_rect(&rect_area, mask, ext->style_sel);
...@@ -417,7 +468,7 @@ static lv_action_res_t lv_ddlist_rel_action(lv_obj_t * ddlist, lv_dispi_t * disp ...@@ -417,7 +468,7 @@ static lv_action_res_t lv_ddlist_rel_action(lv_obj_t * ddlist, lv_dispi_t * disp
} }
/** /**
* Refresh the size of drop down list according its start (open or closed) * Refresh the size of drop down list according its status (open or closed)
* @param ddlist pointer to a drop down list object * @param ddlist pointer to a drop down list object
* @param anim_time animations time for open/close [ms] * @param anim_time animations time for open/close [ms]
*/ */
......
...@@ -43,7 +43,8 @@ typedef struct ...@@ -43,7 +43,8 @@ typedef struct
/*New data for this type */ /*New data for this type */
lv_obj_t * opt_label; /*Label for the options*/ lv_obj_t * opt_label; /*Label for the options*/
lv_style_t * style_sel; /*Style of the selected option*/ lv_style_t * style_sel; /*Style of the selected option*/
lv_action_t cb; /*Pointer to function to call when an option is slected*/ lv_action_t cb; /*Pointer to function to call when an option is selected*/
uint16_t num_opt; /*Number of options*/
uint16_t sel_opt; /*Index of the current option*/ uint16_t sel_opt; /*Index of the current option*/
uint16_t anim_time; /*Open/Close animation time [ms]*/ uint16_t anim_time; /*Open/Close animation time [ms]*/
uint8_t opened :1; /*1: The list is opened*/ uint8_t opened :1; /*1: The list is opened*/
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "misc/math/math_base.h" #include "misc/math/math_base.h"
#include "lv_label.h" #include "lv_label.h"
#include "../lv_obj/lv_obj.h" #include "../lv_obj/lv_obj.h"
#include "../lv_obj/lv_group.h"
#include "misc/gfx/text.h" #include "misc/gfx/text.h"
#include "misc/gfx/anim.h" #include "misc/gfx/anim.h"
#include "../lv_draw/lv_draw.h" #include "../lv_draw/lv_draw.h"
...@@ -468,11 +469,9 @@ uint16_t lv_label_get_letter_on(lv_obj_t * label, point_t * pos) ...@@ -468,11 +469,9 @@ uint16_t lv_label_get_letter_on(lv_obj_t * label, point_t * pos)
} }
x += (font_get_width(font, txt[i]) >> FONT_ANTIALIAS) + style->letter_space; x += (font_get_width(font, txt[i]) >> FONT_ANTIALIAS) + style->letter_space;
if(pos->x < x) break; if(pos->x < x) break;
} }
return i; return i;
} }
...@@ -496,11 +495,20 @@ static bool lv_label_design(lv_obj_t * label, const area_t * mask, lv_design_mod ...@@ -496,11 +495,20 @@ static bool lv_label_design(lv_obj_t * label, const area_t * mask, lv_design_mod
/* A label never covers an area */ /* A label never covers an area */
if(mode == LV_DESIGN_COVER_CHK) return false; if(mode == LV_DESIGN_COVER_CHK) return false;
else if(mode == LV_DESIGN_DRAW_MAIN) { else if(mode == LV_DESIGN_DRAW_MAIN) {
/*TEST: draw a background for the label*/ area_t cords;
lv_style_t * style = lv_obj_get_style(label);
lv_obj_get_cords(label, &cords);
#if LV_OBJ_GROUP != 0
lv_group_t * g = lv_obj_get_group(label);
if(lv_group_get_focused(g) == label) {
lv_draw_rect(&cords, mask, style);
}
#endif
/*TEST: draw a background for the label*/
//lv_vfill(&label->cords, mask, COLOR_LIME, OPA_COVER); //lv_vfill(&label->cords, mask, COLOR_LIME, OPA_COVER);
area_t cords;
lv_obj_get_cords(label, &cords);
lv_label_ext_t * ext = lv_obj_get_ext(label); lv_label_ext_t * ext = lv_obj_get_ext(label);
txt_flag_t flag = TXT_FLAG_NONE; txt_flag_t flag = TXT_FLAG_NONE;
if(ext->recolor != 0) flag |= TXT_FLAG_RECOLOR; if(ext->recolor != 0) flag |= TXT_FLAG_RECOLOR;
...@@ -512,7 +520,7 @@ static bool lv_label_design(lv_obj_t * label, const area_t * mask, lv_design_mod ...@@ -512,7 +520,7 @@ static bool lv_label_design(lv_obj_t * label, const area_t * mask, lv_design_mod
i++; i++;
} }
lv_draw_label(&cords, mask, lv_obj_get_style(label), ext->txt, flag, &ext->offset); lv_draw_label(&cords, mask, style, ext->txt, flag, &ext->offset);
} }
......
...@@ -48,7 +48,7 @@ typedef struct ...@@ -48,7 +48,7 @@ typedef struct
lv_label_long_mode_t long_mode; /*Determinate what to do with the long texts*/ lv_label_long_mode_t long_mode; /*Determinate what to do with the long texts*/
char dot_tmp[LV_LABEL_DOT_NUM + 1]; /*Store the character which are replaced by dots (Handled by the library)*/ char dot_tmp[LV_LABEL_DOT_NUM + 1]; /*Store the character which are replaced by dots (Handled by the library)*/
uint16_t dot_end; /*The text end position in dot mode (Handled by the library)*/ uint16_t dot_end; /*The text end position in dot mode (Handled by the library)*/
point_t offset; point_t offset; /*Text draw position offset*/
uint8_t static_txt :1; /*Flag to indicate the text is static*/ uint8_t static_txt :1; /*Flag to indicate the text is static*/
uint8_t recolor :1; /*Enable in-line letter re-coloring*/ uint8_t recolor :1; /*Enable in-line letter re-coloring*/
uint8_t expand :1; /*Force expand size when solving line length (used by the library with LV_LABEL_LONG_ROLL)*/ uint8_t expand :1; /*Force expand size when solving line length (used by the library with LV_LABEL_LONG_ROLL)*/
......
...@@ -142,6 +142,20 @@ void lv_list_set_style_img(lv_obj_t * list, lv_style_t * style); ...@@ -142,6 +142,20 @@ void lv_list_set_style_img(lv_obj_t * list, lv_style_t * style);
const char * lv_list_get_element_text(lv_obj_t * liste); const char * lv_list_get_element_text(lv_obj_t * liste);
/** /**
* Get the label object from a list element
* @param liste pointer to a list element (button)
* @return pointer to the label from the list element or NULL if not found
*/
lv_obj_t * lv_list_get_element_label(lv_obj_t * liste);
/**
* Get the image object from a list element
* @param liste pointer to a list element (button)
* @return pointer to the image from the list element or NULL if not found
*/
lv_obj_t * lv_list_get_element_img(lv_obj_t * liste);
/**
* Get the scroll bar outside attribute * Get the scroll bar outside attribute
* @param list pointer to list object * @param list pointer to list object
* @param en true: scroll bar outside the buttons, false: scroll bar inside * @param en true: scroll bar outside the buttons, false: scroll bar inside
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#if USE_LV_MBOX != 0 #if USE_LV_MBOX != 0
#include "lv_mbox.h" #include "lv_mbox.h"
#include "lvgl/lv_obj/lv_group.h"
#include "misc/gfx/anim.h" #include "misc/gfx/anim.h"
#include "misc/math/math_base.h" #include "misc/math/math_base.h"
...@@ -132,13 +133,11 @@ bool lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param) ...@@ -132,13 +133,11 @@ bool lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param)
area_get_height(param) != lv_obj_get_height(mbox)) { area_get_height(param) != lv_obj_get_height(mbox)) {
lv_mbox_realign(mbox); lv_mbox_realign(mbox);
} }
} } else if(sign == LV_SIGNAL_LONG_PRESS) {
else if(sign == LV_SIGNAL_LONG_PRESS) {
lv_mbox_start_auto_close(mbox, 0); lv_mbox_start_auto_close(mbox, 0);
lv_dispi_wait_release(param); lv_dispi_wait_release(param);
valid = false; valid = false;
} } else if(sign == LV_SIGNAL_STYLE_CHG) {
else if(sign == LV_SIGNAL_STYLE_CHG) {
/*Refresh all the buttons*/ /*Refresh all the buttons*/
if(ext->btnh != NULL) { if(ext->btnh != NULL) {
lv_obj_t * btn; lv_obj_t * btn;
...@@ -150,6 +149,90 @@ bool lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param) ...@@ -150,6 +149,90 @@ bool lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param)
btn = lv_obj_get_child(ext->btnh, btn); btn = lv_obj_get_child(ext->btnh, btn);
} }
} }
} else if(sign == LV_SIGNAL_FOCUS) {
/*Get the first button*/
if(ext->btnh != NULL) {
lv_obj_t * btn = NULL;
lv_obj_t * btn_prev = NULL;
btn = lv_obj_get_child(ext->btnh, btn);
while(btn != NULL) {
btn_prev = btn;
btn = lv_obj_get_child(ext->btnh, btn);
}
if(btn_prev != NULL) {
lv_btn_set_state(btn_prev, LV_BTN_STATE_PR);
}
}
} else if(sign == LV_SIGNAL_DEFOCUS) {
/*Get the 'pressed' button*/
if(ext->btnh != NULL) {
lv_obj_t * btn = NULL;
btn = lv_obj_get_child(ext->btnh, btn);
while(btn != NULL) {
if(lv_btn_get_state(btn) == LV_BTN_STATE_PR) break;
btn = lv_obj_get_child(ext->btnh, btn);
}
if(btn != NULL) {
lv_btn_set_state(btn, LV_BTN_STATE_REL);
}
}
} else if(sign == LV_SIGNAL_CONTROLL) {
lv_mbox_ext_t * ext = lv_obj_get_ext(mbox);
char c = *((char*)param);
if(c == LV_GROUP_KEY_RIGHT || c == LV_GROUP_KEY_UP) {
/*Get the last pressed button*/
if(ext->btnh != NULL) {
lv_obj_t * btn = NULL;
lv_obj_t * btn_prev = NULL;
btn = lv_obj_get_child(ext->btnh, btn);
while(btn != NULL) {
if(lv_btn_get_state(btn) == LV_BTN_STATE_PR) break;
btn_prev = btn;
btn = lv_obj_get_child(ext->btnh, btn);
}
if(btn_prev != NULL && btn != NULL) {
lv_btn_set_state(btn, LV_BTN_STATE_REL);
lv_btn_set_state(btn_prev, LV_BTN_STATE_PR);
}
}
} else if(c == LV_GROUP_KEY_LEFT || c == LV_GROUP_KEY_DOWN) {
/*Get the last pressed button*/
if(ext->btnh != NULL) {
lv_obj_t * btn = NULL;
btn = lv_obj_get_child(ext->btnh, btn);
while(btn != NULL) {
if(lv_btn_get_state(btn) == LV_BTN_STATE_PR) break;
btn = lv_obj_get_child(ext->btnh, btn);
}
if(btn != NULL) {
lv_obj_t * btn_prev = lv_obj_get_child(ext->btnh, btn);
if(btn_prev != NULL) {
lv_btn_set_state(btn, LV_BTN_STATE_REL);
lv_btn_set_state(btn_prev, LV_BTN_STATE_PR);
}
}
}
} else if(c == LV_GROUP_KEY_ENTER) {
/*Get the 'pressed' button*/
if(ext->btnh != NULL) {
lv_obj_t * btn = NULL;
btn = lv_obj_get_child(ext->btnh, btn);
while(btn != NULL) {
if(lv_btn_get_state(btn) == LV_BTN_STATE_PR) break;
btn = lv_obj_get_child(ext->btnh, btn);
}
if(btn != NULL) {
lv_action_t rel_action;
rel_action = lv_btn_get_rel_action(btn);
if(rel_action != NULL) rel_action(btn, NULL);
}
}
}
} }
} }
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#if USE_LV_SLIDER != 0 #if USE_LV_SLIDER != 0
#include "lv_slider.h" #include "lv_slider.h"
#include "lvgl/lv_obj/lv_group.h"
#include "misc/math/math_base.h" #include "misc/math/math_base.h"
#include "../lv_draw/lv_draw.h" #include "../lv_draw/lv_draw.h"
...@@ -52,7 +53,6 @@ static lv_design_f_t ancestor_design_f; ...@@ -52,7 +53,6 @@ static lv_design_f_t ancestor_design_f;
lv_obj_t * lv_slider_create(lv_obj_t * par, lv_obj_t * copy) lv_obj_t * lv_slider_create(lv_obj_t * par, lv_obj_t * copy)
{ {
/*Create the ancestor slider*/ /*Create the ancestor slider*/
/*TODO modify it to the ancestor create function */
lv_obj_t * new_slider = lv_bar_create(par, copy); lv_obj_t * new_slider = lv_bar_create(par, copy);
dm_assert(new_slider); dm_assert(new_slider);
...@@ -102,7 +102,6 @@ bool lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * param) ...@@ -102,7 +102,6 @@ bool lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * param)
bool valid; bool valid;
/* Include the ancient signal function */ /* Include the ancient signal function */
/* TODO update it to the ancestor's signal function*/
valid = lv_bar_signal(slider, sign, param); valid = lv_bar_signal(slider, sign, param);
/* The object can be deleted so check its validity and then /* The object can be deleted so check its validity and then
...@@ -145,10 +144,19 @@ bool lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * param) ...@@ -145,10 +144,19 @@ bool lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * param)
lv_obj_get_height(slider) != area_get_height(param)) { lv_obj_get_height(slider) != area_get_height(param)) {
slider->signal_f(slider, LV_SIGNAL_REFR_EXT_SIZE, NULL); slider->signal_f(slider, LV_SIGNAL_REFR_EXT_SIZE, NULL);
} }
} } else if(sign == LV_SIGNAL_REFR_EXT_SIZE) {
else if(sign == LV_SIGNAL_REFR_EXT_SIZE) {
cord_t x = MATH_MIN(w, h); cord_t x = MATH_MIN(w, h);
if(slider->ext_size < x) slider->ext_size = x; if(slider->ext_size < x) slider->ext_size = x;
} else if(sign == LV_SIGNAL_CONTROLL) {
lv_slider_ext_t * ext = lv_obj_get_ext(slider);
char c = *((char*)param);
if(c == LV_GROUP_KEY_RIGHT || c == LV_GROUP_KEY_UP) {
lv_bar_set_value(slider, lv_bar_get_value(slider) + 1);
if(ext->cb != NULL) ext->cb(slider, NULL);
} else if(c == LV_GROUP_KEY_LEFT || c == LV_GROUP_KEY_DOWN) {
lv_bar_set_value(slider, lv_bar_get_value(slider) - 1);
if(ext->cb != NULL) ext->cb(slider, NULL);
}
} }
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#if USE_LV_TA != 0 #if USE_LV_TA != 0
#include "lv_ta.h" #include "lv_ta.h"
#include "lvgl/lv_obj/lv_group.h"
#include "misc/gfx/anim.h" #include "misc/gfx/anim.h"
#include "../lv_draw/lv_draw.h" #include "../lv_draw/lv_draw.h"
...@@ -158,32 +159,37 @@ bool lv_ta_signal(lv_obj_t * ta, lv_signal_t sign, void * param) ...@@ -158,32 +159,37 @@ bool lv_ta_signal(lv_obj_t * ta, lv_signal_t sign, void * param)
if(valid != false) { if(valid != false) {
lv_ta_ext_t * ext = lv_obj_get_ext(ta); lv_ta_ext_t * ext = lv_obj_get_ext(ta);
lv_style_t * style = lv_obj_get_style(ta); lv_style_t * style = lv_obj_get_style(ta);
switch(sign) { if(sign == LV_SIGNAL_CLEANUP) {
case LV_SIGNAL_CLEANUP: /* Nothing to clean up.
/* Nothing to clean up. * (The created label will be deleted automatically) */
* (The created label will be deleted automatically) */ } else if(sign == LV_SIGNAL_STYLE_CHG) {
break; if(ext->label) {
case LV_SIGNAL_STYLE_CHG: lv_obj_set_style(ext->label, lv_obj_get_style(ext->page.scrl));
if(ext->label) { lv_obj_set_width(ext->label, lv_obj_get_width(ta) - 2 *
lv_obj_set_style(ext->label, lv_obj_get_style(ext->page.scrl)); (style->hpad + style->hpad));
lv_obj_set_width(ext->label, lv_obj_get_width(ta) - 2 * lv_label_set_text(ext->label, NULL);
(style->hpad + style->hpad)); }
lv_label_set_text(ext->label, NULL); } else if(sign == LV_SIGNAL_CORD_CHG) {
}
break;
/*Set the label width according to the text area width*/ /*Set the label width according to the text area width*/
case LV_SIGNAL_CORD_CHG: if(ext->label != NULL) {
if(ext->label != NULL) { lv_obj_set_width(ext->label, lv_obj_get_width(ta) - 2 *
lv_obj_set_width(ext->label, lv_obj_get_width(ta) - 2 * (style->hpad + style->hpad));
(style->hpad + style->hpad)); lv_label_set_text(ext->label, NULL);
lv_label_set_text(ext->label, NULL); }
} } else if (sign == LV_SIGNAL_CONTROLL) {
break; lv_ta_ext_t * ext = lv_obj_get_ext(ta);
default: char c = *((char*)param);
break; if(c == LV_GROUP_KEY_RIGHT) {
} lv_ta_cursor_right(ta);
} else if(c == LV_GROUP_KEY_LEFT) {
lv_ta_cursor_left(ta);
} else if(c == LV_GROUP_KEY_UP) {
lv_ta_cursor_up(ta);
} else if(c == LV_GROUP_KEY_DOWN) {
lv_ta_cursor_down(ta);
}
}
} }
return valid; return valid;
} }
......
...@@ -16,23 +16,8 @@ extern "C" { ...@@ -16,23 +16,8 @@ extern "C" {
/*Test misc. module version*/ /*Test misc. module version*/
#include "misc/misc.h" #include "misc/misc.h"
#define LV_MISC_REQ_MAJOR 4
#define LV_MISC_REQ_MINOR 1
#define LV_MISC_REQ_PATCH 1
#if MISC_VERSION_MAJOR != LV_MISC_REQ_MAJOR /*The version major has to match*/
#error "LV: incompatible misc. module version! See lvgl.h"
#endif
#if MISC_VERSION_MINOR < LV_MISC_REQ_MINOR /*The version minor has to be the same or greater*/
#error "LV: incompatible misc. module version! See lvgl.h"
#endif
#if MISC_VERSION_PATCH < LV_MISC_REQ_PATCH /*The version patch has to be the same or greater*/
#error "LV: incompatible misc. module version! See lvgl.h"
#endif
#include "lv_obj/lv_obj.h" #include "lv_obj/lv_obj.h"
#include "lv_obj/lv_group.h"
#include "lv_objx/lv_btn.h" #include "lv_objx/lv_btn.h"
#include "lv_objx/lv_img.h" #include "lv_objx/lv_img.h"
#include "lv_objx/lv_label.h" #include "lv_objx/lv_label.h"
...@@ -58,10 +43,27 @@ extern "C" { ...@@ -58,10 +43,27 @@ extern "C" {
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
/*Current version of LittlevGL*/
#define LVGL_VERSION_MAJOR 4 #define LVGL_VERSION_MAJOR 4
#define LVGL_VERSION_MINOR 1 #define LVGL_VERSION_MINOR 1
#define LVGL_VERSION_PATH 0 #define LVGL_VERSION_PATH 1
/*Required misc. library version*/
#define LV_MISC_REQ_MAJOR 4
#define LV_MISC_REQ_MINOR 1
#define LV_MISC_REQ_PATCH 0
#if MISC_VERSION_MAJOR != LV_MISC_REQ_MAJOR /*The version major has to match*/
#error "LV: incompatible misc. module version! See lvgl.h"
#endif
#if MISC_VERSION_MINOR < LV_MISC_REQ_MINOR /*The version minor has to be the same or greater*/
#error "LV: incompatible misc. module version! See lvgl.h"
#endif
#if MISC_VERSION_PATCH < LV_MISC_REQ_PATCH /*The version patch has to be the same or greater*/
#error "LV: incompatible misc. module version! See lvgl.h"
#endif
/********************** /**********************
* TYPEDEFS * TYPEDEFS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment