Wt  3.3.0
Public Member Functions
Wt::WGroupBox Class Reference

A widget which group widgets into a frame with a title. More...

#include <Wt/WGroupBox>

Inheritance diagram for Wt::WGroupBox:
Inheritance graph
[legend]

List of all members.

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 WStringtitle () const
 Returns the title.
void setTitle (const WString &title)
 Returns the title.
virtual void refresh ()
 Refresh the widget.

Detailed Description

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.

WGroupBox-1.png
WGroupBox example

CSS

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.


Member Function Documentation

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.

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Generated on Mon Apr 8 2013 for the C++ Web Toolkit (Wt) by doxygen 1.7.5.1