lv_calendar.h
API reference for lv_calendar.h
Functions
lv_calendar_set_today_date
Set the today's year, month and day at once
void lv_calendar_set_today_date(lv_obj_t *obj, uint32_t year, uint32_t month, uint32_t day)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a calendar object |
year | uint32_t | today's year |
month | uint32_t | today's month [1..12] |
day | uint32_t | today's day [1..31] |
lv_calendar_set_today_year
Set the today's year
void lv_calendar_set_today_year(lv_obj_t *obj, uint32_t year)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a calendar object |
year | uint32_t | today's year |
lv_calendar_set_today_month
Set the today's year
void lv_calendar_set_today_month(lv_obj_t *obj, uint32_t month)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a calendar object |
month | uint32_t | today's month [1..12] |
lv_calendar_set_today_day
Set the today's year
void lv_calendar_set_today_day(lv_obj_t *obj, uint32_t day)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a calendar object |
day | uint32_t | today's day [1..31] |
lv_calendar_set_month_shown
Set the currently shown year and month at once
void lv_calendar_set_month_shown(lv_obj_t *obj, uint32_t year, uint32_t month)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a calendar object |
year | uint32_t | shown year |
month | uint32_t | shown month [1..12] |
lv_calendar_set_shown_year
Set the currently shown year
void lv_calendar_set_shown_year(lv_obj_t *obj, uint32_t year)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a calendar object |
year | uint32_t | shown year |
lv_calendar_set_shown_month
Set the currently shown month
void lv_calendar_set_shown_month(lv_obj_t *obj, uint32_t month)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a calendar object |
month | uint32_t | shown month [1..12] |
lv_calendar_set_highlighted_dates
Set the highlighted dates
void lv_calendar_set_highlighted_dates(lv_obj_t *obj, lv_calendar_date_t highlighted[], size_t date_num)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a calendar object |
highlighted | lv_calendar_date_t | 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. |
date_num | size_t | number of dates in the array |
lv_calendar_set_day_names
Set the name of the days
void lv_calendar_set_day_names(lv_obj_t *obj, const char **day_names)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a calendar object |
day_names | const char ** | 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. |
lv_calendar_get_btnmatrix
Get the button matrix object of the calendar. It shows the dates and day names.
lv_obj_t * lv_calendar_get_btnmatrix(const lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | const lv_obj_t * | pointer to a calendar object |
Returns: lv_obj_t * — pointer to a the button matrix
lv_calendar_get_today_date
Get the today's date
const lv_calendar_date_t * lv_calendar_get_today_date(const lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | const lv_obj_t * | pointer to a calendar object |
Returns: const lv_calendar_date_t * — return pointer to an lv_calendar_date_t variable containing the date of today.
lv_calendar_get_showed_date
Get the currently showed
const lv_calendar_date_t * lv_calendar_get_showed_date(const lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | const lv_obj_t * | pointer to a calendar object |
Returns: const lv_calendar_date_t * — pointer to an lv_calendar_date_t variable containing the date is being shown.
lv_calendar_get_highlighted_dates
Get the highlighted dates
lv_calendar_date_t * lv_calendar_get_highlighted_dates(const lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | const lv_obj_t * | pointer to a calendar object |
Returns: lv_calendar_date_t * — pointer to an lv_calendar_date_t array containing the dates.
lv_calendar_get_highlighted_dates_num
Get the number of the highlighted dates
size_t lv_calendar_get_highlighted_dates_num(const lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | const lv_obj_t * | pointer to a calendar object |
Returns: size_t — number of highlighted days
lv_calendar_get_pressed_date
Get the currently pressed day
lv_result_t lv_calendar_get_pressed_date(const lv_obj_t *obj, lv_calendar_date_t *date)| Name | Type | Description |
|---|---|---|
obj | const lv_obj_t * | pointer to a calendar object |
date | lv_calendar_date_t * | store the pressed date here |
Returns: lv_result_t — LV_RESULT_OK: there is a valid pressed date LV_RESULT_INVALID: there is no pressed data
lv_calendar_create
Create a calendar widget
lv_obj_t * lv_calendar_create(lv_obj_t *parent)| Name | Type | Description |
|---|---|---|
parent | lv_obj_t * | pointer to a parent widget May be NULL.. When NULL, the widget is created as a screen on the default display. |
Returns: lv_obj_t * — pointer the created calendar
Structs
lv_calendar_date_t
Represents a date on the calendar object (platform-agnostic).
| Member | Type | Description |
|---|---|---|
year | uint16_t | |
month | uint8_t | 1..12 |
day | uint8_t | 1..31 |
Used by 4 functions
lv_calendar_set_highlighted_dates— paramhighlightedlv_calendar_get_pressed_date— paramdatelv_calendar_get_day_name— paramgregorianlv_calendar_gregorian_to_chinese— paramgregorian_time
Variables
lv_calendar_class
const lv_obj_class_t lv_calendar_classDependencies
Indirect dependencies
lv_anim.hlv_area.hlv_assert.hlv_bidi.hlv_color.hlv_color_op.hlv_conf_internal.hlv_display.hlv_draw.hlv_draw_arc.hlv_draw_blur.hlv_draw_buf.hlv_draw_image.hlv_draw_label.hlv_draw_line.hlv_draw_rect.hlv_draw_triangle.hlv_event.hlv_ext_data.hlv_flex.hlv_font.hlv_fs.hlv_grad.hlv_grid.hlv_group.hlv_image_decoder.hlv_image_dsc.hlv_indev.hlv_layout.hlv_log.hlv_math.hlv_matrix.hlv_mem.hlv_obj.hlv_obj_class.hlv_obj_draw.hlv_obj_event.hlv_obj_pos.hlv_obj_property.hlv_obj_scroll.hlv_obj_style.hlv_obj_style_gen.hlv_obj_tree.hlv_palette.hlv_profiler.hlv_profiler_builtin.hlv_sprintf.hlv_string.hlv_style.hlv_style_gen.hlv_symbol_def.hlv_text.hlv_timer.hlv_types.h
Last updated on