| Wt examples
    3.3.0
    | 
#include <PanelList.h>

| Public Member Functions | |
| PanelList (Wt::WContainerWidget *parent) | |
| Wt::WPanel * | addWidget (const Wt::WString &text, Wt::WWidget *w) | 
| void | addPanel (Wt::WPanel *panel) | 
| void | removePanel (Wt::WPanel *panel) | 
| Private Member Functions | |
| void | onExpand (bool notUndo) | 
| Private Attributes | |
| int | wasExpanded_ | 
Definition at line 16 of file PanelList.h.
| PanelList::PanelList | ( | Wt::WContainerWidget * | parent | ) | 
Definition at line 13 of file PanelList.C.
: WContainerWidget(parent) { }
| void PanelList::addPanel | ( | Wt::WPanel * | panel | ) | 
Definition at line 28 of file PanelList.C.
{
  panel->setCollapsible(true);
  panel->collapse();
  panel->expandedSS().connect(this, &PanelList::onExpand);
  WContainerWidget::addWidget(panel);
}
| WPanel * PanelList::addWidget | ( | const Wt::WString & | text, | 
| Wt::WWidget * | w | ||
| ) | 
Definition at line 17 of file PanelList.C.
{
  WPanel *p = new WPanel();
  p->setTitle(text);
  p->setCentralWidget(w);
  addPanel(p);
  return p;
}
| void PanelList::onExpand | ( | bool | notUndo | ) |  [private] | 
Definition at line 38 of file PanelList.C.
{
  WPanel *panel = dynamic_cast<WPanel *>(sender());
  if (notUndo) {
    wasExpanded_ = -1;
    for (unsigned i = 0; i < children().size(); ++i) {
      WPanel *p = dynamic_cast<WPanel *>(children()[i]);
      if (p != panel) {
        if (!p->isCollapsed())
          wasExpanded_ = i;
        p->collapse();
      }
    }
  } else {
    if (wasExpanded_ != -1) {
      WPanel *p = dynamic_cast<WPanel *>(children()[wasExpanded_]);
      p->expand();
    }
  }
}
| void PanelList::removePanel | ( | Wt::WPanel * | panel | ) | 
| int PanelList::wasExpanded_  [private] | 
Definition at line 28 of file PanelList.h.
 1.7.5.1
 1.7.5.1