lv_spinbox.h
API reference for lv_spinbox.h
Functions
lv_spinbox_set_value
Set spinbox value
void lv_spinbox_set_value(lv_obj_t *obj, int32_t v)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
v | int32_t | value to be set |
lv_spinbox_set_rollover
Set spinbox rollover function
void lv_spinbox_set_rollover(lv_obj_t *obj, bool rollover)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
rollover | bool | true or false to enable or disable (default) |
lv_spinbox_set_digit_format
Set spinbox digit format (digit count and decimal format)
void lv_spinbox_set_digit_format(lv_obj_t *obj, uint32_t digit_count, uint32_t sep_pos)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
digit_count | uint32_t | number of digit excluding the decimal separator and the sign |
sep_pos | uint32_t | number of digit before the decimal point. If 0, decimal point is not shown |
lv_spinbox_set_digit_count
Set the number of digits
void lv_spinbox_set_digit_count(lv_obj_t *obj, uint32_t digit_count)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
digit_count | uint32_t | number of digits |
lv_spinbox_set_dec_point_pos
Set the position of the decimal point
void lv_spinbox_set_dec_point_pos(lv_obj_t *obj, uint32_t dec_point_pos)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
dec_point_pos | uint32_t | 0: there is no separator, 2: two integer digits |
lv_spinbox_set_step
Set spinbox step
void lv_spinbox_set_step(lv_obj_t *obj, uint32_t step)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
step | uint32_t | steps on increment/decrement. Can be 1, 10, 100, 1000, etc the digit that will change. |
lv_spinbox_set_range
Set spinbox value range
void lv_spinbox_set_range(lv_obj_t *obj, int32_t min_value, int32_t max_value)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
min_value | int32_t | minimum value, inclusive |
max_value | int32_t | maximum value, inclusive |
lv_spinbox_set_min_value
Set the minimum value
void lv_spinbox_set_min_value(lv_obj_t *obj, int32_t min_value)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
min_value | int32_t | the minimum value |
lv_spinbox_set_max_value
Set the maximum value
void lv_spinbox_set_max_value(lv_obj_t *obj, int32_t max_value)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
max_value | int32_t | the maximum value |
lv_spinbox_set_cursor_pos
Set cursor position to a specific digit for edition
void lv_spinbox_set_cursor_pos(lv_obj_t *obj, uint32_t pos)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
pos | uint32_t | selected position in spinbox |
lv_spinbox_set_digit_step_direction
Set direction of digit step when clicking an encoder button while in editing mode
void lv_spinbox_set_digit_step_direction(lv_obj_t *obj, lv_dir_t direction)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
direction | lv_dir_t | the direction (LV_DIR_RIGHT or LV_DIR_LEFT) |
lv_spinbox_get_rollover
Get spinbox rollover function status
bool lv_spinbox_get_rollover(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
lv_spinbox_get_value
Get the spinbox numeral value (user has to convert to float according to its digit format)
int32_t lv_spinbox_get_value(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
Returns: int32_t — value integer value of the spinbox
lv_spinbox_get_step
Get the spinbox step value (user has to convert to float according to its digit format)
int32_t lv_spinbox_get_step(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
Returns: int32_t — value integer step value of the spinbox
lv_spinbox_get_digit_count
Get the spinbox digit count
uint32_t lv_spinbox_get_digit_count(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
Returns: uint32_t — number of digits
lv_spinbox_get_dec_point_pos
Get the decimal point position
uint32_t lv_spinbox_get_dec_point_pos(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
Returns: uint32_t — decimal point position
lv_spinbox_get_min_value
Get the spinbox minimum value
int32_t lv_spinbox_get_min_value(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
Returns: int32_t — minimum value
lv_spinbox_get_max_value
Get the spinbox maximum value
int32_t lv_spinbox_get_max_value(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
Returns: int32_t — maximum value
lv_spinbox_get_digit_step_direction
Get the digit step direction
lv_dir_t lv_spinbox_get_digit_step_direction(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
Returns: lv_dir_t — direction (LV_DIR_RIGHT or LV_DIR_LEFT)
lv_spinbox_create
Create a spinbox object
lv_obj_t * lv_spinbox_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 to the created spinbox
lv_spinbox_step_next
Select next lower digit for edition by dividing the step by 10
void lv_spinbox_step_next(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
lv_spinbox_step_prev
Select next higher digit for edition by multiplying the step by 10
void lv_spinbox_step_prev(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
lv_spinbox_increment
Increment spinbox value by one step
void lv_spinbox_increment(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
lv_spinbox_decrement
Decrement spinbox value by one step
void lv_spinbox_decrement(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to spinbox |
lv_spinbox_bind_value
Bind an integer subject to a Spinbox's value.
lv_observer_t * lv_spinbox_bind_value(lv_obj_t *obj, lv_subject_t *subject)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Spinbox |
subject | lv_subject_t * | pointer to Subject |
Returns: lv_observer_t * — pointer to newly-created Observer
Enums
_lv_property_spinbox_id_t
| Name | Value |
|---|---|
LV_PROPERTY_SPINBOX_VALUE | (LV_PROPERTY_SPINBOX_START + ((int) 0 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SPINBOX_ROLLOVER | (LV_PROPERTY_SPINBOX_START + ((int) 1 )) | (( 11 ) << 28 ) |
LV_PROPERTY_SPINBOX_DIGIT_COUNT | (LV_PROPERTY_SPINBOX_START + ((int) 2 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SPINBOX_DEC_POINT_POS | (LV_PROPERTY_SPINBOX_START + ((int) 3 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SPINBOX_STEP | (LV_PROPERTY_SPINBOX_START + ((int) 4 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SPINBOX_MIN_VALUE | (LV_PROPERTY_SPINBOX_START + ((int) 5 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SPINBOX_MAX_VALUE | (LV_PROPERTY_SPINBOX_START + ((int) 6 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SPINBOX_DIGIT_STEP_DIRECTION | (LV_PROPERTY_SPINBOX_START + ((int) 7 )) | (( 1 ) << 28 ) |
LV_PROPERTY_SPINBOX_END |
Macros
LV_SPINBOX_MAX_DIGIT_COUNT
#define LV_SPINBOX_MAX_DIGIT_COUNT 10Variables
lv_spinbox_class
const lv_obj_class_t lv_spinbox_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_label.hlv_layout.hlv_ll.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_observer.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