mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-03 04:27:44 +08:00
add EVT_WIDGET_LOAD event
This commit is contained in:
parent
8169cf9383
commit
a2d4763bc3
@ -241,6 +241,11 @@ typedef enum _event_type_t {
|
|||||||
* 窗口加载完成事件(event_t)。
|
* 窗口加载完成事件(event_t)。
|
||||||
*/
|
*/
|
||||||
EVT_WINDOW_LOAD,
|
EVT_WINDOW_LOAD,
|
||||||
|
/**
|
||||||
|
* @const EVT_WIDGET_LOAD
|
||||||
|
* 控件加载完成事件(event_t)。
|
||||||
|
*/
|
||||||
|
EVT_WIDGET_LOAD,
|
||||||
/**
|
/**
|
||||||
* @const EVT_WINDOW_WILL_OPEN
|
* @const EVT_WINDOW_WILL_OPEN
|
||||||
* 窗口即将打开事件(event_t)。
|
* 窗口即将打开事件(event_t)。
|
||||||
|
@ -373,6 +373,12 @@ struct _widget_t {
|
|||||||
* 标识控件正在初始化。
|
* 标识控件正在初始化。
|
||||||
*/
|
*/
|
||||||
uint8_t initializing : 1;
|
uint8_t initializing : 1;
|
||||||
|
/**
|
||||||
|
* @property {bool_t} loading
|
||||||
|
* @annotation ["readable"]
|
||||||
|
* 标识控件正在加载。
|
||||||
|
*/
|
||||||
|
uint8_t loading : 1;
|
||||||
/**
|
/**
|
||||||
* @property {bool_t} destroying
|
* @property {bool_t} destroying
|
||||||
* @annotation ["readable"]
|
* @annotation ["readable"]
|
||||||
|
@ -44,6 +44,7 @@ static ret_t ui_builder_default_on_widget_start(ui_builder_t* b, const widget_de
|
|||||||
}
|
}
|
||||||
|
|
||||||
b->widget = widget;
|
b->widget = widget;
|
||||||
|
b->widget->loading = TRUE;
|
||||||
if (b->root == NULL) {
|
if (b->root == NULL) {
|
||||||
b->root = widget;
|
b->root = widget;
|
||||||
}
|
}
|
||||||
@ -61,7 +62,12 @@ static ret_t ui_builder_default_on_widget_prop(ui_builder_t* b, const char* name
|
|||||||
}
|
}
|
||||||
|
|
||||||
static ret_t ui_builder_default_on_widget_prop_end(ui_builder_t* b) {
|
static ret_t ui_builder_default_on_widget_prop_end(ui_builder_t* b) {
|
||||||
(void)b;
|
if (b->widget != NULL) {
|
||||||
|
event_t e = event_init(EVT_WIDGET_LOAD, NULL);
|
||||||
|
widget_dispatch(b->widget, &e);
|
||||||
|
|
||||||
|
b->widget->loading = FALSE;
|
||||||
|
}
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user