lv_bar.h

Typedefs

typedef _lv_bar_mode_t lv_bar_mode_t

Enums

enum _lv_bar_mode_t

Values:

enumerator LV_BAR_MODE_NORMAL
enumerator LV_BAR_MODE_SYMMETRICAL
enumerator LV_BAR_MODE_RANGE

Functions

lv_obj_t *lv_bar_create(lv_obj_t *parent)

Create a bar object

参数:

parent -- pointer to an object, it will be the parent of the new bar

返回:

pointer to the created bar

void lv_bar_set_value(lv_obj_t *obj, int32_t value, lv_anim_enable_t anim)

Set a new value on the bar

参数:
  • obj -- pointer to a bar object

  • value -- new value

  • anim -- LV_ANIM_ON: set the value with an animation; LV_ANIM_OFF: change the value immediately

void lv_bar_set_start_value(lv_obj_t *obj, int32_t start_value, lv_anim_enable_t anim)

Set a new start value on the bar

参数:
  • obj -- pointer to a bar object

  • start_value -- new start value

  • anim -- LV_ANIM_ON: set the value with an animation; LV_ANIM_OFF: change the value immediately

void lv_bar_set_range(lv_obj_t *obj, int32_t min, int32_t max)

Set minimum and the maximum values of a bar

备注

If min is greater than max, the drawing direction becomes to the oppsite direction.

参数:
  • obj -- pointer to the bar object

  • min -- minimum value

  • max -- maximum value

void lv_bar_set_mode(lv_obj_t *obj, lv_bar_mode_t mode)

Set the type of bar.

参数:
  • obj -- pointer to bar object

  • mode -- bar type from ::lv_bar_mode_t

int32_t lv_bar_get_value(const lv_obj_t *obj)

Get the value of a bar

参数:

obj -- pointer to a bar object

返回:

the value of the bar

int32_t lv_bar_get_start_value(const lv_obj_t *obj)

Get the start value of a bar

参数:

obj -- pointer to a bar object

返回:

the start value of the bar

int32_t lv_bar_get_min_value(const lv_obj_t *obj)

Get the minimum value of a bar

参数:

obj -- pointer to a bar object

返回:

the minimum value of the bar

int32_t lv_bar_get_max_value(const lv_obj_t *obj)

Get the maximum value of a bar

参数:

obj -- pointer to a bar object

返回:

the maximum value of the bar

lv_bar_mode_t lv_bar_get_mode(lv_obj_t *obj)

Get the type of bar.

参数:

obj -- pointer to bar object

返回:

bar type from ::lv_bar_mode_t

bool lv_bar_is_symmetrical(lv_obj_t *obj)

Give the bar is in symmetrical mode or not

参数:

obj -- pointer to bar object

返回:

true: in symmetrical mode false : not in

Variables

const lv_obj_class_t lv_bar_class
struct _lv_bar_anim_t

Public Members

lv_obj_t *bar
int32_t anim_start
int32_t anim_end
int32_t anim_state
struct lv_bar_t

Public Members

lv_obj_t obj
int32_t cur_value

Current value of the bar

int32_t min_value

Minimum value of the bar

int32_t max_value

Maximum value of the bar

int32_t start_value

Start value of the bar

lv_area_t indic_area

Save the indicator area. Might be used by derived types

bool val_reversed

Whether value been reversed

_lv_bar_anim_t cur_value_anim
_lv_bar_anim_t start_value_anim
lv_bar_mode_t mode

Type of bar