Lines Matching full:if
13 #if LV_USE_DROPDOWN != 0
65 #if LV_USE_OBJ_PROPERTY
126 #if LV_USE_OBJ_PROPERTY
132 #if LV_USE_OBJ_PROPERTY_NAME
172 if(dropdown->text == txt) return; in lv_dropdown_set_text()
190 if(options[i] == '\n') dropdown->option_cnt++; in lv_dropdown_set_options()
197 #if LV_USE_ARABIC_PERSIAN_CHARS == 0 in lv_dropdown_set_options()
203 if(dropdown->options != NULL && dropdown->static_txt == 0) { in lv_dropdown_set_options()
211 if(dropdown->options == NULL) return; in lv_dropdown_set_options()
213 #if LV_USE_ARABIC_PERSIAN_CHARS == 0 in lv_dropdown_set_options()
223 if(dropdown->list) lv_obj_invalidate(dropdown->list); in lv_dropdown_set_options()
237 if(options[i] == '\n') dropdown->option_cnt++; in lv_dropdown_set_options_static()
243 if(dropdown->static_txt == 0 && dropdown->options != NULL) { in lv_dropdown_set_options_static()
252 if(dropdown->list) lv_obj_invalidate(dropdown->list); in lv_dropdown_set_options_static()
263 if(dropdown->static_txt != 0) { in lv_dropdown_add_option()
267 if(dropdown->options == NULL) return; in lv_dropdown_add_option()
273 #if LV_USE_ARABIC_PERSIAN_CHARS == 0 in lv_dropdown_add_option()
282 if(dropdown->options == NULL) return; in lv_dropdown_add_option()
288 if(pos != LV_DROPDOWN_POS_LAST) { in lv_dropdown_add_option()
291 if(opcnt == pos) in lv_dropdown_add_option()
293 if(dropdown->options[insert_pos] == '\n') in lv_dropdown_add_option()
299 if((insert_pos > 0) && (pos >= dropdown->option_cnt)) in lv_dropdown_add_option()
302 /*Insert the new option, adding \n if necessary*/ in lv_dropdown_add_option()
305 if(ins_buf == NULL) return; in lv_dropdown_add_option()
306 #if LV_USE_ARABIC_PERSIAN_CHARS == 0 in lv_dropdown_add_option()
311 if(pos < dropdown->option_cnt) lv_strcat(ins_buf, "\n"); in lv_dropdown_add_option()
319 if(dropdown->list) lv_obj_invalidate(dropdown->list); in lv_dropdown_add_option()
326 if(dropdown->options == NULL) return; in lv_dropdown_clear_options()
328 if(dropdown->static_txt == 0) in lv_dropdown_clear_options()
336 if(dropdown->list) lv_obj_invalidate(dropdown->list); in lv_dropdown_clear_options()
344 if(dropdown->sel_opt_id == sel_opt) return; in lv_dropdown_set_selected()
349 if(dropdown->list) { in lv_dropdown_set_selected()
361 if(dropdown->dir == dir) return; in lv_dropdown_set_dir()
383 if(dropdown->list) lv_obj_invalidate(dropdown->list); in lv_dropdown_set_selected_highlight()
442 if(dropdown->options) { in lv_dropdown_get_selected_str()
451 if(dropdown->options[i] == '\n') line++; in lv_dropdown_get_selected_str()
456 if(buf_size && c >= buf_size - 1) { in lv_dropdown_get_selected_str()
477 if(option_len == char_i && lv_memcmp(start, option, LV_MIN(option_len, char_i)) == 0) { in lv_dropdown_get_option_index()
482 if(start[0] == '\n') start++; in lv_dropdown_get_option_index()
535 if(lv_obj_get_width(dropdown->list) <= lv_obj_get_width(dropdown_obj) && in lv_dropdown_open()
549 /*No space on the bottom? See if top is better.*/ in lv_dropdown_open()
550 if(dropdown->dir == LV_DIR_BOTTOM) { in lv_dropdown_open()
551 if(dropdown_obj->coords.y2 + list_h > LV_VER_RES) { in lv_dropdown_open()
552 if(dropdown_obj->coords.y1 > LV_VER_RES - dropdown_obj->coords.y2) { in lv_dropdown_open()
562 /*No space on the top? See if bottom is better.*/ in lv_dropdown_open()
563 else if(dropdown->dir == LV_DIR_TOP) { in lv_dropdown_open()
564 if(dropdown_obj->coords.y1 - list_h < 0) { in lv_dropdown_open()
565 if(dropdown_obj->coords.y1 < LV_VER_RES - dropdown_obj->coords.y2) { in lv_dropdown_open()
576 if(list_h > list_fit_h) list_h = list_fit_h; in lv_dropdown_open()
581 …if(dir == LV_DIR_BOTTOM) lv_obj_align_to(dropdown->list, dropdown_obj, LV_ALIGN_OUT_BOTTOM_LEF… in lv_dropdown_open()
582 …else if(dir == LV_DIR_TOP) lv_obj_align_to(dropdown->list, dropdown_obj, LV_ALIGN_OUT_TOP_LEFT, … in lv_dropdown_open()
583 …else if(dir == LV_DIR_LEFT) lv_obj_align_to(dropdown->list, dropdown_obj, LV_ALIGN_OUT_LEFT_TOP, … in lv_dropdown_open()
584 …else if(dir == LV_DIR_RIGHT) lv_obj_align_to(dropdown->list, dropdown_obj, LV_ALIGN_OUT_RIGHT_TOP,… in lv_dropdown_open()
588 if(dropdown->dir == LV_DIR_LEFT || dropdown->dir == LV_DIR_RIGHT) { in lv_dropdown_open()
591 if(y2 >= LV_VER_RES) { in lv_dropdown_open()
667 #if LV_WIDGETS_HAS_DEFAULT_VALUE in lv_dropdown_constructor()
683 if(dropdown->list) { in lv_dropdown_destructor()
688 if(!dropdown->static_txt) { in lv_dropdown_destructor()
726 if(res != LV_RESULT_OK) return; in lv_dropdown_event()
732 if(code == LV_EVENT_FOCUSED) { in lv_dropdown_event()
738 if(indev_type == LV_INDEV_TYPE_ENCODER) { in lv_dropdown_event()
739 /*Open the list if editing*/ in lv_dropdown_event()
740 if(editing) { in lv_dropdown_event()
743 /*Close the list if navigating*/ in lv_dropdown_event()
750 else if(code == LV_EVENT_DEFOCUSED || code == LV_EVENT_LEAVE) { in lv_dropdown_event()
753 else if(code == LV_EVENT_RELEASED) { in lv_dropdown_event()
755 if(res != LV_RESULT_OK) return; in lv_dropdown_event()
757 else if(code == LV_EVENT_STYLE_CHANGED) { in lv_dropdown_event()
760 else if(code == LV_EVENT_SIZE_CHANGED) { in lv_dropdown_event()
763 else if(code == LV_EVENT_GET_SELF_SIZE) { in lv_dropdown_event()
768 else if(code == LV_EVENT_KEY) { in lv_dropdown_event()
770 if(c == LV_KEY_RIGHT || c == LV_KEY_DOWN) { in lv_dropdown_event()
771 if(!lv_dropdown_is_open(obj)) { in lv_dropdown_event()
774 else if(dropdown->sel_opt_id + 1 < dropdown->option_cnt) { in lv_dropdown_event()
779 else if(c == LV_KEY_LEFT || c == LV_KEY_UP) { in lv_dropdown_event()
781 if(!lv_dropdown_is_open(obj)) { in lv_dropdown_event()
784 else if(dropdown->sel_opt_id > 0) { in lv_dropdown_event()
789 else if(c == LV_KEY_ESC) { in lv_dropdown_event()
793 else if(c == LV_KEY_ENTER) { in lv_dropdown_event()
794 /* Handle the ENTER key only if it was send by another object. in lv_dropdown_event()
795 … * Do no process it if ENTER is sent by the dropdown because it's handled in LV_EVENT_RELEASED */ in lv_dropdown_event()
797 if(indev_obj != obj) { in lv_dropdown_event()
799 if(res != LV_RESULT_OK) return; in lv_dropdown_event()
803 else if(code == LV_EVENT_ROTARY) { in lv_dropdown_event()
804 if(!lv_dropdown_is_open(obj)) { in lv_dropdown_event()
816 else if(code == LV_EVENT_DRAW_MAIN) { in lv_dropdown_event()
829 if(code != LV_EVENT_DRAW_POST) { in lv_dropdown_list_event()
831 if(res != LV_RESULT_OK) return; in lv_dropdown_list_event()
837 if(code == LV_EVENT_RELEASED) { in lv_dropdown_list_event()
838 if(lv_indev_get_scroll_obj(lv_indev_active()) == NULL) { in lv_dropdown_list_event()
842 else if(code == LV_EVENT_PRESSED) { in lv_dropdown_list_event()
845 else if(code == LV_EVENT_SCROLL_BEGIN) { in lv_dropdown_list_event()
849 else if(code == LV_EVENT_DRAW_POST) { in lv_dropdown_list_event()
852 if(res != LV_RESULT_OK) return; in lv_dropdown_list_event()
871 /*If no text specified use the selected option*/ in draw_main()
874 if(dropdown->text) opt_txt = dropdown->text; in draw_main()
881 if(dropdown->dir == LV_DIR_LEFT) symbol_to_left = true; in draw_main()
882 if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) == LV_BASE_DIR_RTL) symbol_to_left = true; in draw_main()
884 if(dropdown->symbol) { in draw_main()
888 if(symbol_type == LV_IMAGE_SRC_SYMBOL) { in draw_main()
898 if(res == LV_RESULT_OK) { in draw_main()
913 if(symbol_to_left) { in draw_main()
920 if(symbol_type == LV_IMAGE_SRC_SYMBOL) { in draw_main()
950 /*Center align the text if no symbol*/ in draw_main()
951 if(dropdown->symbol == NULL) { in draw_main()
956 if(symbol_to_left) { in draw_main()
965 if(dropdown->text == NULL) { in draw_main()
985 if(has_common) { in draw_list()
988 if(dropdown->selected_highlight) { in draw_list()
989 if(dropdown->pr_opt_id == dropdown->sel_opt_id) { in draw_list()
1010 if(id == LV_DROPDOWN_PR_NONE) return; in draw_box()
1016 if(state != list_obj->state) { in draw_box()
1049 if(id == LV_DROPDOWN_PR_NONE) return; in draw_box_label()
1055 if(state != list_obj->state) { in draw_box_label()
1069 if(label == NULL) return; in draw_box_label()
1084 if(area_ok) { in draw_box_label()
1099 if(lv_indev_get_scroll_obj(indev) == NULL) { in btn_release_handler()
1100 if(lv_dropdown_is_open(obj)) { in btn_release_handler()
1102 if(dropdown->sel_opt_id_orig != dropdown->sel_opt_id) { in btn_release_handler()
1107 if(res != LV_RESULT_OK) return res; in btn_release_handler()
1111 if(indev_type == LV_INDEV_TYPE_ENCODER) { in btn_release_handler()
1129 …* @return LV_RESULT_INVALID if the list is not being deleted in the user callback. Else LV_RESULT_…
1139 if(lv_indev_get_type(indev) == LV_INDEV_TYPE_ENCODER) { in list_release_handler()
1142 if(lv_group_get_editing(g)) { in list_release_handler()
1148 …if(lv_indev_get_type(indev) == LV_INDEV_TYPE_POINTER || lv_indev_get_type(indev) == LV_INDEV_TYPE_… in list_release_handler()
1158 if(dropdown->text == NULL) lv_obj_invalidate(dropdown_obj); in list_release_handler()
1162 if(res != LV_RESULT_OK) return res; in list_release_handler()
1174 …if(indev && (lv_indev_get_type(indev) == LV_INDEV_TYPE_POINTER || lv_indev_get_type(indev) == LV_I… in list_press_handler()
1186 if(label == NULL) return 0; in get_id_on_point()
1198 if(opt >= dropdown->option_cnt) opt = dropdown->option_cnt - 1; in get_id_on_point()
1211 if(label == NULL) return; in position_to_selected()
1213 if(lv_obj_get_height(label) <= lv_obj_get_content_height(dropdown_obj)) return; in position_to_selected()
1229 if(dropdown->list == NULL) return NULL; in get_label()