A WGroupBox corresponds to an HTML
<fieldset>
element, and provides a frame and
title around a group of widgets.
It is usually styled using the CSS stylesheet which provides many options for layout of the legend (title) and the box contents.
A WPanel is similar to a group box, but provides optional functionality to collapse or expand its contents, and a theme-based style.
#include <Wt/WPanel.h>
#include <Wt/WText.h>
auto panel = std::make_unique<Wt::WPanel>();
panel->addStyleClass("centered-example");
panel->setCentralWidget(std::make_unique<Wt::WText>("This is a default panel."));
#include <Wt/WPanel.h>
#include <Wt/WText.h>
auto panel = std::make_unique<Wt::WPanel>();
panel->addStyleClass("centered-example");
panel->setTitle("Terrific panel");
panel->setCentralWidget(std::make_unique<Wt::WText>("This is a panel with a title."));
#include <Wt/WAnimation.h>
#include <Wt/WPanel.h>
#include <Wt/WText.h>
auto panel = std::make_unique<Wt::WPanel>();
panel->setTitle("Collapsible panel");
panel->addStyleClass("centered-example");
panel->setCollapsible(true);
Wt::WAnimation animation(Wt::AnimationEffect::SlideInFromTop,
Wt::TimingFunction::EaseOut,
100);
panel->setAnimation(animation);
panel->setCentralWidget(std::make_unique<Wt::WText>("This panel can be collapsed."));