fix edit_set_int/set_double(issue #250)

This commit is contained in:
lixianjing 2019-10-14 13:09:51 +08:00
parent 7d1213d4b1
commit ebbc4160dc
2 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,7 @@
* 2019/10/14
* 修改widget\_set\_value把value当uint32的BUG.
* edit\_set\_int/double后调用text layout感谢俊杰提供补丁
* 2019/10/13
* 增加stream\_shdlc文档。

View File

@ -941,16 +941,22 @@ double edit_get_double(widget_t* widget) {
}
ret_t edit_set_int(widget_t* widget, int32_t value) {
edit_t* edit = EDIT(widget);
return_value_if_fail(widget != NULL, RET_BAD_PARAMS);
wstr_from_int(&(widget->text), value);
text_edit_layout(edit->model);
return RET_OK;
}
ret_t edit_set_double(widget_t* widget, double value) {
edit_t* edit = EDIT(widget);
return_value_if_fail(widget != NULL, RET_BAD_PARAMS);
wstr_from_float(&(widget->text), value);
text_edit_layout(edit->model);
return RET_OK;
}