Lines Matching refs:roller

101     lv_roller_t * roller = (lv_roller_t *)obj;  in lv_roller_set_options()  local
104 roller->sel_opt_id = 0; in lv_roller_set_options()
105 roller->sel_opt_id_ori = 0; in lv_roller_set_options()
108 roller->option_cnt = 0; in lv_roller_set_options()
111 if(options[cnt] == '\n') roller->option_cnt++; in lv_roller_set_options()
113 roller->option_cnt++; /*Last option has no `\n`*/ in lv_roller_set_options()
116 roller->mode = LV_ROLLER_MODE_NORMAL; in lv_roller_set_options()
120 roller->mode = LV_ROLLER_MODE_INFINITE; in lv_roller_set_options()
133 roller->sel_opt_id = ((LV_ROLLER_INF_PAGES / 2) + 0) * roller->option_cnt; in lv_roller_set_options()
135 roller->option_cnt = roller->option_cnt * LV_ROLLER_INF_PAGES; in lv_roller_set_options()
139 roller->sel_opt_id_ori = roller->sel_opt_id; in lv_roller_set_options()
160 lv_roller_t * roller = (lv_roller_t *)obj; in lv_roller_set_selected() local
163 if(roller->mode == LV_ROLLER_MODE_INFINITE) { in lv_roller_set_selected()
164 uint32_t real_option_cnt = roller->option_cnt / LV_ROLLER_INF_PAGES; in lv_roller_set_selected()
165 uint16_t current_page = roller->sel_opt_id / real_option_cnt; in lv_roller_set_selected()
169 uint16_t act_opt = roller->sel_opt_id - current_page * real_option_cnt; in lv_roller_set_selected()
180 roller->sel_opt_id = sel_opt < roller->option_cnt ? sel_opt : roller->option_cnt - 1; in lv_roller_set_selected()
181 roller->sel_opt_id_ori = roller->sel_opt_id; in lv_roller_set_selected()
214 lv_roller_t * roller = (lv_roller_t *)obj; in lv_roller_get_selected() local
215 if(roller->mode == LV_ROLLER_MODE_INFINITE) { in lv_roller_get_selected()
216 uint16_t real_id_cnt = roller->option_cnt / LV_ROLLER_INF_PAGES; in lv_roller_get_selected()
217 return roller->sel_opt_id % real_id_cnt; in lv_roller_get_selected()
220 return roller->sel_opt_id; in lv_roller_get_selected()
234 lv_roller_t * roller = (lv_roller_t *)obj; in lv_roller_get_selected_str() local
241 for(i = 0; i < txt_len && line != roller->sel_opt_id; i++) { in lv_roller_get_selected_str()
278 lv_roller_t * roller = (lv_roller_t *)obj; in lv_roller_get_option_cnt() local
279 if(roller->mode == LV_ROLLER_MODE_INFINITE) { in lv_roller_get_option_cnt()
280 return roller->option_cnt / LV_ROLLER_INF_PAGES; in lv_roller_get_option_cnt()
283 return roller->option_cnt; in lv_roller_get_option_cnt()
294 lv_roller_t * roller = (lv_roller_t *)obj; in lv_roller_constructor() local
296 roller->mode = LV_ROLLER_MODE_NORMAL; in lv_roller_constructor()
297 roller->option_cnt = 0; in lv_roller_constructor()
298 roller->sel_opt_id = 0; in lv_roller_constructor()
299 roller->sel_opt_id_ori = 0; in lv_roller_constructor()
324 lv_roller_t * roller = (lv_roller_t *)obj; in lv_roller_event() local
341 roller->moved = 0; in lv_roller_event()
351 roller->moved = 1; in lv_roller_event()
366 if(roller->sel_opt_id != roller->sel_opt_id_ori) { in lv_roller_event()
367 roller->sel_opt_id = roller->sel_opt_id_ori; in lv_roller_event()
373 roller->sel_opt_id_ori = roller->sel_opt_id; in lv_roller_event()
377roller->sel_opt_id_ori = roller->sel_opt_id; /*Save the current value. Used to revert this state if in lv_roller_event()
383 if(roller->sel_opt_id != roller->sel_opt_id_ori) { in lv_roller_event()
384 roller->sel_opt_id = roller->sel_opt_id_ori; in lv_roller_event()
391 if(roller->sel_opt_id + 1 < roller->option_cnt) { in lv_roller_event()
392 … uint16_t ori_id = roller->sel_opt_id_ori; /*lv_roller_set_selected will overwrite this*/ in lv_roller_event()
393 lv_roller_set_selected(obj, roller->sel_opt_id + 1, LV_ANIM_ON); in lv_roller_event()
394 roller->sel_opt_id_ori = ori_id; in lv_roller_event()
398 if(roller->sel_opt_id > 0) { in lv_roller_event()
399 … uint16_t ori_id = roller->sel_opt_id_ori; /*lv_roller_set_selected will overwrite this*/ in lv_roller_event()
401 lv_roller_set_selected(obj, roller->sel_opt_id - 1, LV_ANIM_ON); in lv_roller_event()
402 roller->sel_opt_id_ori = ori_id; in lv_roller_event()
525 lv_obj_t * roller = lv_obj_get_parent(label_obj); in draw_label() local
528 lv_obj_init_draw_label_dsc(roller, LV_PART_MAIN, &label_draw_dsc); in draw_label()
538 if(!_lv_area_intersect(&roller_clip_area, draw_ctx->clip_area, &roller->coords)) return; in draw_label()
542 get_sel_area(roller, &sel_area); in draw_label()
613 lv_roller_t * roller = (lv_roller_t *)obj; in refr_position() local
626 int32_t id = roller->sel_opt_id; in refr_position()
655 lv_roller_t * roller = (lv_roller_t *)obj; in release_handler() local
660 roller->sel_opt_id_ori = roller->sel_opt_id; in release_handler()
673 if(roller->moved == 0) { in release_handler()
707 if(id >= roller->option_cnt) id = roller->option_cnt - 1; in release_handler()
717 uint32_t id = roller->sel_opt_id; /*Just to use uint32_t in event data*/ in release_handler()
728 lv_roller_t * roller = (lv_roller_t *)obj; in inf_normalize() local
730 if(roller->mode == LV_ROLLER_MODE_INFINITE) { in inf_normalize()
731 uint16_t real_id_cnt = roller->option_cnt / LV_ROLLER_INF_PAGES; in inf_normalize()
732 roller->sel_opt_id = roller->sel_opt_id % real_id_cnt; in inf_normalize()
733 roller->sel_opt_id += (LV_ROLLER_INF_PAGES / 2) * real_id_cnt; /*Select the middle page*/ in inf_normalize()
735 roller->sel_opt_id_ori = roller->sel_opt_id % real_id_cnt; in inf_normalize()
736roller->sel_opt_id_ori += (LV_ROLLER_INF_PAGES / 2) * real_id_cnt; /*Select the middle page*/ in inf_normalize()
746 lv_coord_t sel_y1 = roller->sel_opt_id * (font_h + line_space); in inf_normalize()