mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
fix(spinbox): rename lv_spinbox_set_pos to lv_spinbox_set_cursor_pos
fixes #3301
This commit is contained in:
parent
c7ca38f1d5
commit
a99eb6bb6a
@ -20,7 +20,7 @@ The parts of the Spinbox are identical to the [Text area](/widgets/core/textarea
|
||||
|
||||
`lv_spinbox_set_step(spinbox, 100)` sets which digits to change on increment/decrement. Only multiples of ten can be set, and not for example 3.
|
||||
|
||||
`lv_spinbox_set_pos(spinbox, 1)` sets the cursor to a specific digit to change on increment/decrement. For example position '0' sets the cursor to the least significant digit.
|
||||
`lv_spinbox_set_cursor_pos(spinbox, 1)` sets the cursor to a specific digit to change on increment/decrement. For example position '0' sets the cursor to the least significant digit.
|
||||
|
||||
If an encoder is used as input device, the selected digit is shifted to the right by default whenever the encoder button is clicked. To change this behaviour to shifting to the left, the `lv_spinbox_set_digit_step_direction(spinbox, LV_DIR_LEFT)` can be used
|
||||
|
||||
|
@ -157,7 +157,7 @@ void lv_spinbox_set_range(lv_obj_t * obj, int32_t range_min, int32_t range_max)
|
||||
* @param spinbox pointer to spinbox
|
||||
* @param pos selected position in spinbox
|
||||
*/
|
||||
void lv_spinbox_set_pos(lv_obj_t * obj, uint8_t pos)
|
||||
void lv_spinbox_set_cursor_pos(lv_obj_t * obj, uint8_t pos)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
lv_spinbox_t * spinbox = (lv_spinbox_t *)obj;
|
||||
|
@ -105,7 +105,7 @@ void lv_spinbox_set_range(lv_obj_t * obj, int32_t range_min, int32_t range_max);
|
||||
* @param obj pointer to spinbox
|
||||
* @param pos selected position in spinbox
|
||||
*/
|
||||
void lv_spinbox_set_pos(lv_obj_t * obj, uint8_t pos);
|
||||
void lv_spinbox_set_cursor_pos(lv_obj_t * obj, uint8_t pos);
|
||||
|
||||
/**
|
||||
* Set direction of digit step when clicking an encoder button while in editing mode
|
||||
@ -170,6 +170,10 @@ void lv_spinbox_decrement(lv_obj_t * obj);
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/* It was ambiguous in MicroPython. See https://github.com/lvgl/lvgl/issues/3301
|
||||
* TODO remove in v9*/
|
||||
#define lv_spinbox_set_pos lv_spinbox_set_cursor_pos
|
||||
|
||||
#endif /*LV_USE_SPINBOX*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Loading…
x
Reference in New Issue
Block a user