Lines Matching refs:mbox

37 static lv_res_t lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param);
38 static void mbox_realign(lv_obj_t * mbox);
42 static void lv_mbox_default_event_cb(lv_obj_t * mbox, lv_event_t event);
106 lv_mbox_set_style(new_mbox, LV_MBOX_STYLE_BG, th->style.mbox.bg); in lv_mbox_create()
140 void lv_mbox_add_btns(lv_obj_t * mbox, const char ** btn_map) in lv_mbox_add_btns() argument
142 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in lv_mbox_add_btns()
146 ext->btnm = lv_btnm_create(mbox, NULL); in lv_mbox_add_btns()
151 lv_mbox_set_style(mbox, LV_MBOX_STYLE_BTN_BG, th->style.mbox.btn.bg); in lv_mbox_add_btns()
152 lv_mbox_set_style(mbox, LV_MBOX_STYLE_BTN_REL, th->style.mbox.btn.rel); in lv_mbox_add_btns()
153 lv_mbox_set_style(mbox, LV_MBOX_STYLE_BTN_PR, th->style.mbox.btn.pr); in lv_mbox_add_btns()
163 mbox_realign(mbox); in lv_mbox_add_btns()
175 void lv_mbox_set_text(lv_obj_t * mbox, const char * txt) in lv_mbox_set_text() argument
177 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in lv_mbox_set_text()
180 mbox_realign(mbox); in lv_mbox_set_text()
188 void lv_mbox_set_anim_time(lv_obj_t * mbox, uint16_t anim_time) in lv_mbox_set_anim_time() argument
191 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in lv_mbox_set_anim_time()
195 (void)mbox; in lv_mbox_set_anim_time()
205 void lv_mbox_start_auto_close(lv_obj_t * mbox, uint16_t delay) in lv_mbox_start_auto_close() argument
208 if(lv_mbox_get_anim_time(mbox) != 0) { in lv_mbox_start_auto_close()
211 a.var = mbox; in lv_mbox_start_auto_close()
212 a.start = lv_obj_get_height(mbox); in lv_mbox_start_auto_close()
218 a.time = lv_mbox_get_anim_time(mbox); in lv_mbox_start_auto_close()
225 a.start = lv_obj_get_width(mbox); in lv_mbox_start_auto_close()
231 lv_cont_set_fit(mbox, LV_FIT_NONE); in lv_mbox_start_auto_close()
235 a.var = mbox; in lv_mbox_start_auto_close()
251 lv_obj_del(mbox); in lv_mbox_start_auto_close()
259 void lv_mbox_stop_auto_close(lv_obj_t * mbox) in lv_mbox_stop_auto_close() argument
262 lv_anim_del(mbox, NULL); in lv_mbox_stop_auto_close()
264 (void)mbox; /*Unused*/ in lv_mbox_stop_auto_close()
274 void lv_mbox_set_style(lv_obj_t * mbox, lv_mbox_style_t type, const lv_style_t * style) in lv_mbox_set_style() argument
276 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in lv_mbox_set_style()
279 case LV_MBOX_STYLE_BG: lv_obj_set_style(mbox, style); break; in lv_mbox_set_style()
288 mbox_realign(mbox); in lv_mbox_set_style()
296 void lv_mbox_set_recolor(lv_obj_t * mbox, bool en) in lv_mbox_set_recolor() argument
298 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in lv_mbox_set_recolor()
312 const char * lv_mbox_get_text(const lv_obj_t * mbox) in lv_mbox_get_text() argument
314 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in lv_mbox_get_text()
325 uint16_t lv_mbox_get_active_btn(lv_obj_t * mbox) in lv_mbox_get_active_btn() argument
327 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in lv_mbox_get_active_btn()
340 const char * lv_mbox_get_active_btn_text(lv_obj_t * mbox) in lv_mbox_get_active_btn_text() argument
342 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in lv_mbox_get_active_btn_text()
354 uint16_t lv_mbox_get_anim_time(const lv_obj_t * mbox) in lv_mbox_get_anim_time() argument
357 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in lv_mbox_get_anim_time()
360 (void)mbox; in lv_mbox_get_anim_time()
371 const lv_style_t * lv_mbox_get_style(const lv_obj_t * mbox, lv_mbox_style_t type) in lv_mbox_get_style() argument
374 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in lv_mbox_get_style()
377 case LV_MBOX_STYLE_BG: style = lv_obj_get_style(mbox); break; in lv_mbox_get_style()
395 bool lv_mbox_get_recolor(const lv_obj_t * mbox) in lv_mbox_get_recolor() argument
397 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in lv_mbox_get_recolor()
410 lv_obj_t * lv_mbox_get_btnm(lv_obj_t * mbox) in lv_mbox_get_btnm() argument
412 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in lv_mbox_get_btnm()
427 static lv_res_t lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param) in lv_mbox_signal() argument
442 res = ancestor_signal(mbox, sign, param); in lv_mbox_signal()
445 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in lv_mbox_signal()
447 if(lv_obj_get_width(mbox) != lv_area_get_width(param)) { in lv_mbox_signal()
448 mbox_realign(mbox); in lv_mbox_signal()
451 mbox_realign(mbox); in lv_mbox_signal()
455 if(btn_id != LV_BTNM_BTN_NONE) lv_event_send(mbox, LV_EVENT_VALUE_CHANGED, &btn_id); in lv_mbox_signal()
472 if(lv_group_get_editing(lv_obj_get_group(mbox))) in lv_mbox_signal()
495 static void mbox_realign(lv_obj_t * mbox) in mbox_realign() argument
497 lv_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox); in mbox_realign()
499 const lv_style_t * style = lv_mbox_get_style(mbox, LV_MBOX_STYLE_BG); in mbox_realign()
500 …lv_coord_t w = lv_obj_get_width(mbox) - style->body.padding.left - style->body.padding… in mbox_realign()
507 const lv_style_t * btn_bg_style = lv_mbox_get_style(mbox, LV_MBOX_STYLE_BTN_BG); in mbox_realign()
508 const lv_style_t * btn_rel_style = lv_mbox_get_style(mbox, LV_MBOX_STYLE_BTN_REL); in mbox_realign()
523 static void lv_mbox_default_event_cb(lv_obj_t * mbox, lv_event_t event) in lv_mbox_default_event_cb() argument
527 uint32_t btn_id = lv_mbox_get_active_btn(mbox); in lv_mbox_default_event_cb()
530 lv_mbox_start_auto_close(mbox, 0); in lv_mbox_default_event_cb()
535 lv_obj_t * mbox = lv_obj_get_parent(btnm); in lv_mbox_btnm_event_cb() local
542 lv_event_send(mbox, event, lv_event_get_data()); in lv_mbox_btnm_event_cb()