PanelList Class Reference

#include <PanelList.h>

Inherits Wt::WContainerWidget.

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.

00014   : WContainerWidget(parent)
00015 { }


Member Function Documentation

void PanelList::addPanel ( Wt::WPanel panel  ) 

Definition at line 28 of file PanelList.C.

00029 {
00030   panel->setCollapsible(true);
00031   panel->collapse();
00032 
00033   panel->expandedSS().connect(SLOT(this, PanelList::onExpand));
00034 
00035   WContainerWidget::addWidget(panel);
00036 }

WPanel * PanelList::addWidget ( const Wt::WString text,
Wt::WWidget w 
)

Definition at line 17 of file PanelList.C.

00018 {
00019   WPanel *p = new WPanel();
00020   p->setTitle(text);
00021   p->setCentralWidget(w);
00022 
00023   addPanel(p);
00024 
00025   return p;
00026 }

void PanelList::onExpand ( bool  notUndo  )  [private]

Definition at line 38 of file PanelList.C.

00039 {
00040   WPanel *panel = dynamic_cast<WPanel *>(sender());
00041 
00042   if (notUndo) {
00043     wasExpanded_ = -1;
00044 
00045     for (unsigned i = 0; i < children().size(); ++i) {
00046       WPanel *p = dynamic_cast<WPanel *>(children()[i]);
00047       if (p != panel) {
00048         if (!p->isCollapsed())
00049           wasExpanded_ = i;
00050         p->collapse();
00051       }
00052     }
00053   } else {
00054     if (wasExpanded_ != -1) {
00055       WPanel *p = dynamic_cast<WPanel *>(children()[wasExpanded_]);
00056       p->expand();
00057     }
00058   }
00059 }

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 Thu May 13 05:16:01 2010 for Wt by doxygen 1.6.3