Skip to content

tab_button_group_t

概述

标签按钮分组控件。

一个简单的容器,主要用于对标签按钮进行布局和管理。

tab_button_group_t是widget_t的子类控件, widget_t的函数均适用于tab_button_group_t控件。

在xml中使用"tab_button_group"标签创建标签按钮分组控件。如:

xml
<tab_button_group x="c" y="bottom:10" w="90%" h="30" compact="true" >
<tab_button text="General"/>
<tab_button text="Network" value="true" />
<tab_button text="Security"/>
</tab_button_group>

更多用法请参考: tab control

可用通过style来设置控件的显示风格,如颜色等等。如:

xml
<tab_button_group>
<style name="default">
<normal/>
</style>
</tab_button_group>

函数

函数名称说明
tab_button_group_cast转换tab_button_group对象(供脚本语言使用)。
tab_button_group_create创建tab_button_group对象
tab_button_group_get_widget_vtable获取 tab_button_group 虚表。
tab_button_group_remove_index设置删除 tab_button_group 控件中的 tab_button 控件和对应页。
tab_button_group_set_compact设置compact。
tab_button_group_set_drag_child设置拖拽 tab_button 控件位置。
tab_button_group_set_scrollable设置scrollable。

属性

属性名称类型说明
compactbool_t紧凑型排版子控件(缺省FALSE)。
drag_childbool_t是否支持拖拽并且修改 tab_button 控件的位置(缺省FALSE)。
enable_hscroll_animatorbool_t是否开启 tab_button 的左右滚动动画(缺省TRUE)。
scrollablebool_t是否支持滚动(缺省FALSE)。
scrollable_modechar*滚动模式 (缺省all) (all:鼠标滚轮+鼠标拖拽滚动,wheel:鼠标滚轮,dragged:鼠标拖拽滚动。

tab_button_group_cast 函数

  • 函数功能:

转换tab_button_group对象(供脚本语言使用)。

  • 函数原型:
widget_t* tab_button_group_cast (widget_t* widget);
  • 参数说明:
参数类型说明
返回值widget_t*tab_button_group对象。
widgetwidget_t*tab_button_group对象。

tab_button_group_create 函数

  • 函数功能:

创建tab_button_group对象

  • 函数原型:
widget_t* tab_button_group_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
  • 参数说明:
参数类型说明
返回值widget_t*对象。
parentwidget_t*父控件
xxy_tx坐标
yxy_ty坐标
wwh_t宽度
hwh_t高度

tab_button_group_get_widget_vtable 函数

  • 函数功能:

获取 tab_button_group 虚表。

  • 函数原型:
const widget_vtable_t* tab_button_group_get_widget_vtable ();
  • 参数说明:
参数类型说明
返回值const widget_vtable_t*成功返回 tab_button_group 虚表。

tab_button_group_remove_index 函数

  • 函数功能:

设置删除 tab_button_group 控件中的 tab_button 控件和对应页。

  • 函数原型:
ret_t tab_button_group_remove_index (widget_t* widget, uint32_t index);
  • 参数说明:
参数类型说明
返回值ret_t返回RET_OK表示成功,否则表示失败。
widgetwidget_t*控件对象。
indexuint32_ttab_button 的序号。

tab_button_group_set_compact 函数

  • 函数功能:

设置compact。

  • 函数原型:
ret_t tab_button_group_set_compact (widget_t* widget, bool_t compact);
  • 参数说明:
参数类型说明
返回值ret_t返回RET_OK表示成功,否则表示失败。
widgetwidget_t*控件对象。
compactbool_t是否使用紧凑布局(缺省FALSE)。

tab_button_group_set_drag_child 函数

  • 函数功能:

设置拖拽 tab_button 控件位置。

  • 函数原型:
ret_t tab_button_group_set_drag_child (widget_t* widget, bool_t drag_child);
  • 参数说明:
参数类型说明
返回值ret_t返回RET_OK表示成功,否则表示失败。
widgetwidget_t*控件对象。
drag_childbool_t是否拖拽(缺省FALSE)。

tab_button_group_set_scrollable 函数

  • 函数功能:

设置scrollable。

  • 函数原型:
ret_t tab_button_group_set_scrollable (widget_t* widget, bool_t scrollable);
  • 参数说明:
参数类型说明
返回值ret_t返回RET_OK表示成功,否则表示失败。
widgetwidget_t*控件对象。
scrollablebool_t是否允许滚动(缺省FALSE)。

compact 属性

紧凑型排版子控件(缺省FALSE)。

  • 类型:bool_t
特性是否支持
可直接读取
可直接修改
可持久化
可脚本化
可在IDE中设置
可在XML中设置
可通过widget_get_prop读取
可通过widget_set_prop修改

drag_child 属性

是否支持拖拽并且修改 tab_button 控件的位置(缺省FALSE)。

紧凑型排版子控件时才支持滚动,开启该功能后,就不能拖拽滚动了,只能鼠标滚轮滚动了。

  • 类型:bool_t
特性是否支持
可直接读取
可直接修改
可持久化
可脚本化
可在IDE中设置
可在XML中设置
可通过widget_get_prop读取
可通过widget_set_prop修改

enable_hscroll_animator 属性

是否开启 tab_button 的左右滚动动画(缺省TRUE)。

  • 类型:bool_t
特性是否支持
可直接读取
可直接修改
可持久化
可在IDE中设置
可在XML中设置
可通过widget_get_prop读取
可通过widget_set_prop修改

scrollable 属性

是否支持滚动(缺省FALSE)。

紧凑型排版子控件时才支持滚动。

  • 类型:bool_t
特性是否支持
可直接读取
可直接修改
可持久化
可脚本化
可在IDE中设置
可在XML中设置
可通过widget_get_prop读取
可通过widget_set_prop修改

scrollable_mode 属性

滚动模式 (缺省all) (all:鼠标滚轮+鼠标拖拽滚动,wheel:鼠标滚轮,dragged:鼠标拖拽滚动。

  • 类型:char*
特性是否支持
可直接读取
可直接修改
可持久化
可在IDE中设置
可在XML中设置
可通过widget_get_prop读取
可通过widget_set_prop修改