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)
 Create a groupbox with empty title.
 WGroupBox (const WString &title, WContainerWidget *parent=0)
 Create a groupbox with given title message.
const WStringtitle () const
 Get the title.
void setTitle (const WString &title)
 Set 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));

The widget corresponds to the HTML <fieldset> tag, and the title in a nested <legend> tag.

Like WContainerWidget, WGroupBox is by default displayed as a block .

WGroupBox-1.png

WGroupBox example


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.


Generated on Tue Nov 3 15:34:32 2009 for Wt by doxygen 1.5.6