spinbox: add inc/dec event callbacks to be used with +/- buttons created for the spinbox
This commit is contained in:
@@ -314,6 +314,30 @@ void lv_spinbox_decrement(lv_obj_t * spinbox)
|
|||||||
lv_spinbox_updatevalue(spinbox);
|
lv_spinbox_updatevalue(spinbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An event callback which can ne simply used for a "+" button
|
||||||
|
* @param spinbox pointer to spinbox
|
||||||
|
* @param e the event (`LV_EVENT_...`)
|
||||||
|
*/
|
||||||
|
void lv_spinbox_increment_event_cb(lv_obj_t * spinbox, lv_event_t e)
|
||||||
|
{
|
||||||
|
if(e == LV_EVENT_SHORT_CLICKED || e == LV_EVENT_LONG_PRESSED_REPEAT) {
|
||||||
|
lv_spinbox_increment(spinbox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An event callback which can be simply used for a "-" button
|
||||||
|
* @param spinbox pointer to spinbox
|
||||||
|
* @param e the event (`LV_EVENT_...`)
|
||||||
|
*/
|
||||||
|
void lv_spinbox_decrement_event_cb(lv_obj_t * spinbox, lv_event_t e)
|
||||||
|
{
|
||||||
|
if(e == LV_EVENT_SHORT_CLICKED || e == LV_EVENT_LONG_PRESSED_REPEAT) {
|
||||||
|
lv_spinbox_decrement(spinbox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC FUNCTIONS
|
* STATIC FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
@@ -150,7 +150,19 @@ void lv_spinbox_increment(lv_obj_t * spinbox);
|
|||||||
* @param spinbox pointer to spinbox
|
* @param spinbox pointer to spinbox
|
||||||
*/
|
*/
|
||||||
void lv_spinbox_decrement(lv_obj_t * spinbox);
|
void lv_spinbox_decrement(lv_obj_t * spinbox);
|
||||||
|
/**
|
||||||
|
* An event callback which can ne simply used for a "+" button
|
||||||
|
* @param spinbox pointer to spinbox
|
||||||
|
* @param e the event (`LV_EVENT_...`)
|
||||||
|
*/
|
||||||
|
void lv_spinbox_increment_event_cb(lv_obj_t * spinbox, lv_event_t e);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An event callback which can be simply used for a "-" button
|
||||||
|
* @param spinbox pointer to spinbox
|
||||||
|
* @param e the event (`LV_EVENT_...`)
|
||||||
|
*/
|
||||||
|
void lv_spinbox_decrement_event_cb(lv_obj_t * spinbox, lv_event_t e);
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
Reference in New Issue
Block a user