LV_EVENT_SELECT: send ID instead of text
This commit is contained in:
@@ -704,7 +704,8 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
||||
button_is_inactive(ext->ctrl_bits[ext->btn_id_act]) == false &&
|
||||
button_is_hidden(ext->ctrl_bits[ext->btn_id_act]) == false)
|
||||
{
|
||||
lv_event_send(btnm, LV_EVENT_SELECTED, lv_btnm_get_active_btn_text(btnm));
|
||||
uint32_t b = ext->btn_id_act;
|
||||
lv_event_send(btnm, LV_EVENT_SELECTED, &b);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -720,7 +721,8 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
||||
invalidate_button_area(btnm, ext->btn_id_pr);
|
||||
}
|
||||
if(btn_pr != LV_BTNM_BTN_NONE) {
|
||||
if(btn_pr != LV_BTNM_BTN_NONE) lv_event_send(btnm, LV_EVENT_SELECTED, ext->map_p[btn_pr]);
|
||||
uint32_t b = ext->btn_id_act;
|
||||
lv_event_send(btnm, LV_EVENT_SELECTED, &b);
|
||||
invalidate_button_area(btnm, btn_pr);
|
||||
}
|
||||
}
|
||||
@@ -756,7 +758,8 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
||||
button_is_inactive(ext->ctrl_bits[ext->btn_id_act]) == false &&
|
||||
button_is_hidden(ext->ctrl_bits[ext->btn_id_act]) == false)
|
||||
{
|
||||
lv_event_send(btnm, LV_EVENT_SELECTED, lv_btnm_get_active_btn_text(btnm));
|
||||
uint32_t b = ext->btn_id_act;
|
||||
lv_event_send(btnm, LV_EVENT_SELECTED, &b);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -767,7 +770,8 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
||||
button_is_inactive(ext->ctrl_bits[ext->btn_id_act]) == false &&
|
||||
button_is_hidden(ext->ctrl_bits[ext->btn_id_act]) == false)
|
||||
{
|
||||
lv_event_send(btnm, LV_EVENT_SELECTED, lv_btnm_get_active_btn_text(btnm));
|
||||
uint32_t b = ext->btn_id_act;
|
||||
lv_event_send(btnm, LV_EVENT_SELECTED, &b);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ static void lv_kb_def_btn_action_cb(lv_obj_t * kb);
|
||||
static lv_signal_cb_t ancestor_signal;
|
||||
|
||||
static const char * kb_map_lc[] = {
|
||||
"#", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "Bksp", "\n",
|
||||
"1#", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "Bksp", "\n",
|
||||
"ABC", "a", "s", "d", "f", "g", "h", "j", "k", "l", "Enter", "\n",
|
||||
"_", "-", "z", "x", "c", "v", "b", "n", "m", ".", ",", ":", "\n",
|
||||
LV_SYMBOL_CLOSE, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, ""
|
||||
@@ -47,7 +47,7 @@ static const lv_btnm_ctrl_t kb_ctrl_lc_map[] = {
|
||||
};
|
||||
|
||||
static const char * kb_map_uc[] = {
|
||||
"#", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "Bksp", "\n",
|
||||
"1#", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "Bksp", "\n",
|
||||
"abc", "A", "S", "D", "F", "G", "H", "J", "K", "L", "Enter", "\n",
|
||||
"_", "-", "Z", "X", "C", "V", "B", "N", "M", ".", ",", ":", "\n",
|
||||
LV_SYMBOL_CLOSE, LV_SYMBOL_LEFT, " ", LV_SYMBOL_RIGHT, LV_SYMBOL_OK, ""
|
||||
|
||||
@@ -443,7 +443,7 @@ static lv_res_t lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param)
|
||||
}
|
||||
else if(sign == LV_SIGNAL_RELEASED) {
|
||||
uint16_t btn_id = lv_btnm_get_active_btn(ext->btnm);
|
||||
if(btn_id != LV_BTNM_BTN_NONE) lv_event_send(mbox, LV_EVENT_SELECTED, lv_btnm_get_btn_text(ext->btnm, btn_id));
|
||||
if(btn_id != LV_BTNM_BTN_NONE) lv_event_send(mbox, LV_EVENT_SELECTED, &btn_id);
|
||||
}
|
||||
else if(sign == LV_SIGNAL_FOCUS || sign == LV_SIGNAL_DEFOCUS ||
|
||||
sign == LV_SIGNAL_CONTROL || sign == LV_SIGNAL_GET_EDITABLE) {
|
||||
|
||||
@@ -276,7 +276,7 @@ void lv_tabview_set_tab_act(lv_obj_t * tabview, uint16_t id, bool anim_en)
|
||||
lv_res_t res = LV_RES_OK;
|
||||
if(id >= ext->tab_cnt) id = ext->tab_cnt - 1;
|
||||
|
||||
if(id != ext->tab_cur) res = lv_event_send(tabview, LV_EVENT_SELECTED, lv_btnm_get_btn_text(ext->btns, id));
|
||||
if(id != ext->tab_cur) res = lv_event_send(tabview, LV_EVENT_SELECTED, &id);
|
||||
if(res != LV_RES_OK) return;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user