Wt3.1.9文档翻译:WGroupBox类参考,WGroupBox Class Reference
这是一个将一些部件放在一个带标题的框里组合起来的部件。
通常用于在一个表单里将某些表单元素组合起来。
使用示例:
enum Vote { Republican = 1, Democrate = 2, NoVote = 10 };
//使用一个分组框来作为3 个单选按钮的部件容器,带有一个标题
Wt::WGroupBox *container = new Wt::WGroupBox("USA elections vote");
//使用一个按钮分组来将3 个选项在逻辑上组合起来
Wt::WButtonGroup *group = new Wt::WButtonGroup(this);
Wt::WRadioButton *button;
button = new Wt::WRadioButton("I voted Republican", container);
new Wt::WBreak(container);
group->addButton(button, Republican);
button = new Wt::WRadioButton("I voted Democrat", container);
new Wt::WBreak(container);
group->addButton(button, Democrate);
button = new Wt::WRadioButton("I didn't vote", container);
new Wt::WBreak(container);
group->addButton(button, NoVote);
group->setCheckedButton(group->button(NoVote));
就像WContainerWidget 一样,WGroupBox默认是以一个块元素显示的。
WGroupBox示例
这个部件对应于HTML <fieldset>标记,标题是处于一个嵌套的 <legend> 标记中 。这个部件不提供样式设置功能,但是可以使用内联或者外部的CSS 来进行样式处理 。
HxLauncher: Launch Android applications by voice commands