diff --git a/lv_objx/lv_cb.c b/lv_objx/lv_cb.c index e6fc49454..63a8005ce 100644 --- a/lv_objx/lv_cb.c +++ b/lv_objx/lv_cb.c @@ -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 diff --git a/lv_objx/lv_cb.h b/lv_objx/lv_cb.h index b58773341..45f33ee87 100644 --- a/lv_objx/lv_cb.h +++ b/lv_objx/lv_cb.h @@ -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 diff --git a/lv_objx/lv_kb.c b/lv_objx/lv_kb.c index 01f654681..a5545bcfa 100644 --- a/lv_objx/lv_kb.c +++ b/lv_objx/lv_kb.c @@ -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