代码拉取完成,页面将自动刷新
可变的style(可实时修改并生效,主要用于在designer中被编辑的控件,或者一些特殊控件)。
函数名称 | 说明 |
---|---|
style_mutable_cast | 转换为style_mutable对象。 |
style_mutable_copy | 将other对象的数据拷贝到s对象。 |
style_mutable_create | 创建style_mutable对象。 |
style_mutable_foreach | 遍历。对每项调用回调函数on_style_item。 |
style_mutable_get_value | 获取指定名称的值。 |
style_mutable_register | 将自己注册到style_factory。 |
style_mutable_set_color | 设置指定名称的颜色值。 |
style_mutable_set_int | 设置指定名称整数格式的值。 |
style_mutable_set_name | 设置style的名称。 |
style_mutable_set_str | 设置指定名称字符串的值。 |
style_mutable_set_value | 设置指定名称的值。 |
属性名称 | 类型 | 说明 |
---|---|---|
name | char* | 名称。 |
转换为style_mutable对象。
style_t* style_mutable_cast (style_t* s);
参数 | 类型 | 说明 |
---|---|---|
返回值 | style_t* | style对象。 |
s | style_t* | style对象。 |
将other对象的数据拷贝到s对象。
ret_t style_mutable_copy (style_t* s, style_t* other);
参数 | 类型 | 说明 |
---|---|---|
返回值 | ret_t | 返回RET_OK表示成功,否则表示失败。 |
s | style_t* | style对象。 |
other | style_t* | style对象。 |
创建style\_mutable对象。
除了测试程序外不需要直接调用,widget会通过style_factory_create创建。
style_t* style_mutable_create (widget_t* widget, style_t* default_style);
参数 | 类型 | 说明 |
---|---|---|
返回值 | style_t* | style对象。 |
widget | widget_t* | 控件 |
default_style | style_t* | 缺省的style。 |
遍历。对每项调用回调函数on\_style\_item。
ret_t style_mutable_foreach (style_t* s, tk_on_style_item_t on_style_item, void* ctx);
参数 | 类型 | 说明 |
---|---|---|
返回值 | ret_t | 返回RET_OK表示成功,否则表示失败。 |
s | style_t* | style对象。 |
on_style_item | tk_on_style_item_t | 回调函数。 |
ctx | void* | 回调函数的上下文。 |
获取指定名称的值。
ret_t style_mutable_get_value (style_t* s, const char* state, const char* name, const value_t* v);
参数 | 类型 | 说明 |
---|---|---|
返回值 | ret_t | 返回RET_OK表示成功,否则表示失败。 |
s | style_t* | style对象。 |
state | const char* | 控件状态。 |
name | const char* | 属性名。 |
v | const value_t* | 值。 |
将自己注册到style\_factory。
ret_t style_mutable_register ();
参数 | 类型 | 说明 |
---|---|---|
返回值 | ret_t | 返回RET_OK表示成功,否则表示失败。 |
设置指定名称的颜色值。
ret_t style_mutable_set_color (style_t* s, const char* state, const char* name, color_t val);
参数 | 类型 | 说明 |
---|---|---|
返回值 | ret_t | 返回RET_OK表示成功,否则表示失败。 |
s | style_t* | style对象。 |
state | const char* | 控件状态。 |
name | const char* | 属性名。 |
val | color_t | 值。 |
设置指定名称整数格式的值。
ret_t style_mutable_set_int (style_t* s, const char* state, const char* name, uint32_t val);
参数 | 类型 | 说明 |
---|---|---|
返回值 | ret_t | 返回RET_OK表示成功,否则表示失败。 |
s | style_t* | style对象。 |
state | const char* | 控件状态。 |
name | const char* | 属性名。 |
val | uint32_t | 值。 |
设置style的名称。
ret_t style_mutable_set_name (style_t* s, const char* name);
参数 | 类型 | 说明 |
---|---|---|
返回值 | ret_t | 返回RET_OK表示成功,否则表示失败。 |
s | style_t* | style对象。 |
name | const char* | 名称。 |
设置指定名称字符串的值。
ret_t style_mutable_set_str (style_t* s, const char* state, const char* name, const char* val);
参数 | 类型 | 说明 |
---|---|---|
返回值 | ret_t | 返回RET_OK表示成功,否则表示失败。 |
s | style_t* | style对象。 |
state | const char* | 控件状态。 |
name | const char* | 属性名。 |
val | const char* | 值。 |
设置指定名称的值。
ret_t style_mutable_set_value (style_t* s, const char* state, const char* name, const value_t* v);
参数 | 类型 | 说明 |
---|---|---|
返回值 | ret_t | 返回RET_OK表示成功,否则表示失败。 |
s | style_t* | style对象。 |
state | const char* | 控件状态。 |
name | const char* | 属性名。 |
v | const value_t* | 值。 |
名称。
特性 | 是否支持 |
---|---|
可直接读取 | 是 |
可直接修改 | 否 |
可脚本化 | 是 |
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。