lv_spinbox.h

API reference for lv_spinbox.h

Report on GitHub
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_spinbox_private.h

Functions

lv_spinbox_set_value

Set spinbox value

 
void lv_spinbox_set_value(lv_obj_t *obj, int32_t v)
Parameters
NameTypeDescription
objlv_obj_t *pointer to spinbox
vint32_tvalue to be set

lv_spinbox_set_rollover

Set spinbox rollover function

 
void lv_spinbox_set_rollover(lv_obj_t *obj, bool rollover)
Parameters
NameTypeDescription
objlv_obj_t *pointer to spinbox
rolloverbooltrue 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to spinbox
digit_countuint32_tnumber of digit excluding the decimal separator and the sign
sep_posuint32_tnumber 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to spinbox
digit_countuint32_tnumber 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to spinbox
dec_point_posuint32_t0: 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to spinbox
stepuint32_tsteps 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to spinbox
min_valueint32_tminimum value, inclusive
max_valueint32_tmaximum 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to spinbox
min_valueint32_tthe 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to spinbox
max_valueint32_tthe 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to spinbox
posuint32_tselected 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to spinbox
directionlv_dir_tthe direction (LV_DIR_RIGHT or LV_DIR_LEFT)

Enums

_lv_property_spinbox_id_t

NameValue
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 10

Variables

lv_spinbox_class

 
const lv_obj_class_t lv_spinbox_class

Dependencies

How is this guide?

Last updated on

On this page