Wt
3.3.0
|
A widget which group widgets into a frame with a title. More...
#include <Wt/WGroupBox>
Public Member Functions | |
WGroupBox (WContainerWidget *parent=0) | |
Creates a groupbox with empty title. | |
WGroupBox (const WString &title, WContainerWidget *parent=0) | |
Creates a groupbox with given title message. | |
const WString & | title () const |
Returns the title. | |
void | setTitle (const WString &title) |
Returns the title. | |
virtual void | refresh () |
Refresh the widget. |
A widget which group widgets into a frame with a title.
This is typically used in a form to group certain form elements together.
Usage example:
enum Vote { Republican = 1, Democrate = 2, NoVote = 10 }; // use a group box as widget container for 3 radio buttons, with a title Wt::WGroupBox *container = new Wt::WGroupBox("USA elections vote"); // use a button group to logically group the 3 options 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));
Like WContainerWidget, WGroupBox is by default displayed as a block.
The widget corresponds to the HTML <fieldset>
tag, and the title in a nested <legend>
tag. This widget does not provide styling, and can be styled using inline or external CSS as appropriate.
void Wt::WGroupBox::refresh | ( | ) | [virtual] |
Refresh the widget.
The refresh method is invoked when the locale is changed using WApplication::setLocale() or when the user hit the refresh button.
The widget must actualize its contents in response.
Reimplemented from Wt::WWebWidget.