lv_bar.h

Enums

enum lv_bar_mode_t

Values:

enumerator LV_BAR_MODE_NORMAL
enumerator LV_BAR_MODE_SYMMETRICAL
enumerator LV_BAR_MODE_RANGE
enum lv_bar_orientation_t

Values:

enumerator LV_BAR_ORIENTATION_AUTO
enumerator LV_BAR_ORIENTATION_HORIZONTAL
enumerator LV_BAR_ORIENTATION_VERTICAL

Functions

lv_obj_t *lv_bar_create(lv_obj_t *parent)

Create a bar object

Parameters:

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

Returns:

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

Parameters:
  • 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

Parameters:
  • 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

Note

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

Parameters:
  • 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.

Parameters:
  • obj – pointer to bar object

  • mode – bar type from ::lv_bar_mode_t

void lv_bar_set_orientation(lv_obj_t *obj, lv_bar_orientation_t orientation)

Set the orientation of bar.

Parameters:
  • obj – pointer to bar object

  • orientation – bar orientation from lv_bar_orientation_t

int32_t lv_bar_get_value(const lv_obj_t *obj)

Get the value of a bar

Parameters:

obj – pointer to a bar object

Returns:

the value of the bar

int32_t lv_bar_get_start_value(const lv_obj_t *obj)

Get the start value of a bar

Parameters:

obj – pointer to a bar object

Returns:

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

Parameters:

obj – pointer to a bar object

Returns:

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

Parameters:

obj – pointer to a bar object

Returns:

the maximum value of the bar

lv_bar_mode_t lv_bar_get_mode(lv_obj_t *obj)

Get the type of bar.

Parameters:

obj – pointer to bar object

Returns:

bar type from ::lv_bar_mode_t

lv_bar_orientation_t lv_bar_get_orientation(lv_obj_t *obj)

Get the orientation of bar.

Parameters:

obj – pointer to bar object

Returns:

bar orientation from ::lv_bar_orientation_t

bool lv_bar_is_symmetrical(lv_obj_t *obj)

Give the bar is in symmetrical mode or not

Parameters:

obj – pointer to bar object

Returns:

true: in symmetrical mode false : not in

Variables

const lv_obj_class_t lv_bar_class