1
0
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:
embeddedt 2019-03-01 07:26:17 -05:00 committed by GitHub
commit 2ffeef667f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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