impromve edit

This commit is contained in:
xianjimli 2019-02-04 08:40:12 +08:00
parent cbb6adc992
commit 19c8ce6a74
3 changed files with 10 additions and 1 deletions

View File

@ -2,6 +2,7 @@
* 2019/02/04
* 增加测试程序。
* 更新资源。
* edit处理属性value。
* 2019/02/03
* 增加object\_notify\_changed。

View File

@ -72,7 +72,7 @@ BEGIN_C_DECLS
* ```c
* widget_on(slide_menu, EVT_VALUE_CHANGED, on_current_changed, slide_menu);
* ```
*
*
* ```c

View File

@ -826,6 +826,9 @@ ret_t edit_get_prop(widget_t* widget, const char* name, value_t* v) {
} else if (tk_str_eq(name, WIDGET_PROP_TIPS)) {
value_set_str(v, edit->tips);
return RET_OK;
} else if (tk_str_eq(name, WIDGET_PROP_VALUE)) {
value_set_wstr(v, widget->text.str);
return RET_OK;
}
return RET_NOT_FOUND;
@ -914,6 +917,11 @@ ret_t edit_set_prop(widget_t* widget, const char* name, const value_t* v) {
edit->offset_x = 0;
edit_set_cursor_pos(widget, 0x0fffffff, 0x0fffffff);
return RET_OK;
} else if (tk_str_eq(name, WIDGET_PROP_VALUE)) {
edit->offset_x = 0;
edit_set_cursor_pos(widget, 0x0fffffff, 0x0fffffff);
wstr_from_value(&(widget->text), v);
return RET_OK;
}
edit_update_status(widget);