mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
minor fixes
This commit is contained in:
parent
bdef86faf2
commit
7b48fa0fc0
@ -18,14 +18,8 @@ void lv_example_calendar_1(void)
|
||||
lv_obj_align(calendar, NULL, LV_ALIGN_CENTER, 0, 20);
|
||||
lv_obj_add_event_cb(calendar, event_handler, NULL);
|
||||
|
||||
/*Set today's date*/
|
||||
lv_calendar_date_t today;
|
||||
today.year = 2021;
|
||||
today.month = 02;
|
||||
today.day = 23;
|
||||
|
||||
lv_calendar_set_today_date(calendar, &today);
|
||||
lv_calendar_set_showed_date(calendar, &today);
|
||||
lv_calendar_set_today_date(calendar, 2021, 02, 23);
|
||||
lv_calendar_set_showed_date(calendar, 2021, 02);
|
||||
|
||||
/*Highlight a few days*/
|
||||
static lv_calendar_date_t highlighted_days[3]; /*Only its pointer will be saved so should be static*/
|
||||
@ -43,10 +37,11 @@ void lv_example_calendar_1(void)
|
||||
|
||||
lv_calendar_set_highlighted_dates(calendar, highlighted_days, 3);
|
||||
|
||||
#if LV_USE_CALENDAR_HEADER_ARROW
|
||||
lv_obj_t * h = lv_calendar_header_arrow_create(lv_scr_act(), calendar, 25);
|
||||
lv_obj_align(h, NULL, LV_ALIGN_IN_TOP_MID, 0, 5);
|
||||
lv_obj_align(calendar, h, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
|
||||
lv_obj_align(calendar, NULL, LV_ALIGN_CENTER, 0, -20);
|
||||
#if LV_USE_CALENDAR_HEADER_DROPDOWN
|
||||
lv_calendar_header_dropdown_create(lv_scr_act(), calendar);
|
||||
#elif LV_USE_CALENDAR_HEADER_ARROW
|
||||
lv_calendar_header_arrow_create(lv_scr_act(), calendar, 25);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ void lv_example_textarea_2(void)
|
||||
/* Create the password box */
|
||||
lv_obj_t * pwd_ta = lv_textarea_create(lv_scr_act(), NULL);
|
||||
lv_textarea_set_text(pwd_ta, "");
|
||||
lv_textarea_set_pwd_mode(pwd_ta, true);
|
||||
lv_textarea_set_password_mode(pwd_ta, true);
|
||||
lv_textarea_set_one_line(pwd_ta, true);
|
||||
lv_obj_set_width(pwd_ta, LV_HOR_RES / 2 - 20);
|
||||
lv_obj_set_pos(pwd_ta, 5, 20);
|
||||
@ -23,7 +23,7 @@ void lv_example_textarea_2(void)
|
||||
|
||||
/* Create the one-line mode text area */
|
||||
lv_obj_t * oneline_ta = lv_textarea_create(lv_scr_act(), pwd_ta);
|
||||
lv_textarea_set_pwd_mode(oneline_ta, false);
|
||||
lv_textarea_set_password_mode(oneline_ta, false);
|
||||
lv_obj_align(oneline_ta, NULL, LV_ALIGN_IN_TOP_RIGHT, -5, 20);
|
||||
|
||||
|
||||
|
@ -38,7 +38,8 @@ static lv_color_t color_secondary_muted;// lv_color_indigo_lighten_5()
|
||||
#define BORDER_WIDTH LV_DPX(2)
|
||||
#define OUTLINE_WIDTH LV_DPX(2)
|
||||
|
||||
#define PAD_DEF LV_DPX(24)
|
||||
#define PAD_DEF LV_DPX(24)
|
||||
#define PAD_SMALL (PAD_DEF / 2 + 2)
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
@ -62,7 +63,6 @@ typedef struct {
|
||||
lv_style_t pad_small;
|
||||
lv_style_t pad_normal;
|
||||
lv_style_t pad_gap;
|
||||
lv_style_t pad_small_negative;
|
||||
lv_style_t line_space_large;
|
||||
lv_style_t text_align_center;
|
||||
lv_style_t outline_primary;
|
||||
@ -94,6 +94,10 @@ typedef struct {
|
||||
lv_style_t cb_marker, cb_marker_checked, cb_bg_outline_pad;
|
||||
#endif
|
||||
|
||||
#if LV_USE_SWITCH
|
||||
lv_style_t switch_knob;
|
||||
#endif
|
||||
|
||||
#if LV_USE_TABLE
|
||||
lv_style_t table_cell;
|
||||
#endif
|
||||
@ -107,7 +111,7 @@ typedef struct {
|
||||
#endif
|
||||
|
||||
#if LV_USE_CALENDAR
|
||||
lv_style_t calendar_day;
|
||||
lv_style_t calendar_bg, calendar_day;
|
||||
#endif
|
||||
|
||||
#if LV_USE_COLORWHEEL
|
||||
@ -218,8 +222,8 @@ static void style_init(void)
|
||||
lv_style_set_bg_opa(&styles->scr, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&styles->scr, COLOR_SCR);
|
||||
lv_style_set_text_color(&styles->scr, COLOR_SCR_TEXT);
|
||||
lv_style_set_pad_row(&styles->scr, PAD_DEF);
|
||||
lv_style_set_pad_column(&styles->scr, PAD_DEF);
|
||||
lv_style_set_pad_row(&styles->scr, PAD_SMALL);
|
||||
lv_style_set_pad_column(&styles->scr, PAD_SMALL);
|
||||
|
||||
style_init_reset(&styles->card);
|
||||
lv_style_set_radius(&styles->card, RADIUS_DEFAULT);
|
||||
@ -230,8 +234,8 @@ static void style_init(void)
|
||||
lv_style_set_border_post(&styles->card, true);
|
||||
lv_style_set_text_color(&styles->card, lv_color_grey_darken_4());
|
||||
lv_style_set_pad_all(&styles->card, PAD_DEF);
|
||||
lv_style_set_pad_row(&styles->card, PAD_DEF / 4 + 2);
|
||||
lv_style_set_pad_column(&styles->card, PAD_DEF);
|
||||
lv_style_set_pad_row(&styles->card, PAD_SMALL);
|
||||
lv_style_set_pad_column(&styles->card, PAD_SMALL);
|
||||
lv_style_set_line_color(&styles->card, lv_color_grey());
|
||||
lv_style_set_line_width(&styles->card, LV_DPX(1));
|
||||
|
||||
@ -282,16 +286,13 @@ static void style_init(void)
|
||||
lv_style_set_pad_column(&styles->pad_normal, PAD_DEF);
|
||||
|
||||
style_init_reset(&styles->pad_small);
|
||||
lv_style_set_pad_all(&styles->pad_small, PAD_DEF / 2 + 2);
|
||||
lv_style_set_pad_gap(&styles->pad_small, PAD_DEF / 2 + 2);
|
||||
lv_style_set_pad_all(&styles->pad_small, PAD_SMALL);
|
||||
lv_style_set_pad_gap(&styles->pad_small, PAD_SMALL);
|
||||
|
||||
style_init_reset(&styles->pad_gap);
|
||||
lv_style_set_pad_row(&styles->pad_gap, LV_DPX(10));
|
||||
lv_style_set_pad_column(&styles->pad_gap, LV_DPX(10));
|
||||
|
||||
style_init_reset(&styles->pad_small_negative);
|
||||
lv_style_set_pad_all(&styles->pad_small_negative, - LV_DPX(4));
|
||||
|
||||
style_init_reset(&styles->line_space_large);
|
||||
lv_style_set_text_line_space(&styles->line_space_large, LV_DPX(20));
|
||||
|
||||
@ -382,6 +383,11 @@ static void style_init(void)
|
||||
lv_style_set_outline_pad(&styles->cb_bg_outline_pad, LV_DPX(5));
|
||||
#endif
|
||||
|
||||
#if LV_USE_SWITCH
|
||||
style_init_reset(&styles->switch_knob);
|
||||
lv_style_set_pad_all(&styles->switch_knob, - LV_DPX(4));
|
||||
#endif
|
||||
|
||||
#if LV_USE_CHART
|
||||
style_init_reset(&styles->chart_bg);
|
||||
lv_style_set_line_dash_width(&styles->chart_bg, LV_DPX(10));
|
||||
@ -433,6 +439,10 @@ static void style_init(void)
|
||||
#endif
|
||||
|
||||
#if LV_USE_CALENDAR
|
||||
style_init_reset(&styles->calendar_bg);
|
||||
lv_style_set_pad_all(&styles->calendar_bg, PAD_SMALL);
|
||||
lv_style_set_pad_gap(&styles->calendar_bg, PAD_SMALL / 2);
|
||||
|
||||
style_init_reset(&styles->calendar_day);
|
||||
lv_style_set_border_width(&styles->calendar_day, LV_DPX(1));
|
||||
lv_style_set_border_color(&styles->calendar_day, color_primary_muted);
|
||||
@ -712,7 +722,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
|
||||
lv_obj_add_style(obj, LV_PART_INDICATOR, LV_STATE_DISABLED, &styles->disabled);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->knob);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->bg_color_white);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->pad_small_negative);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DEFAULT, &styles->switch_knob);
|
||||
lv_obj_add_style(obj, LV_PART_KNOB, LV_STATE_DISABLED, &styles->disabled);
|
||||
}
|
||||
#endif
|
||||
@ -808,7 +818,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
|
||||
#if LV_USE_CALENDAR
|
||||
else if(lv_obj_check_type(obj, &lv_calendar_class)) {
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->card);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->pad_small);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_DEFAULT, &styles->calendar_bg);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_FOCUS_KEY, &styles->outline_primary);
|
||||
lv_obj_add_style(obj, LV_PART_MAIN, LV_STATE_EDITED, &styles->outline_secondary);
|
||||
lv_obj_add_style(obj, LV_PART_ITEMS, LV_STATE_DEFAULT, &styles->calendar_day);
|
||||
|
@ -71,13 +71,12 @@ void lv_calendar_set_day_names(lv_obj_t * obj, const char * day_names[])
|
||||
}
|
||||
}
|
||||
|
||||
void lv_calendar_set_today_date(lv_obj_t * obj, lv_calendar_date_t * today)
|
||||
void lv_calendar_set_today_date(lv_obj_t * obj, uint32_t year, uint32_t month, uint32_t day)
|
||||
{
|
||||
LV_ASSERT_NULL(today);
|
||||
lv_calendar_t * calendar = (lv_calendar_t *) obj;
|
||||
calendar->today.year = today->year;
|
||||
calendar->today.month = today->month;
|
||||
calendar->today.day = today->day;
|
||||
calendar->today.year = year;
|
||||
calendar->today.month = month;
|
||||
calendar->today.day = day;
|
||||
|
||||
highlight_update(obj);
|
||||
}
|
||||
@ -93,14 +92,12 @@ void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highli
|
||||
highlight_update(obj);
|
||||
}
|
||||
|
||||
void lv_calendar_set_showed_date(lv_obj_t * obj, lv_calendar_date_t * showed)
|
||||
void lv_calendar_set_showed_date(lv_obj_t * obj, uint32_t year, uint32_t month)
|
||||
{
|
||||
LV_ASSERT_NULL(showed);
|
||||
|
||||
lv_calendar_t * calendar = (lv_calendar_t *) obj;
|
||||
calendar->showed_date.year = showed->year;
|
||||
calendar->showed_date.month = showed->month;
|
||||
calendar->showed_date.day = showed->day;
|
||||
calendar->showed_date.year = year;
|
||||
calendar->showed_date.month = month;
|
||||
calendar->showed_date.day = 1;
|
||||
|
||||
lv_calendar_date_t d;
|
||||
d.year = calendar->showed_date.year;
|
||||
@ -247,8 +244,8 @@ static void my_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||
lv_btnmatrix_set_btn_ctrl_all(obj, LV_BTNMATRIX_CTRL_CLICK_TRIG | LV_BTNMATRIX_CTRL_NO_REPEAT);
|
||||
|
||||
|
||||
lv_calendar_set_showed_date(obj, &calendar->showed_date);
|
||||
lv_calendar_set_today_date(obj, &calendar->today);
|
||||
lv_calendar_set_showed_date(obj, calendar->showed_date.year, calendar->showed_date.month);
|
||||
lv_calendar_set_today_date(obj, calendar->today.year, calendar->today.month, calendar->today.day);
|
||||
|
||||
lv_obj_add_event_cb(obj, draw_event_cb, NULL);
|
||||
|
||||
|
@ -64,37 +64,38 @@ lv_obj_t * lv_calendar_create(lv_obj_t * parent);
|
||||
|
||||
/**
|
||||
* Set the today's date
|
||||
* @param calendar pointer to a calendar object
|
||||
* @param today pointer to an `lv_calendar_date_t` variable containing the date of today. The value
|
||||
* will be saved it can be local variable too.
|
||||
* @param obj pointer to a calendar object
|
||||
* @param year today's year
|
||||
* @param month today's month [1..12]
|
||||
* @param day today's day [1..31]
|
||||
*/
|
||||
void lv_calendar_set_today_date(lv_obj_t * calendar, lv_calendar_date_t * today);
|
||||
void lv_calendar_set_today_date(lv_obj_t * obj, uint32_t year, uint32_t month, uint32_t day);
|
||||
|
||||
/**
|
||||
* Set the currently showed
|
||||
* @param calendar pointer to a calendar object
|
||||
* @param showed pointer to an `lv_calendar_date_t` variable containing the date to show. The value
|
||||
* will be saved it can be local variable too.
|
||||
* @param obj pointer to a calendar object
|
||||
* @param year today's year
|
||||
* @param month today's month [1..12]
|
||||
*/
|
||||
void lv_calendar_set_showed_date(lv_obj_t * calendar, lv_calendar_date_t * showed);
|
||||
void lv_calendar_set_showed_date(lv_obj_t * obj, uint32_t year, uint32_t month);
|
||||
|
||||
/**
|
||||
* Set the the highlighted dates
|
||||
* @param calendar pointer to a calendar object
|
||||
* @param highlighted pointer to an `lv_calendar_date_t` array containing the dates. ONLY A POINTER
|
||||
* WILL BE SAVED! CAN'T BE LOCAL ARRAY.
|
||||
* @param obj pointer to a calendar object
|
||||
* @param highlighted pointer to an `lv_calendar_date_t` array containing the dates.
|
||||
* Only the pointer will be saved so this variable can't be local which will be destroyed later.
|
||||
* @param date_num number of dates in the array
|
||||
*/
|
||||
void lv_calendar_set_highlighted_dates(lv_obj_t * calendar, lv_calendar_date_t highlighted[], uint16_t date_num);
|
||||
void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highlighted[], uint16_t date_num);
|
||||
|
||||
/**
|
||||
* Set the name of the days
|
||||
* @param calendar pointer to a calendar object
|
||||
* @param day_names pointer to an array with the names. E.g. `const char * days[7] = {"Sun", "Mon",
|
||||
* ...}` Only the pointer will be saved so this variable can't be local which will be destroyed
|
||||
* later.
|
||||
* @param obj pointer to a calendar object
|
||||
* @param day_names pointer to an array with the names.
|
||||
* E.g. `const char * days[7] = {"Sun", "Mon", ...}`
|
||||
* Only the pointer will be saved so this variable can't be local which will be destroyed later.
|
||||
*/
|
||||
void lv_calendar_set_day_names(lv_obj_t * calendar, const char ** day_names);
|
||||
void lv_calendar_set_day_names(lv_obj_t * obj, const char ** day_names);
|
||||
|
||||
/*=====================
|
||||
* Getter functions
|
||||
|
@ -10,6 +10,8 @@
|
||||
#if LV_USE_CALENDAR_HEADER_ARROW
|
||||
|
||||
#include "lv_calendar.h"
|
||||
#include "../../../lv_widgets/lv_btn.h"
|
||||
#include "../../../lv_widgets/lv_label.h"
|
||||
#include "../../layouts/flex/lv_flex.h"
|
||||
|
||||
/*********************
|
||||
@ -42,6 +44,13 @@ lv_obj_t * lv_calendar_header_arrow_create(lv_obj_t * parent, lv_obj_t * calenda
|
||||
{
|
||||
lv_obj_t * header = lv_obj_create(parent, NULL);
|
||||
|
||||
/*Use the same paddings as the calendar*/
|
||||
lv_obj_set_style_pad_left(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_left(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_right(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_right(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_top(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_top(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_bottom(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_bottom(calendar, LV_PART_MAIN));
|
||||
lv_obj_set_style_pad_column(header, LV_PART_MAIN, LV_STATE_DEFAULT, lv_obj_get_style_pad_column(calendar, LV_PART_MAIN));
|
||||
|
||||
const lv_calendar_date_t * cur_date = lv_calendar_get_showed_date(calendar);
|
||||
|
||||
lv_coord_t w = lv_obj_get_width(calendar);
|
||||
@ -52,6 +61,7 @@ lv_obj_t * lv_calendar_header_arrow_create(lv_obj_t * parent, lv_obj_t * calenda
|
||||
lv_obj_set_style_content_text(mo_prev, LV_PART_MAIN, LV_STATE_DEFAULT, LV_SYMBOL_LEFT);
|
||||
lv_obj_set_size(mo_prev, btn_size, btn_size);
|
||||
lv_obj_add_event_cb(mo_prev, month_event_cb, calendar);
|
||||
lv_obj_clear_flag(mo_prev, LV_OBJ_FLAG_CLICK_FOCUSABLE);
|
||||
|
||||
lv_obj_t * label = lv_label_create(header, NULL);
|
||||
lv_label_set_long_mode(label, LV_LABEL_LONG_SCROLL_CIRCULAR);
|
||||
@ -63,6 +73,9 @@ lv_obj_t * lv_calendar_header_arrow_create(lv_obj_t * parent, lv_obj_t * calenda
|
||||
lv_obj_set_style_content_text(mo_next, LV_PART_MAIN, LV_STATE_DEFAULT, LV_SYMBOL_RIGHT);
|
||||
lv_obj_set_size(mo_next, btn_size, btn_size);
|
||||
lv_obj_add_event_cb(mo_next, month_event_cb, calendar);
|
||||
lv_obj_clear_flag(mo_next, LV_OBJ_FLAG_CLICK_FOCUSABLE);
|
||||
|
||||
lv_obj_align(header, calendar, LV_ALIGN_OUT_TOP_MID, 0, 0);
|
||||
|
||||
return header;
|
||||
}
|
||||
@ -99,7 +112,7 @@ static void month_event_cb(lv_obj_t * btn, lv_event_t e)
|
||||
}
|
||||
}
|
||||
|
||||
lv_calendar_set_showed_date(calendar, &newd);
|
||||
lv_calendar_set_showed_date(calendar, newd.year, newd.month);
|
||||
|
||||
lv_obj_t * label = lv_obj_get_child(header, 1);
|
||||
lv_label_set_text_fmt(label, "%d %s", newd.year, month_names_def[newd.month - 1]);
|
||||
|
@ -277,15 +277,19 @@ void lv_keyboard_def_event_cb(lv_obj_t * obj, lv_event_t event)
|
||||
/*Add the characters to the text area if set*/
|
||||
if(keyboard->ta == NULL) return;
|
||||
|
||||
if(strcmp(txt, "Enter") == 0 || strcmp(txt, LV_SYMBOL_NEW_LINE) == 0)
|
||||
if(strcmp(txt, "Enter") == 0 || strcmp(txt, LV_SYMBOL_NEW_LINE) == 0) {
|
||||
lv_textarea_add_char(keyboard->ta, '\n');
|
||||
else if(strcmp(txt, LV_SYMBOL_LEFT) == 0)
|
||||
if(lv_textarea_get_one_line(keyboard->ta)) {
|
||||
lv_res_t res = lv_event_send(keyboard->ta, LV_EVENT_READY, NULL);
|
||||
if(res != LV_RES_OK) return;
|
||||
}
|
||||
} else if(strcmp(txt, LV_SYMBOL_LEFT) == 0) {
|
||||
lv_textarea_cursor_left(keyboard->ta);
|
||||
else if(strcmp(txt, LV_SYMBOL_RIGHT) == 0)
|
||||
} else if(strcmp(txt, LV_SYMBOL_RIGHT) == 0) {
|
||||
lv_textarea_cursor_right(keyboard->ta);
|
||||
else if(strcmp(txt, LV_SYMBOL_BACKSPACE) == 0)
|
||||
} else if(strcmp(txt, LV_SYMBOL_BACKSPACE) == 0) {
|
||||
lv_textarea_del_char(keyboard->ta);
|
||||
else if(strcmp(txt, "+/-") == 0) {
|
||||
} else if(strcmp(txt, "+/-") == 0) {
|
||||
uint16_t cur = lv_textarea_get_cursor_pos(keyboard->ta);
|
||||
const char * ta_txt = lv_textarea_get_text(keyboard->ta);
|
||||
if(ta_txt[0] == '-') {
|
||||
|
@ -15,6 +15,7 @@ extern "C" {
|
||||
*********************/
|
||||
#include "calendar/lv_calendar.h"
|
||||
#include "calendar/lv_calendar_header_arrow.h"
|
||||
#include "calendar/lv_calendar_header_dropdown.h"
|
||||
#include "keyboard/lv_keyboard.h"
|
||||
#include "list/lv_list.h"
|
||||
#include "msgbox/lv_msgbox.h"
|
||||
|
@ -603,7 +603,6 @@ static void lv_obj_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||
obj->flags |= LV_OBJ_FLAG_SCROLLABLE;
|
||||
obj->flags |= LV_OBJ_FLAG_SCROLL_ELASTIC;
|
||||
obj->flags |= LV_OBJ_FLAG_SCROLL_MOMENTUM;
|
||||
obj->flags |= LV_OBJ_FLAG_SCROLL_ON_FOCUS;
|
||||
if(parent) obj->flags |= LV_OBJ_FLAG_GESTURE_BUBBLE;
|
||||
|
||||
obj->style_list.cache_state = LV_OBJ_STYLE_CACHE_STATE_INVALID;
|
||||
|
@ -57,6 +57,7 @@ static void lv_btn_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||
if(copy == NULL) {
|
||||
lv_obj_set_size(obj, LV_DPI_DEF, LV_DPI_DEF / 3);
|
||||
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
|
||||
lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
|
||||
}
|
||||
|
||||
LV_LOG_INFO("btn created");
|
||||
|
@ -18,8 +18,6 @@ extern "C" {
|
||||
#if LV_USE_BTNMATRIX != 0
|
||||
|
||||
#include "../lv_core/lv_obj.h"
|
||||
#include "lv_label.h"
|
||||
#include "lv_btn.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
|
@ -496,7 +496,7 @@ void lv_textarea_set_cursor_click_pos(lv_obj_t * obj, bool en)
|
||||
* @param ta pointer to a text area object
|
||||
* @param en true: enable, false: disable
|
||||
*/
|
||||
void lv_textarea_set_pwd_mode(lv_obj_t * obj, bool en)
|
||||
void lv_textarea_set_password_mode(lv_obj_t * obj, bool en)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
|
||||
@ -629,7 +629,7 @@ void lv_textarea_set_text_sel(lv_obj_t * obj, bool en)
|
||||
* @param ta pointer to Text area
|
||||
* @param time show time in milliseconds. 0: hide immediately.
|
||||
*/
|
||||
void lv_textarea_set_pwd_show_time(lv_obj_t * obj, uint16_t time)
|
||||
void lv_textarea_set_password_show_time(lv_obj_t * obj, uint16_t time)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
|
||||
@ -721,7 +721,7 @@ bool lv_textarea_get_cursor_click_pos(lv_obj_t * obj)
|
||||
* @param ta pointer to a text area object
|
||||
* @return true: password mode is enabled, false: disabled
|
||||
*/
|
||||
bool lv_textarea_get_pwd_mode(const lv_obj_t * obj)
|
||||
bool lv_textarea_get_password_mode(const lv_obj_t * obj)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
|
||||
@ -817,7 +817,7 @@ bool lv_textarea_get_text_sel_en(lv_obj_t * obj)
|
||||
* @param ta pointer to Text area
|
||||
* @return show time in milliseconds. 0: hide immediately.
|
||||
*/
|
||||
uint16_t lv_textarea_get_pwd_show_time(lv_obj_t * obj)
|
||||
uint16_t lv_textarea_get_password_show_time(lv_obj_t * obj)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
|
||||
@ -972,6 +972,7 @@ static void lv_textarea_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||
lv_label_set_long_mode(ta->label, LV_LABEL_LONG_WRAP);
|
||||
lv_label_set_text(ta->label, "");
|
||||
lv_obj_set_size(obj, LV_TEXTAREA_DEF_WIDTH, LV_TEXTAREA_DEF_HEIGHT);
|
||||
lv_obj_add_flag(obj, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
|
||||
}
|
||||
/*Copy an existing object*/
|
||||
else {
|
||||
|
@ -160,7 +160,7 @@ void lv_textarea_set_cursor_click_pos(lv_obj_t * ta, bool en);
|
||||
* @param ta pointer to a text area object
|
||||
* @param en true: enable, false: disable
|
||||
*/
|
||||
void lv_textarea_set_pwd_mode(lv_obj_t * ta, bool en);
|
||||
void lv_textarea_set_password_mode(lv_obj_t * ta, bool en);
|
||||
|
||||
/**
|
||||
* Configure the text area to one line or back to normal
|
||||
@ -205,7 +205,7 @@ void lv_textarea_set_text_sel(lv_obj_t * ta, bool en);
|
||||
* @param ta pointer to Text area
|
||||
* @param time show time in milliseconds. 0: hide immediately.
|
||||
*/
|
||||
void lv_textarea_set_pwd_show_time(lv_obj_t * ta, uint16_t time);
|
||||
void lv_textarea_set_password_show_time(lv_obj_t * ta, uint16_t time);
|
||||
|
||||
/*=====================
|
||||
* Getter functions
|
||||
@ -258,7 +258,7 @@ bool lv_textarea_get_cursor_click_pos(lv_obj_t * ta);
|
||||
* @param ta pointer to a text area object
|
||||
* @return true: password mode is enabled, false: disabled
|
||||
*/
|
||||
bool lv_textarea_get_pwd_mode(const lv_obj_t * ta);
|
||||
bool lv_textarea_get_password_mode(const lv_obj_t * ta);
|
||||
|
||||
/**
|
||||
* Get the one line configuration attribute
|
||||
@ -300,7 +300,7 @@ bool lv_textarea_get_text_sel_en(lv_obj_t * ta);
|
||||
* @param ta pointer to Text area
|
||||
* @return show time in milliseconds. 0: hide immediately.
|
||||
*/
|
||||
uint16_t lv_textarea_get_pwd_show_time(lv_obj_t * ta);
|
||||
uint16_t lv_textarea_get_password_show_time(lv_obj_t * ta);
|
||||
|
||||
/*=====================
|
||||
* Other functions
|
||||
|
Loading…
x
Reference in New Issue
Block a user