mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-02 01:18:04 +08:00
feat(chart,calendar): two grammar corrections (#7340)
This commit is contained in:
@@ -1324,7 +1324,7 @@ static void birthday_event_cb(lv_event_t * e)
|
|||||||
if(disp_size == DISP_SMALL) lv_obj_set_size(calendar, 180, 200);
|
if(disp_size == DISP_SMALL) lv_obj_set_size(calendar, 180, 200);
|
||||||
else if(disp_size == DISP_MEDIUM) lv_obj_set_size(calendar, 200, 220);
|
else if(disp_size == DISP_MEDIUM) lv_obj_set_size(calendar, 200, 220);
|
||||||
else lv_obj_set_size(calendar, 300, 330);
|
else lv_obj_set_size(calendar, 300, 330);
|
||||||
lv_calendar_set_showed_date(calendar, 1990, 01);
|
lv_calendar_set_month_shown(calendar, 1990, 01);
|
||||||
lv_obj_align(calendar, LV_ALIGN_CENTER, 0, 30);
|
lv_obj_align(calendar, LV_ALIGN_CENTER, 0, 30);
|
||||||
lv_obj_add_event_cb(calendar, calendar_event_cb, LV_EVENT_ALL, ta);
|
lv_obj_add_event_cb(calendar, calendar_event_cb, LV_EVENT_ALL, ta);
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ Month shown
|
|||||||
-----------
|
-----------
|
||||||
|
|
||||||
To set the shown date, use
|
To set the shown date, use
|
||||||
:cpp:expr:`lv_calendar_set_showed_date(calendar, year, month)`
|
:cpp:expr:`lv_calendar_set_month_shown(calendar, year, month)`
|
||||||
|
|
||||||
Highlighted days
|
Highlighted days
|
||||||
----------------
|
----------------
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ You have several options to set the Y-values for a data series:
|
|||||||
the zero-based index of the point you wish to update.
|
the zero-based index of the point you wish to update.
|
||||||
3. Use :cpp:expr:`lv_chart_set_next_value(chart, series, value)`.
|
3. Use :cpp:expr:`lv_chart_set_next_value(chart, series, value)`.
|
||||||
(See `Update modes`_ below.)
|
(See `Update modes`_ below.)
|
||||||
4. Set all points to a single Y-value with :cpp:expr:`lv_chart_set_all_value(chart, series, value)`.
|
4. Set all points to a single Y-value with :cpp:expr:`lv_chart_set_all_values(chart, series, value)`.
|
||||||
|
|
||||||
Use :c:macro:`LV_CHART_POINT_NONE` as value to make the library skip drawing
|
Use :c:macro:`LV_CHART_POINT_NONE` as value to make the library skip drawing
|
||||||
that point, column, or scatter-point.
|
that point, column, or scatter-point.
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ void lv_example_calendar_1(void)
|
|||||||
lv_obj_add_event_cb(calendar, event_handler, LV_EVENT_ALL, NULL);
|
lv_obj_add_event_cb(calendar, event_handler, LV_EVENT_ALL, NULL);
|
||||||
|
|
||||||
lv_calendar_set_today_date(calendar, 2021, 02, 23);
|
lv_calendar_set_today_date(calendar, 2021, 02, 23);
|
||||||
lv_calendar_set_showed_date(calendar, 2021, 02);
|
lv_calendar_set_month_shown(calendar, 2021, 02);
|
||||||
|
|
||||||
/*Highlight a few days*/
|
/*Highlight a few days*/
|
||||||
static lv_calendar_date_t highlighted_days[3]; /*Only its pointer will be saved so should be static*/
|
static lv_calendar_date_t highlighted_days[3]; /*Only its pointer will be saved so should be static*/
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ void lv_example_calendar_2(void)
|
|||||||
lv_obj_align(calendar, LV_ALIGN_TOP_MID, 0, 0);
|
lv_obj_align(calendar, LV_ALIGN_TOP_MID, 0, 0);
|
||||||
|
|
||||||
lv_calendar_set_today_date(calendar, 2024, 03, 22);
|
lv_calendar_set_today_date(calendar, 2024, 03, 22);
|
||||||
lv_calendar_set_showed_date(calendar, 2024, 03);
|
lv_calendar_set_month_shown(calendar, 2024, 03);
|
||||||
|
|
||||||
#if LV_USE_CALENDAR_HEADER_DROPDOWN
|
#if LV_USE_CALENDAR_HEADER_DROPDOWN
|
||||||
lv_calendar_header_dropdown_create(calendar);
|
lv_calendar_header_dropdown_create(calendar);
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ extern "C" {
|
|||||||
#define _lv_disp_get_refr_timer lv_disp_get_refr_timer
|
#define _lv_disp_get_refr_timer lv_disp_get_refr_timer
|
||||||
|
|
||||||
#define _lv_inv_area lv_inv_area
|
#define _lv_inv_area lv_inv_area
|
||||||
|
#define lv_chart_set_all_value lv_chart_set_all_values
|
||||||
|
#define lv_calendar_set_showed_date lv_calendar_set_month_shown
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* DEPRECATED FUNCTIONS
|
* DEPRECATED FUNCTIONS
|
||||||
@@ -87,4 +89,4 @@ extern "C" {
|
|||||||
} /*extern "C"*/
|
} /*extern "C"*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /*LV_API_MAP_V9_0_H*/
|
#endif /* LV_API_MAP_V9_1_H */
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highli
|
|||||||
highlight_update(obj);
|
highlight_update(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_calendar_set_showed_date(lv_obj_t * obj, uint32_t year, uint32_t month)
|
void lv_calendar_set_month_shown(lv_obj_t * obj, uint32_t year, uint32_t month)
|
||||||
{
|
{
|
||||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||||
lv_calendar_t * calendar = (lv_calendar_t *)obj;
|
lv_calendar_t * calendar = (lv_calendar_t *)obj;
|
||||||
@@ -332,7 +332,7 @@ static void lv_calendar_constructor(const lv_obj_class_t * class_p, lv_obj_t * o
|
|||||||
|
|
||||||
lv_obj_set_style_text_align(obj, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN);
|
lv_obj_set_style_text_align(obj, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN);
|
||||||
|
|
||||||
lv_calendar_set_showed_date(obj, calendar->showed_date.year, calendar->showed_date.month);
|
lv_calendar_set_month_shown(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_calendar_set_today_date(obj, calendar->today.year, calendar->today.month, calendar->today.day);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ void lv_calendar_set_today_date(lv_obj_t * obj, uint32_t year, uint32_t month, u
|
|||||||
* @param year today's year
|
* @param year today's year
|
||||||
* @param month today's month [1..12]
|
* @param month today's month [1..12]
|
||||||
*/
|
*/
|
||||||
void lv_calendar_set_showed_date(lv_obj_t * obj, uint32_t year, uint32_t month);
|
void lv_calendar_set_month_shown(lv_obj_t * obj, uint32_t year, uint32_t month);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the highlighted dates
|
* Set the highlighted dates
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ void lv_calendar_set_chinese_mode(lv_obj_t * obj, bool en)
|
|||||||
{
|
{
|
||||||
lv_calendar_t * calendar = (lv_calendar_t *)obj;
|
lv_calendar_t * calendar = (lv_calendar_t *)obj;
|
||||||
calendar->use_chinese_calendar = en;
|
calendar->use_chinese_calendar = en;
|
||||||
lv_calendar_set_showed_date(obj, calendar->today.year, calendar->today.month);
|
lv_calendar_set_month_shown(obj, calendar->today.year, calendar->today.month);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * lv_calendar_get_day_name(lv_calendar_date_t * gregorian)
|
const char * lv_calendar_get_day_name(lv_calendar_date_t * gregorian)
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ static void month_event_cb(lv_event_t * e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_calendar_set_showed_date(calendar, newd.year, newd.month);
|
lv_calendar_set_month_shown(calendar, newd.year, newd.month);
|
||||||
|
|
||||||
lv_obj_t * label = lv_obj_get_child(header, 1);
|
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]);
|
lv_label_set_text_fmt(label, "%d %s", newd.year, month_names_def[newd.month - 1]);
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ static void month_event_cb(lv_event_t * e)
|
|||||||
lv_calendar_date_t newd = *d;
|
lv_calendar_date_t newd = *d;
|
||||||
newd.month = sel + 1;
|
newd.month = sel + 1;
|
||||||
|
|
||||||
lv_calendar_set_showed_date(calendar, newd.year, newd.month);
|
lv_calendar_set_month_shown(calendar, newd.year, newd.month);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void year_event_cb(lv_event_t * e)
|
static void year_event_cb(lv_event_t * e)
|
||||||
@@ -157,7 +157,7 @@ static void year_event_cb(lv_event_t * e)
|
|||||||
lv_calendar_date_t newd = *d;
|
lv_calendar_date_t newd = *d;
|
||||||
newd.year = year - sel;
|
newd.year = year - sel;
|
||||||
|
|
||||||
lv_calendar_set_showed_date(calendar, newd.year, newd.month);
|
lv_calendar_set_month_shown(calendar, newd.year, newd.month);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void value_changed_event_cb(lv_event_t * e)
|
static void value_changed_event_cb(lv_event_t * e)
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ lv_point_t lv_chart_get_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * curso
|
|||||||
* Set/Get value(s)
|
* Set/Get value(s)
|
||||||
*====================*/
|
*====================*/
|
||||||
|
|
||||||
void lv_chart_set_all_value(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value)
|
void lv_chart_set_all_values(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value)
|
||||||
{
|
{
|
||||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||||
LV_ASSERT_NULL(ser);
|
LV_ASSERT_NULL(ser);
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ lv_point_t lv_chart_get_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * curso
|
|||||||
* @param ser pointer to a data series on 'chart'
|
* @param ser pointer to a data series on 'chart'
|
||||||
* @param value the new value for all points. `LV_CHART_POINT_NONE` can be used to hide the points.
|
* @param value the new value for all points. `LV_CHART_POINT_NONE` can be used to hide the points.
|
||||||
*/
|
*/
|
||||||
void lv_chart_set_all_value(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value);
|
void lv_chart_set_all_values(lv_obj_t * obj, lv_chart_series_t * ser, int32_t value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the next point's Y value according to the update mode policy.
|
* Set the next point's Y value according to the update mode policy.
|
||||||
|
|||||||
Reference in New Issue
Block a user