lv_mbox: start/stop auto close added

This commit is contained in:
Gabor
2017-01-16 12:41:21 +01:00
parent 2cb9d8ed83
commit 22f1a01b1c
3 changed files with 20 additions and 5 deletions

View File

@@ -156,13 +156,13 @@ bool lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param)
}
break;
case LV_SIGNAL_LONG_PRESS:
case LV_SIGNAL_RELEASED:
#if LV_MBOX_ANIM_TIME != 0
lv_mbox_auto_close(mbox, 0);
lv_mbox_start_auto_close(mbox, 0);
#else
lv_obj_del(mbox);
valid = false;
#endif
lv_dispi_wait_release(param);
break;
case LV_SIGNAL_STYLE_CHG:
lv_obj_set_style(ext->title, &style->title);
@@ -289,7 +289,7 @@ lv_action_res_t lv_mbox_close_action(lv_obj_t * btn, lv_dispi_t * dispi)
* @param mbox pointer to a message box object
* @param tout a time (in milliseconds) to wait before delete the message box
*/
void lv_mbox_auto_close(lv_obj_t * mbox, uint16_t tout)
void lv_mbox_start_auto_close(lv_obj_t * mbox, uint16_t tout)
{
#if LV_MBOX_ANIM_TIME != 0
/*Add shrinking animations*/
@@ -304,6 +304,15 @@ void lv_mbox_auto_close(lv_obj_t * mbox, uint16_t tout)
#endif
}
/**
* Stop the auto. closing of message box
* @param mbox pointer to a message box object
*/
void lv_mbox_stop_auto_close(lv_obj_t * mbox)
{
anim_del(mbox, NULL);
}
/*=====================
* Getter functions
*====================*/

View File

@@ -128,7 +128,13 @@ lv_action_res_t lv_mbox_close_action(lv_obj_t * btn, lv_dispi_t * dispi);
* @param mbox pointer to a message box object
* @param tout a time (in milliseconds) to wait before delete the message box
*/
void lv_mbox_auto_close(lv_obj_t * mbox, uint16_t tout);
void lv_mbox_start_auto_close(lv_obj_t * mbox, uint16_t tout);
/**
* Stop the auto. closing of message box
* @param mbox pointer to a message box object
*/
void lv_mbox_stop_auto_close(lv_obj_t * mbox);
/**
* get the title of the message box