Btnm optimalized by using of 'virtual buttons'

This commit is contained in:
Gabor
2016-12-19 11:57:42 +01:00
parent 39527964bc
commit 2d5366ee09
2 changed files with 139 additions and 66 deletions

View File

@@ -42,9 +42,9 @@ typedef enum
}lv_btnms_builtin_t;
/* Type of callback function which is called when a button is released
* Parameters: button matrix, released object, button index in the map string
* Parameters: button matrix, released button index in the map string
* return false: the released button or the button matrix is deleted else true*/
typedef bool (*lv_btnm_callback_t) (lv_obj_t *, lv_obj_t *, uint8_t);
typedef lv_action_res_t (*lv_btnm_callback_t) (lv_obj_t *, uint16_t);
/*Data of button matrix*/
typedef struct
@@ -52,6 +52,9 @@ typedef struct
lv_rect_ext_t rect; /*Ext. of ancestor*/
/*New data for this type */
const char ** map_p; /*Pointer to the current map*/
area_t * btn_areas;
uint16_t btn_cnt;
uint16_t btn_pr;
lv_btnm_callback_t cb;
}lv_btnm_ext_t;