mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-21 06:53:01 +08:00
Merge pull request #918 from canardos/dev-6.0
add lv_cb_set_static_text function, fix incorrect kb_ctrl_num_map
This commit is contained in:
commit
2ffeef667f
@ -120,9 +120,10 @@ lv_obj_t * lv_cb_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
*====================*/
|
||||
|
||||
/**
|
||||
* Set the text of a check box
|
||||
* Set the text of a check box. `txt` will be copied and may be deallocated
|
||||
* after this function returns.
|
||||
* @param cb pointer to a check box
|
||||
* @param txt the text of the check box
|
||||
* @param txt the text of the check box. NULL to refresh with the current text.
|
||||
*/
|
||||
void lv_cb_set_text(lv_obj_t * cb, const char * txt)
|
||||
{
|
||||
@ -130,6 +131,17 @@ void lv_cb_set_text(lv_obj_t * cb, const char * txt)
|
||||
lv_label_set_text(ext->label, txt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the text of a check box. `txt` must not be deallocated during the life
|
||||
* of this checkbox.
|
||||
* @param cb pointer to a check box
|
||||
* @param txt the text of the check box. NULL to refresh with the current text.
|
||||
*/
|
||||
void lv_cb_set_static_text(lv_obj_t * cb, const char * txt) {
|
||||
lv_cb_ext_t * ext = lv_obj_get_ext_attr(cb);
|
||||
lv_label_set_static_text(ext->label, txt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a style of a check box
|
||||
* @param cb pointer to check box object
|
||||
|
@ -78,12 +78,21 @@ lv_obj_t * lv_cb_create(lv_obj_t * par, const lv_obj_t * copy);
|
||||
*====================*/
|
||||
|
||||
/**
|
||||
* Set the text of a check box
|
||||
* Set the text of a check box. `txt` will be copied and may be deallocated
|
||||
* after this function returns.
|
||||
* @param cb pointer to a check box
|
||||
* @param txt the text of the check box
|
||||
* @param txt the text of the check box. NULL to refresh with the current text.
|
||||
*/
|
||||
void lv_cb_set_text(lv_obj_t * cb, const char * txt);
|
||||
|
||||
/**
|
||||
* Set the text of a check box. `txt` must not be deallocated during the life
|
||||
* of this checkbox.
|
||||
* @param cb pointer to a check box
|
||||
* @param txt the text of the check box. NULL to refresh with the current text.
|
||||
*/
|
||||
void lv_cb_set_static_text(lv_obj_t * cb, const char * txt);
|
||||
|
||||
/**
|
||||
* Set the state of the check box
|
||||
* @param cb pointer to a check box object
|
||||
|
@ -82,6 +82,7 @@ static const char * kb_map_num[] = {
|
||||
};
|
||||
|
||||
static const lv_btnm_ctrl_t kb_ctrl_num_map[] = {
|
||||
1, 1, 1, 2,
|
||||
1, 1, 1, 2,
|
||||
1, 1, 1, 2,
|
||||
1, 1, 1, 1, 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user