Wt examples 3.1.10
Public Member Functions | Private Member Functions | Private Attributes
PanelList Class Reference

#include <PanelList.h>

Inheritance diagram for PanelList:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 PanelList (Wt::WContainerWidget *parent)
Wt::WPaneladdWidget (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_

Detailed Description

Definition at line 16 of file PanelList.h.


Constructor & Destructor Documentation

PanelList::PanelList ( Wt::WContainerWidget parent)

Definition at line 13 of file PanelList.C.

  : WContainerWidget(parent)
{ }

Member Function Documentation

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)

Member Data Documentation

int PanelList::wasExpanded_ [private]

Definition at line 28 of file PanelList.h.


The documentation for this class was generated from the following files:

Generated on Mon Nov 14 2011 for the C++ Web Toolkit (Wt) by doxygen 1.7.4