void CommentContainerWidget::onTokenReady(uint32_t token, bool ok) { if(ok) { clear(); std::vector<RsGxsComment> comments; //_CommentService->getRelatedComments(token, comments); _CommentService->getCommentData(token, comments); for(std::vector<RsGxsComment>::iterator vit = comments.begin(); vit != comments.end(); vit++) { RsGxsComment& comment = *vit; Wt::WContainerWidget* outerContainer = new Wt::WContainerWidget(this); Wt::WBorderLayout *layout = new Wt::WBorderLayout(); outerContainer->setLayout(layout); AvatarWidgetWt* avatar = new AvatarWidgetWt(true); avatar->setIdentity(comment.mMeta.mAuthorId); layout->addWidget(avatar, Wt::WBorderLayout::West); Wt::WLabel* text = new Wt::WLabel(Wt::WString::fromUTF8(comment.mComment)); layout->addWidget(text, Wt::WBorderLayout::Center); } // note: the widgets the pointers where pointing to where deleted by clear() _TextArea = new Wt::WTextArea(this); _TextArea->setEmptyText("your comment"); //_IdChooser = new GxsIdChooserWt(this); _SubmitButton = new Wt::WPushButton("submit", this); _SubmitButton->clicked().connect(this, &CommentContainerWidget::onSubmitComment); } else { clear(); new Wt::WLabel("FAIL", this); } }
WebApp::WebApp(const Wt::WEnvironment & env) : WApplication(env) { if (string(org::esb::config::Config::getProperty("hive.mode")) == "setup") { WApplication::instance()->redirect("/setup"); WApplication::instance()->quit(); } setTitle("Hive Webadmin"); _isAuthenticated = false; Wt::Ext::Container *viewPort = new Wt::Ext::Container(root()); Wt::WBorderLayout *layout = new Wt::WBorderLayout(viewPort); Wt::Ext::Panel *north = new Wt::Ext::Panel(); north->setBorder(false); std::string h = "MediaEncodingCluster V-"; h += MHIVE_VERSION; h += "($Rev$-"__DATE__ "-" __TIME__")"; Wt::WText *head = new Wt::WText(h); head->setStyleClass("north"); north->setLayout(new Wt::WFitLayout()); north->layout()->addWidget(head); north->resize(Wt::WLength(), 35); layout->addWidget(north, Wt::WBorderLayout::North); /* West */ west = new Wt::Ext::Panel(); west->setTitle("Menu"); west->resize(200, Wt::WLength()); west->setResizable(true); west->collapse(); west->setAnimate(true); west->setAutoScrollBars(true); layout->addWidget(west, Wt::WBorderLayout::West); /* Center */ Wt::Ext::Panel *center = new Wt::Ext::Panel(); center->setTitle("MediaEncodingCluster"); center->layout()->addWidget(exampleContainer_ = new Wt::WContainerWidget()); center->setAutoScrollBars(true); layout->addWidget(center, Wt::WBorderLayout::Center); exampleContainer_->setPadding(5); currentExample_ = login = new Login(exampleContainer_); login->authenticated.connect(SLOT(this, WebApp::authenticated)); // useStyleSheet("ext/resources/css/xtheme-gray.css"); useStyleSheet("filetree.css"); useStyleSheet("main.css"); std::string res = std::string(Config::getProperty("hive.path")); res.append("/../res/messages"); messageResourceBundle().use(res.c_str(), false); }
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8/////////9/////////A /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8/////////9/////////A /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8/////////9/////////A LocationPanel::LocationPanel(boost::shared_ptr<FlightDatabase> flightDb, Wt::WContainerWidget *parent) : Wt::WCompositeWidget(parent), flightDb_(flightDb), impl_(new Wt::WContainerWidget()) { setImplementation(impl_); setStyleClass("flb_detail_panel"); impl_->setStyleClass("flb_detail_panel"); cbArea_ = new Wt::Ext::ComboBox(impl_); cbTakeoff_ = new Wt::Ext::CheckBox(impl_); cbLanding_ = new Wt::Ext::CheckBox(impl_); cbWayPnt_ = new Wt::Ext::CheckBox(impl_); table_ = new LocationTable(flightDb, impl_); pglist_ = new PagesList(table_); // signals cbArea_->activated().connect(SLOT(this, LocationPanel::filter)); cbTakeoff_->checked().connect(SLOT(this, LocationPanel::filter)); cbLanding_->checked().connect(SLOT(this, LocationPanel::filter)); cbWayPnt_->checked().connect(SLOT(this, LocationPanel::filter)); cbTakeoff_->unChecked().connect(SLOT(this, LocationPanel::filter)); cbLanding_->unChecked().connect(SLOT(this, LocationPanel::filter)); cbWayPnt_->unChecked().connect(SLOT(this, LocationPanel::filter)); // header Wt::WTable *topBar = new Wt::WTable(); topBar->setStyleClass("FilterBar"); Wt::WText *wtFilt = new Wt::WText("Filter : "); wtFilt->setStyleClass("FilterTitle"); Wt::WText *wtArea = new Wt::WText("Fluggebiet"); wtArea->setStyleClass("FilterSubTitle"); cbTakeoff_->setText("Startplaetze"); cbLanding_->setText("Landeplaetze"); cbWayPnt_->setText("Wegpunkte"); topBar->elementAt(0, 0)->addWidget(wtFilt); topBar->elementAt(0, 1)->addWidget(wtArea); topBar->elementAt(0, 2)->addWidget(cbArea_); topBar->elementAt(0, 3)->addWidget(cbTakeoff_); topBar->elementAt(0, 4)->addWidget(cbLanding_); topBar->elementAt(0, 5)->addWidget(cbWayPnt_); topBar->elementAt(0, 6)->addWidget(pglist_); Wt::WContainerWidget *botBar = new Wt::WContainerWidget(); Wt::WBorderLayout *borderLayout = new Wt::WBorderLayout(); impl_->setLayout(borderLayout); borderLayout->addWidget(topBar, Wt::WBorderLayout::North); borderLayout->addWidget(table_, Wt::WBorderLayout::Center); borderLayout->addWidget(botBar, Wt::WBorderLayout::South); load(); filter(); }
MainPage::MainPage(Wt::WApplication* app): WContainerWidget() { app_ = app; contentsStack_ = new Wt::WStackedWidget(); contentsStack_->setOverflow(WContainerWidget::OverflowAuto); contentsStack_->setStyleClass("contents"); /* * Setup the menu (and submenus) */ Wt::WMenu *menu = new Wt::WMenu(contentsStack_, Wt::Vertical, 0); menu->setRenderAsList(true); menu->setStyleClass("menu"); menu->setInternalPathEnabled(); menu->setInternalBasePath("/"); menu->itemSelected().connect(this, &MainPage::selectedMenuItem); Wt::WContainerWidget *w = new Wt::WContainerWidget(this); Wt::WBorderLayout *layout = new Wt::WBorderLayout(); layout->addWidget(new Wt::WText("North-side is best"), Wt::WBorderLayout::North); layout->addWidget(new Wt::WText("South-side is best"), Wt::WBorderLayout::South); layout->addWidget(menu, Wt::WBorderLayout::West); layout->addWidget(contentsStack_, Wt::WBorderLayout::Center); // use layout but do not justify vertically w->setLayout(layout, Wt::AlignTop | Wt::AlignJustify); menu->addItem("Basics", new ClientsPage(this, &session_)); menu->addItem("Form Widgets", new CommonPage(this, &session_)); menu->addItem("Form Validators", new CommonPage(this, &session_)); Wt::WSubMenuItem *smi = new Wt::WSubMenuItem("Sub menu", new CommonPage(this, &session_)); Wt::WMenu *subMenu = new Wt::WMenu(contentsStack_, Wt::Vertical, 0); subMenu->setRenderAsList(true); smi->setSubMenu(subMenu); menu->addItem(smi); subMenu->setInternalPathEnabled(); subMenu->setInternalBasePath("/" + smi->pathComponent()); subMenu->setStyleClass("menu submenu"); subMenu->itemSelected().connect(this, &MainPage::selectedMenuItem); subMenu->addItem("Sub Item 1", new CommonPage(this, &session_)); subMenu->addItem("Sub Item 2", new CommonPage(this, &session_)); }