add LV_EVENT_DELETE
This commit is contained in:
@@ -1114,6 +1114,8 @@ static void indev_drag(lv_indev_proc_t * state)
|
||||
if(state->types.pointer.drag_in_prog == 0) {
|
||||
drag_obj->signal_cb(drag_obj, LV_SIGNAL_DRAG_BEGIN, indev_act);
|
||||
if(state->reset_query != 0) return;
|
||||
lv_event_send(drag_obj, LV_EVENT_DRAG_BEGIN, NULL);
|
||||
if(state->reset_query) return; /*The object might be deleted*/
|
||||
}
|
||||
|
||||
state->types.pointer.drag_in_prog = 1;
|
||||
|
||||
@@ -379,7 +379,7 @@ lv_res_t lv_obj_del(lv_obj_t * obj)
|
||||
|
||||
if(event_act_obj == obj && event_act_obj_deleted == false) event_act_obj_deleted = true;
|
||||
|
||||
/*Delete from the group*/
|
||||
/*Delete from the group*/
|
||||
#if LV_USE_GROUP
|
||||
bool was_focused = false;
|
||||
lv_group_t * group = lv_obj_get_group(obj);
|
||||
@@ -410,6 +410,9 @@ lv_res_t lv_obj_del(lv_obj_t * obj)
|
||||
i = i_next;
|
||||
}
|
||||
|
||||
/*Let the suer free the resources used in `LV_EVENT_DELETE`*/
|
||||
lv_event_send(obj, LV_EVENT_DELETE, NULL);
|
||||
|
||||
/*Remove the object from parent's children list*/
|
||||
lv_obj_t * par = lv_obj_get_parent(obj);
|
||||
if(par == NULL) { /*It is a screen*/
|
||||
@@ -2202,6 +2205,9 @@ static void delete_children(lv_obj_t * obj)
|
||||
i = i_next;
|
||||
}
|
||||
|
||||
/*Let the suer free the resources used in `LV_EVENT_DELETE`*/
|
||||
lv_event_send(obj, LV_EVENT_DELETE, NULL);
|
||||
|
||||
/*Remove the animations from this object*/
|
||||
#if LV_USE_ANIMATION
|
||||
lv_anim_del(obj, NULL);
|
||||
|
||||
@@ -98,6 +98,7 @@ enum {
|
||||
LV_EVENT_REFRESH,
|
||||
LV_EVENT_APPLY, /*"Ok", "Apply" or similar specific button has clicked*/
|
||||
LV_EVENT_CANCEL, /*"Close", "Cancel" or similar specific button has clicked*/
|
||||
LV_EVENT_DELETE,
|
||||
};
|
||||
typedef uint8_t lv_event_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user