mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
fix(examples) use type-safe function for retrieving event param
Fixes #3364
This commit is contained in:
parent
276f28a8a2
commit
71d535defd
@ -8,7 +8,7 @@ static void set_value(void * bar, int32_t v)
|
||||
|
||||
static void event_cb(lv_event_t * e)
|
||||
{
|
||||
lv_obj_draw_part_dsc_t * dsc = lv_event_get_param(e);
|
||||
lv_obj_draw_part_dsc_t * dsc = lv_event_get_draw_part_dsc(e);
|
||||
if(dsc->part != LV_PART_INDICATOR) return;
|
||||
|
||||
lv_obj_t * obj = lv_event_get_target(e);
|
||||
|
@ -7,7 +7,7 @@ static void event_cb(lv_event_t * e)
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
lv_obj_t * obj = lv_event_get_target(e);
|
||||
if(code == LV_EVENT_DRAW_PART_BEGIN) {
|
||||
lv_obj_draw_part_dsc_t * dsc = lv_event_get_param(e);
|
||||
lv_obj_draw_part_dsc_t * dsc = lv_event_get_draw_part_dsc(e);
|
||||
|
||||
/*Change the draw descriptor the 2nd button*/
|
||||
if(dsc->id == 1) {
|
||||
@ -34,7 +34,7 @@ static void event_cb(lv_event_t * e)
|
||||
}
|
||||
}
|
||||
if(code == LV_EVENT_DRAW_PART_END) {
|
||||
lv_obj_draw_part_dsc_t * dsc = lv_event_get_param(e);
|
||||
lv_obj_draw_part_dsc_t * dsc = lv_event_get_draw_part_dsc(e);
|
||||
|
||||
/*Add custom content to the 4th button when the button itself was drawn*/
|
||||
if(dsc->id == 3) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
static void draw_part_event_cb(lv_event_t * e)
|
||||
{
|
||||
lv_obj_t * obj = lv_event_get_target(e);
|
||||
lv_obj_draw_part_dsc_t * dsc = lv_event_get_param(e);
|
||||
lv_obj_draw_part_dsc_t * dsc = lv_event_get_draw_part_dsc(e);
|
||||
/*If the cells are drawn...*/
|
||||
if(dsc->part == LV_PART_ITEMS) {
|
||||
uint32_t row = dsc->id / lv_table_get_col_cnt(obj);
|
||||
|
Loading…
x
Reference in New Issue
Block a user