Lines Matching full:if

12 #if LV_USE_TEXTAREA != 0
70 #if LV_USE_OBJ_PROPERTY
161 #if LV_USE_OBJ_PROPERTY
167 #if LV_USE_OBJ_PROPERTY_NAME
203 if(ta->one_line && (c == '\n' || c == '\r')) { in lv_textarea_add_char()
215 #if LV_BIG_ENDIAN_SYSTEM in lv_textarea_add_char()
216 if(c != 0) while(*letter_buf == 0) ++letter_buf; in lv_textarea_add_char()
220 Assume swapping is needed if MSB is zero. May not be foolproof. */ in lv_textarea_add_char()
221 if((c != 0) && ((c & 0xff000000) == 0)) { in lv_textarea_add_char()
230 if(res != LV_RESULT_OK) return; in lv_textarea_add_char()
234 if(char_is_accepted(obj, c_uni) == false) { in lv_textarea_add_char()
239 if(ta->pwd_mode) pwd_char_hider(obj); /*Make sure all the current text contains only '*'*/ in lv_textarea_add_char()
241 /*If the textarea is empty, invalidate it to hide the placeholder*/ in lv_textarea_add_char()
242 if(ta->placeholder_txt) { in lv_textarea_add_char()
244 if(txt[0] == '\0') lv_obj_invalidate(obj); in lv_textarea_add_char()
250 if(ta->pwd_mode) { in lv_textarea_add_char()
255 if(ta->pwd_tmp == NULL) return; in lv_textarea_add_char()
276 if(ta->pwd_mode) pwd_char_hider(obj); /*Make sure all the current text contains only '*'*/ in lv_textarea_add_text()
278 /*Add the character one-by-one if not all characters are accepted or there is character limit.*/ in lv_textarea_add_text()
279 if(lv_textarea_get_accepted_chars(obj) || lv_textarea_get_max_length(obj)) { in lv_textarea_add_text()
289 if(res != LV_RESULT_OK) return; in lv_textarea_add_text()
291 /*If the textarea is empty, invalidate it to hide the placeholder*/ in lv_textarea_add_text()
292 if(ta->placeholder_txt) { in lv_textarea_add_text()
294 if(txt_act[0] == '\0') lv_obj_invalidate(obj); in lv_textarea_add_text()
301 if(ta->pwd_mode) { in lv_textarea_add_text()
305 if(ta->pwd_tmp == NULL) return; in lv_textarea_add_text()
326 if(cur_pos == 0) return; in lv_textarea_delete_char()
331 if(res != LV_RESULT_OK) return; in lv_textarea_delete_char()
342 /*If the textarea became empty, invalidate it to hide the placeholder*/ in lv_textarea_delete_char()
343 if(ta->placeholder_txt) { in lv_textarea_delete_char()
345 if(txt[0] == '\0') lv_obj_invalidate(obj); in lv_textarea_delete_char()
348 if(ta->pwd_mode) { in lv_textarea_delete_char()
353 if(ta->pwd_tmp == NULL) return; in lv_textarea_delete_char()
369 if(cp != lv_textarea_get_cursor_pos(obj)) lv_textarea_delete_char(obj); in lv_textarea_delete_char_forward()
386 /*Add the character one-by-one if not all characters are accepted or there is character limit.*/ in lv_textarea_set_text()
387 if(lv_textarea_get_accepted_chars(obj) || lv_textarea_get_max_length(obj)) { in lv_textarea_set_text()
390 if(ta->pwd_mode) { in lv_textarea_set_text()
404 /*If the textarea is empty, invalidate it to hide the placeholder*/ in lv_textarea_set_text()
405 if(ta->placeholder_txt) { in lv_textarea_set_text()
407 if(txt_act[0] == '\0') lv_obj_invalidate(obj); in lv_textarea_set_text()
410 if(ta->pwd_mode) { in lv_textarea_set_text()
414 if(ta->pwd_tmp == NULL) return; in lv_textarea_set_text()
430 if((txt_len == 0) && (ta->placeholder_txt)) { in lv_textarea_set_placeholder_text()
439 if(ta->placeholder_txt == NULL) { in lv_textarea_set_placeholder_text()
456 if((uint32_t)ta->cursor.pos == (uint32_t)pos) return; in lv_textarea_set_cursor_pos()
460 if(pos < 0) pos = len + pos; in lv_textarea_set_cursor_pos()
462 if(pos > (int32_t)len || pos == LV_TEXTAREA_CURSOR_LAST) pos = len; in lv_textarea_set_cursor_pos()
473 /*The text area needs to have it's final size to see if the cursor is out of the area or not*/ in lv_textarea_set_cursor_pos()
477 if(cur_pos.y < lv_obj_get_scroll_top(obj)) { in lv_textarea_set_cursor_pos()
482 if(cur_pos.y + font_h - lv_obj_get_scroll_top(obj) > h) { in lv_textarea_set_cursor_pos()
487 if(cur_pos.x < lv_obj_get_scroll_left(obj)) { in lv_textarea_set_cursor_pos()
492 if(cur_pos.x + font_h - lv_obj_get_scroll_left(obj) > w) { in lv_textarea_set_cursor_pos()
516 if(ta->pwd_mode == en) return; in lv_textarea_set_password_mode()
520 if(en) { in lv_textarea_set_password_mode()
525 if(ta->pwd_tmp == NULL) return; in lv_textarea_set_password_mode()
549 if(!bullet && (ta->pwd_bullet)) { in lv_textarea_set_password_bullet()
560 if(ta->pwd_bullet == NULL) { in lv_textarea_set_password_bullet()
577 if(ta->one_line == en) return; in lv_textarea_set_one_line()
586 if(en) { in lv_textarea_set_one_line()
626 #if LV_LABEL_TEXT_SELECTION in lv_textarea_set_text_selection()
631 if(!en) lv_textarea_clear_selection(obj); in lv_textarea_set_text_selection()
677 if(ta->pwd_mode == 0) { in lv_textarea_get_text()
692 if(ta->placeholder_txt) return ta->placeholder_txt; in lv_textarea_get_placeholder_text()
734 if(ta->pwd_bullet) return ta->pwd_bullet; in lv_textarea_get_password_bullet()
739 /*If the textarea's font has the bullet character use it else fallback to "*"*/ in lv_textarea_get_password_bullet()
740 if(lv_font_get_glyph_dsc(font, &g, LV_TEXTAREA_PWD_BULLET_UNICODE, 0)) in lv_textarea_get_password_bullet()
774 #if LV_LABEL_TEXT_SELECTION in lv_textarea_text_is_selected()
777 if((lv_label_get_text_selection_start(ta->label) != LV_DRAW_LABEL_NO_TXT_SEL || in lv_textarea_text_is_selected()
794 #if LV_LABEL_TEXT_SELECTION in lv_textarea_get_text_selection()
819 if(lv_text_get_encoded_length(txt) >= pos && pos > 0) in lv_textarea_get_current_char()
833 #if LV_LABEL_TEXT_SELECTION in lv_textarea_clear_selection()
836 if(lv_label_get_text_selection_start(ta->label) != LV_DRAW_LABEL_NO_TXT_SEL || in lv_textarea_clear_selection()
860 if(cp > 0) { in lv_textarea_cursor_left()
885 if(pos.y < lv_obj_get_height(ta->label)) { in lv_textarea_cursor_down()
942 #if LV_LABEL_TEXT_SELECTION in lv_textarea_constructor()
967 if(ta->pwd_tmp != NULL) { in lv_textarea_destructor()
971 if(ta->pwd_bullet != NULL) { in lv_textarea_destructor()
975 if(ta->placeholder_txt != NULL) { in lv_textarea_destructor()
988 if(res != LV_RESULT_OK) return; in lv_textarea_event()
993 if(code == LV_EVENT_FOCUSED) { in lv_textarea_event()
996 else if(code == LV_EVENT_KEY) { in lv_textarea_event()
998 if(c == LV_KEY_RIGHT) in lv_textarea_event()
1000 else if(c == LV_KEY_LEFT) in lv_textarea_event()
1002 else if(c == LV_KEY_UP) in lv_textarea_event()
1004 else if(c == LV_KEY_DOWN) in lv_textarea_event()
1006 else if(c == LV_KEY_BACKSPACE) in lv_textarea_event()
1008 else if(c == LV_KEY_DEL) in lv_textarea_event()
1010 else if(c == LV_KEY_HOME) in lv_textarea_event()
1012 else if(c == LV_KEY_END) in lv_textarea_event()
1014 else if(c == LV_KEY_ENTER && lv_textarea_get_one_line(obj)) in lv_textarea_event()
1020 else if(code == LV_EVENT_PRESSED || code == LV_EVENT_PRESSING || code == LV_EVENT_PRESS_LOST || in lv_textarea_event()
1024 else if(code == LV_EVENT_DRAW_MAIN) { in lv_textarea_event()
1027 else if(code == LV_EVENT_DRAW_POST) { in lv_textarea_event()
1038 if(code == LV_EVENT_STYLE_CHANGED || code == LV_EVENT_SIZE_CHANGED) { in label_event_cb()
1053 if(show != ta->cursor.show) { in cursor_blink_anim_cb()
1095 if(ta->pwd_mode == 0) { in pwd_char_hider()
1102 if(enc_len == 0) return; in pwd_char_hider()
1123 * Test a unicode character if it is accepted or not. Checks max length and accepted char list.
1133if(ta->max_length > 0 && lv_text_get_encoded_length(lv_textarea_get_text(obj)) >= ta->max_length) { in char_is_accepted()
1137 if(ta->accepted_chars == NULL || ta->accepted_chars[0] == '\0') return true; in char_is_accepted()
1143 if(a == c) return true; /*Accepted*/ in char_is_accepted()
1153 if(blink_time == 0) { in start_cursor_blink()
1188 if(is_valid_but_non_printable_char(letter)) { in refr_cursor_area()
1198 /*If the cursor is out of the text (most right) draw it to the next line*/ in refr_cursor_area()
1199 if(((letter_pos.x + ta->label->coords.x1) + letter_w > ta->label->coords.x2) && in refr_cursor_area()
1205 if(letter != '\0') { in refr_cursor_area()
1211 if(is_valid_but_non_printable_char(letter)) { in refr_cursor_area()
1255 if(click_source == NULL) return; in update_cursor_position_on_click()
1259 if(ta->cursor.click_pos == 0) return; in update_cursor_position_on_click()
1261 if(lv_indev_get_type(click_source) == LV_INDEV_TYPE_KEYPAD || in update_cursor_position_on_click()
1273 if(point_act.x < 0 || point_act.y < 0) return; /*Ignore event from keypad*/ in update_cursor_position_on_click()
1283 #if LV_LABEL_TEXT_SELECTION in update_cursor_position_on_click()
1286 /*Check if the click happened on the left side of the area outside the label*/ in update_cursor_position_on_click()
1287 if(rel_pos.x < 0) { in update_cursor_position_on_click()
1291 /*Check if the click happened on the right side of the area outside the label*/ in update_cursor_position_on_click()
1292 else if(rel_pos.x >= label_width) { in update_cursor_position_on_click()
1301 if(ta->text_sel_en) { in update_cursor_position_on_click()
1302 if(!ta->text_sel_in_prog && !click_outside_label && code == LV_EVENT_PRESSED) { in update_cursor_position_on_click()
1309 else if(ta->text_sel_in_prog && code == LV_EVENT_PRESSING) { in update_cursor_position_on_click()
1313 … else if(ta->text_sel_in_prog && (code == LV_EVENT_PRESS_LOST || code == LV_EVENT_RELEASED)) { in update_cursor_position_on_click()
1314 /*Input device is released. Check if anything was selected.*/ in update_cursor_position_on_click()
1319if(ta->text_sel_in_prog || code == LV_EVENT_PRESSED) lv_textarea_set_cursor_pos(obj, char_id_at_cl… in update_cursor_position_on_click()
1321 if(ta->text_sel_in_prog) { in update_cursor_position_on_click()
1322 /*If the selected area has changed then update the real values and*/ in update_cursor_position_on_click()
1325 if(ta->sel_start > ta->sel_end) { in update_cursor_position_on_click()
1326 if(label_data->sel_start != ta->sel_end || label_data->sel_end != ta->sel_start) { in update_cursor_position_on_click()
1332 else if(ta->sel_start < ta->sel_end) { in update_cursor_position_on_click()
1333 if(label_data->sel_start != ta->sel_start || label_data->sel_end != ta->sel_end) { in update_cursor_position_on_click()
1340if(label_data->sel_start != LV_DRAW_LABEL_NO_TXT_SEL || label_data->sel_end != LV_DRAW_LABEL_NO_TX… in update_cursor_position_on_click()
1346 /*Finish selection if necessary*/ in update_cursor_position_on_click()
1347 if(code == LV_EVENT_PRESS_LOST || code == LV_EVENT_RELEASED) { in update_cursor_position_on_click()
1352 /*Check if the click happened on the left side of the area outside the label*/ in update_cursor_position_on_click()
1353 if(rel_pos.x < 0) { in update_cursor_position_on_click()
1356 /*Check if the click happened on the right side of the area outside the label*/ in update_cursor_position_on_click()
1357 else if(rel_pos.x >= label_width) { in update_cursor_position_on_click()
1364 if(code == LV_EVENT_PRESSED) lv_textarea_set_cursor_pos(obj, char_id_at_click); in update_cursor_position_on_click()
1375 /* Drop txt if insert replace is set to '\0' */ in insert_handler()
1376 if(ta_insert_replace && ta_insert_replace[0] == '\0') in insert_handler()
1379 if(ta_insert_replace) { in insert_handler()
1381 if(lv_strcmp(ta_insert_replace, txt)) { in insert_handler()
1398 if(txt[0] == '\0' && ta->placeholder_txt && ta->placeholder_txt[0] != 0) { in draw_placeholder()
1404 if(ta->one_line) ph_dsc.flag |= LV_TEXT_FLAG_EXPAND; in draw_placeholder()
1429 if(ta->cursor.show == 0) return; in draw_cursor()
1456 /*Draw the letter over the cursor only if in draw_cursor()
1464 if(cur_dsc.bg_opa > LV_OPA_MIN || !lv_color_eq(cur_label_dsc.color, label_color)) { in draw_cursor()
1475 if(ta->pwd_show_time == 0) { in auto_hide_characters()
1498 if(letter == '\0' || letter == '\n' || letter == '\r') { in is_valid_but_non_printable_char()