lv_slider.h

Typedefs

typedef _lv_slider_mode_t lv_slider_mode_t

Enums

enum _lv_slider_mode_t

Values:

enumerator LV_SLIDER_MODE_NORMAL
enumerator LV_SLIDER_MODE_SYMMETRICAL
enumerator LV_SLIDER_MODE_RANGE

Functions

lv_obj_t *lv_slider_create(lv_obj_t *parent)

Create a slider object

参数:

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

返回:

pointer to the created slider

static inline void lv_slider_set_value(lv_obj_t *obj, int32_t value, lv_anim_enable_t anim)

Set a new value on the slider

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

  • value -- the new value

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

static inline void lv_slider_set_left_value(lv_obj_t *obj, int32_t value, lv_anim_enable_t anim)

Set a new value for the left knob of a slider

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

  • value -- new value

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

static inline void lv_slider_set_range(lv_obj_t *obj, int32_t min, int32_t max)

Set minimum and the maximum values of a bar

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

  • min -- minimum value

  • max -- maximum value

static inline void lv_slider_set_mode(lv_obj_t *obj, lv_slider_mode_t mode)

Set the mode of slider.

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

  • mode -- the mode of the slider. See ::lv_slider_mode_t

static inline int32_t lv_slider_get_value(const lv_obj_t *obj)

Get the value of the main knob of a slider

参数:

obj -- pointer to a slider object

返回:

the value of the main knob of the slider

static inline int32_t lv_slider_get_left_value(const lv_obj_t *obj)

Get the value of the left knob of a slider

参数:

obj -- pointer to a slider object

返回:

the value of the left knob of the slider

static inline int32_t lv_slider_get_min_value(const lv_obj_t *obj)

Get the minimum value of a slider

参数:

obj -- pointer to a slider object

返回:

the minimum value of the slider

static inline int32_t lv_slider_get_max_value(const lv_obj_t *obj)

Get the maximum value of a slider

参数:

obj -- pointer to a slider object

返回:

the maximum value of the slider

bool lv_slider_is_dragged(const lv_obj_t *obj)

Give the slider is being dragged or not

参数:

obj -- pointer to a slider object

返回:

true: drag in progress false: not dragged

static inline lv_slider_mode_t lv_slider_get_mode(lv_obj_t *slider)

Get the mode of the slider.

参数:

slider -- pointer to a slider object

返回:

see ::lv_slider_mode_t

static inline bool lv_slider_is_symmetrical(lv_obj_t *obj)

Give the slider is in symmetrical mode or not

参数:

obj -- pointer to slider object

返回:

true: in symmetrical mode false : not in

Variables

const lv_obj_class_t lv_slider_class
struct lv_slider_t

Public Members

lv_bar_t bar
lv_area_t left_knob_area
lv_area_t right_knob_area
lv_point_t pressed_point
int32_t *value_to_set
uint8_t dragging
uint8_t left_knob_focus