What is LV_STATE_EDITED for masbox

I don’t know what this code means In lv_msgbox_add_btns functions:

    if(lv_obj_is_focused(mbox)) {
        lv_state_t state = lv_obj_get_state(mbox, LV_MSGBOX_PART_BG);
        if(state & LV_STATE_EDITED) {
            lv_obj_set_state(ext->btnm, LV_STATE_FOCUSED | LV_STATE_EDITED);
        }
        else {
            lv_obj_set_state(ext->btnm, LV_STATE_FOCUSED);
        }

        lv_btnmatrix_set_focused_btn(ext->btnm, 0);
    }

Can you help me, thanks

if(lv_obj_is_focused(mbox)) {

Is the message bux focused now?

   lv_state_t state = lv_obj_get_state(mbox, LV_MSGBOX_PART_BG);
   if(state & LV_STATE_EDITED) {

Is it in edited state (possible when used with an encoder)

        lv_obj_set_state(ext->btnm, LV_STATE_FOCUSED | LV_STATE_EDITED);
   }

If edit propagate the focused and edited state to its button matrix in order to make the buttons highlighted.

   else {
      lv_obj_set_state(ext->btnm, LV_STATE_FOCUSED);
 }

If not edited propagate only the focused state.

   lv_btnmatrix_set_focused_btn(ext->btnm, 0);

}

Make the first button focused by deafult?

1 Like

Thank you very much.