Wt::WWidget * ribi::con3::WtMenuDialog::CreateNewWelcomeDialog() const { Wt::WContainerWidget * dialog = new Wt::WContainerWidget; dialog->setContentAlignment(Wt::AlignCenter); dialog->addWidget(new Wt::WBreak); new Wt::WLabel("Welcome to ConnectThree",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); new Wt::WLabel("The goal of ConnectThree is to get three in a row horizontally or vertically:",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); new Wt::WLabel("Good #1",dialog); new Wt::WBreak(dialog); dialog->addWidget(new Wt::WImage( m_resources.GetInstructionsGoodFilenames()[0],"Good #1")); new Wt::WBreak(dialog); new Wt::WBreak(dialog); new Wt::WLabel("Good #2",dialog); new Wt::WBreak(dialog); dialog->addWidget(new Wt::WImage( m_resources.GetInstructionsGoodFilenames()[1],"Good #2")); new Wt::WBreak(dialog); new Wt::WBreak(dialog); new Wt::WLabel("Wrong",dialog); new Wt::WBreak(dialog); dialog->addWidget(new Wt::WImage( m_resources. GetInstructionsWrongFilename(), "Wrong")); return dialog; }
Wt::WWidget * ribi::con3::WtMenuDialog::CreateNewSelectPlayersDialog() { Wt::WContainerWidget * dialog = new Wt::WContainerWidget; dialog->setContentAlignment(Wt::AlignCenter); dialog->addWidget(new Wt::WBreak); dialog->addWidget(m_select); return dialog; }
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8/////////9/////////A Wt::WWidget * WelcomeScreen::makeRegistrationTab() { Wt::WContainerWidget *cont = new Wt::WContainerWidget(); rg_txt_ = new Wt::WText("Hier koennen Sie ihr neues Flugbuch eroeffnen.", cont); cont->addWidget(new Wt::WBreak()); cont->addWidget(new Wt::WBreak()); Wt::WTable *layout = new Wt::WTable(cont); Wt::WLabel *usernameLabel = new Wt::WLabel("Benutzername: ", layout->elementAt(0, 0)); layout->elementAt(0, 0)->resize(Wt::WLength(14, Wt::WLength::FontEx), Wt::WLength()); rg_username_ = new Wt::WLineEdit(layout->elementAt(0, 1)); usernameLabel->setBuddy(rg_username_); Wt::WLabel *passwordLabel = new Wt::WLabel("Passwort: ", layout->elementAt(1, 0)); rg_password_ = new Wt::WLineEdit(layout->elementAt(1, 1)); rg_password_->setEchoMode(Wt::WLineEdit::Password); passwordLabel->setBuddy(rg_password_); Wt::WLabel *passwordLabel2 = new Wt::WLabel("wiederholen: ", layout->elementAt(2, 0)); rg_password2_ = new Wt::WLineEdit(layout->elementAt(2, 1)); rg_password2_->setEchoMode(Wt::WLineEdit::Password); rg_password2_->enterPressed().connect(SLOT(this, WelcomeScreen::doRegister)); passwordLabel2->setBuddy(rg_password2_); Wt::WLabel *stdflareas = new Wt::WLabel("Standardfluggebiete importieren: ", layout->elementAt(3, 0)); rg_useStdLoc_ = new Wt::WCheckBox(layout->elementAt(3, 1)); stdflareas->setBuddy(rg_useStdLoc_); Wt::WPushButton *LoginButton = new Wt::WPushButton("Registrieren", layout->elementAt(4, 1)); LoginButton->clicked().connect(SLOT( this, WelcomeScreen::doRegister)); return cont; }
void WebApp::logout() { _isAuthenticated = false; _user_id = 0; west->layout()->removeWidget(menu); delete menu; west->collapse(); Wt::WContainerWidget *container = new Wt::WContainerWidget(exampleContainer_); container->addWidget(new Wt::WText(Wt::WString::tr("logged_out"))); setContent(container); }
void WebApp::authenticated() { _isAuthenticated = true; _user_id = login->getUserId(); west->layout()->addWidget(menu = createMenuTree()); west->expand(); Wt::WContainerWidget *container = new Wt::WContainerWidget(exampleContainer_); container->addWidget(new Wt::WText(Wt::WString::tr("about"))); login->setHidden(true); currentExample_ = container; }
Wt::WWidget * ribi::tgrw::WtMenuDialog::CreateNewWelcomeDialog() const { Wt::WContainerWidget * dialog = new Wt::WContainerWidget; dialog->setContentAlignment(Wt::AlignCenter); dialog->addWidget(new Wt::WBreak); new Wt::WLabel("Welcome to TestGroupWidget",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); new Wt::WLabel("TestGroupWidget tests and displays the GroupWidget class",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); Wt::WGroupBox * const box = new Wt::WGroupBox("Explanation",dialog); box->addWidget(new Wt::WImage("ToolTestGroupWidgetWelcome.png")); return dialog; }
//--------------------------------------------------------------------------- Wt::WWidget * ribi::ToolTestServerPusher::WtMenuDialog::CreateNewWelcomeDialog() const { Wt::WContainerWidget * dialog = new Wt::WContainerWidget; dialog->setContentAlignment(Wt::AlignCenter); dialog->addWidget(new Wt::WBreak); new Wt::WLabel("Welcome to TestServerPusher",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); new Wt::WLabel("TestServerPusher demonstrates how to view the same changing info",dialog); new Wt::WBreak(dialog); new Wt::WLabel("from different browsers and/or computers",dialog); new Wt::WBreak(dialog); new Wt::WLabel("using the WtServerPusher and WtServerPusherClient classes",dialog); return dialog; }
Wt::WWidget * ribi::ToolTestEntrance::WtMenuDialog::CreateNewWelcomeDialog() const { Wt::WContainerWidget * dialog = new Wt::WContainerWidget; dialog->setContentAlignment(Wt::AlignCenter); dialog->addWidget(new Wt::WBreak); new Wt::WLabel("Welcome to TestEntrance",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); new Wt::WLabel("TestEntrance demonstrates the WtEntrance class",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); Wt::WGroupBox * const box = new Wt::WGroupBox("Explanation",dialog); box->addWidget(new Wt::WImage("ToolTestEntranceWelcome.png")); return dialog; }
Wt::WWidget * ribi::WtRandomCodeMenuDialog::CreateNewWelcomeDialog() const { Wt::WContainerWidget * dialog = new Wt::WContainerWidget; dialog->setContentAlignment(Wt::AlignCenter); dialog->addWidget(new Wt::WBreak); new Wt::WLabel("Welcome to RandomCode",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); new Wt::WLabel("The goal of RandomCode is to generate random C++ code",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); Wt::WGroupBox * const box = new Wt::WGroupBox("Explanation",dialog); box->addWidget(new Wt::WImage("ToolRandomCodeWelcome.png")); return dialog; }
//--------------------------------------------------------------------------- Wt::WWidget * WtTestToggleButtonMenuDialog::CreateNewWelcomeDialog() const { Wt::WContainerWidget * dialog = new Wt::WContainerWidget; dialog->setContentAlignment(Wt::AlignCenter); dialog->addWidget(new Wt::WBreak); new Wt::WLabel("Welcome to TestToggleButton",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); new Wt::WLabel("TestToggleButton tests and displays the ToggleButton and WtToggleButtonWidget classes",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); Wt::WGroupBox * const box = new Wt::WGroupBox("Explanation",dialog); box->addWidget(new Wt::WImage("ToolTestToggleButtonWelcome.png")); return dialog; }
Wt::WWidget * ribi::WtAsciiArterMainDialog::CreateNewWelcomeDialog() const { Wt::WContainerWidget * dialog = new Wt::WContainerWidget; dialog->setContentAlignment(Wt::AlignCenter); dialog->addWidget(new Wt::WBreak); new Wt::WLabel("Welcome to AsciiArter",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); new Wt::WLabel("AsciiArter is a tool to convert images to ascii art.",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); Wt::WGroupBox * const box = new Wt::WGroupBox("Explanation",dialog); box->addWidget(new Wt::WImage("ToolAsciiArterWelcome.png")); return dialog; }
//--------------------------------------------------------------------------- Wt::WWidget * WtTestEncrangerMenuDialog::CreateNewWelcomeDialog() const { Wt::WContainerWidget * dialog = new Wt::WContainerWidget; dialog->setContentAlignment(Wt::AlignCenter); dialog->addWidget(new Wt::WBreak); new Wt::WLabel("Welcome to TestEncranger",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); new Wt::WLabel("TestEncranger demonstrates the Encranger encryption and de-encryption algorithm",dialog); new Wt::WBreak(dialog); new Wt::WBreak(dialog); Wt::WGroupBox * const box = new Wt::WGroupBox("Explanation",dialog); box->addWidget(new Wt::WImage("ToolTestEncrangerWelcome.png")); return dialog; }
Wt::WContainerWidget *PopupChatWidget::createBar() { Wt::WContainerWidget *bar = new Wt::WContainerWidget(); bar->setStyleClass("chat-bar"); Wt::WText *toggleButton = new Wt::WText(); toggleButton->setInline(false); toggleButton->setStyleClass("chat-minmax"); bar->clicked().connect(this, &PopupChatWidget::toggleSize); bar->clicked().connect(this, &PopupChatWidget::goOnline); bar->addWidget(toggleButton); title_ = new Wt::WText(bar); bar_ = bar; return bar; }
Wt::WWidget * ribi::WtAsciiArterMainDialog::CreateNewMainDialog() { Wt::WContainerWidget * dialog = new Wt::WContainerWidget; //File upload { assert(ui.m_fileupload); //Upload automatically when the user entered a file ui.m_fileupload->changed().connect( ui.m_fileupload, &Wt::WFileUpload::upload); //Call WtTextUploadDialog::on_upload_done when file is uploaded ui.m_fileupload->uploaded().connect( this, &ribi::WtAsciiArterMainDialog::OnUploadDone); dialog->addWidget(ui.m_fileupload); } dialog->addWidget(new Wt::WBreak); dialog->addWidget(new Wt::WBreak); //Width edit { assert(ui.m_edit_width); //if (m_dialog) //{ // ui.m_edit_width->setText( // boost::lexical_cast<std::string>(m_dialog->GetWidth())); //} //Respond to if user presses enter ui.m_edit_width->enterPressed().connect( this, &ribi::WtAsciiArterMainDialog::OnEditWidthChange); dialog->addWidget(ui.m_edit_width); } //Convert button { Wt::WPushButton * const button = new Wt::WPushButton("Convert"); button->clicked().connect( this, &ribi::WtAsciiArterMainDialog::OnConvertClick); dialog->addWidget(button); } dialog->addWidget(new Wt::WBreak); dialog->addWidget(new Wt::WBreak); //text { assert(ui.m_text); ui.m_text->setMinimumSize(600,600); dialog->addWidget(ui.m_text); } return dialog; }
void ContactList::showFullList() { WtUtilFuns::removeChildWidgets(this); clearPanels(); for(std::map<ContactGroup,Wt::WPanel*>::iterator it = mContactPanels.begin(); it != mContactPanels.end(); ++it) { //uto& contacts = it->; const ContactGroup &group = it->first; auto panel = it->second; Wt::WContainerWidget* container = static_cast<Wt::WContainerWidget*>(panel->centralWidget()); BOOST_FOREACH(const ContactInfo& info, group.contacts) { ContactEntry *entry = mUinToEntry[info.uin]; container->addWidget(entry); } if(container->count()) addWidget(panel); } }
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8/////////9/////////A Wt::WWidget * WelcomeScreen::makeNormalLoginTab() { Wt::WContainerWidget *cont = new Wt::WContainerWidget(); nl_txt_ = new Wt::WText("Hier koennen Sie ihr bestehendes Flugbuch aufrufen.", cont); cont->addWidget(new Wt::WBreak()); cont->addWidget(new Wt::WBreak()); Wt::WTable *layout = new Wt::WTable(cont); Wt::WLabel *usernameLabel = new Wt::WLabel("Benutzername: ", layout->elementAt(0, 0)); layout->elementAt(0, 0)->resize(Wt::WLength(14, Wt::WLength::FontEx), Wt::WLength()); nl_username_ = new Wt::WLineEdit(layout->elementAt(0, 1)); usernameLabel->setBuddy(nl_username_); Wt::WLabel *passwordLabel = new Wt::WLabel("Password: "******"Login", layout->elementAt(2, 1)); LoginButton->clicked().connect(SLOT( this, WelcomeScreen::doLogin)); return cont; }
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8/////////9/////////A // We have a FlightpredApp object for each session (user...) FlightpredApp::FlightpredApp(const Wt::WEnvironment& env) : Wt::WApplication(env) { setTitle(_("free flight prediction system")); // application title useStyleSheet("flightpred.css"); // std::cout << "create a new session. locale is : " << locale() << std::endl; try { // assemble the database connection information string db_host = "localhost"; // string db_host = "192.168.2.47"; Wt::WApplication::readConfigurationProperty("db-host", db_host); string db_port = "5432"; Wt::WApplication::readConfigurationProperty("db-port", db_port); string db_name = "flightpred"; Wt::WApplication::readConfigurationProperty("db-name", db_name); string db_user = "******"; Wt::WApplication::readConfigurationProperty("db-user", db_user); string db_password = "******"; Wt::WApplication::readConfigurationProperty("db-password", db_password); std::stringstream sstr; std::cout << "Connecting to the database: host=" << db_host << " port=" << db_port << " dbname=" << db_name << " user="******" password=********" << std::endl; sstr << "host=" << db_host << " port=" << db_port << " dbname=" << db_name << " user="******" password="******"web prediction"); pqxx::result res = trans.exec("SELECT pred_site_id FROM pred_sites"); } catch(std::exception &ex) { throw std::runtime_error(string("Failed to connect to the database. You may have to configure the database server, so that the webserver can access it. -> ") + ex.what()); } string lacyLoadTabs = "lacyLoadTabs"; Wt::WApplication::readConfigurationProperty("lacyLoadTabs", lacyLoadTabs); const Wt::WTabWidget::LoadPolicy loadpoly = (lacyLoadTabs == "1" || boost::to_lower_copy(lacyLoadTabs) == "true" ? Wt::WTabWidget::LazyLoading : Wt::WTabWidget::PreLoading); Wt::WTabWidget *tabw = new Wt::WTabWidget(root()); string forecast_days_str = "3"; Wt::WApplication::readConfigurationProperty("forecast_days", forecast_days_str); const size_t forecast_days = boost::lexical_cast<size_t>(forecast_days_str); FlightForecast *forecastpanel = new FlightForecast(db_conn_str, forecast_days); tabw->addTab(forecastpanel, _("Flight Forecasts\n"), loadpoly); WeatherMap *weatherpanel = new WeatherMap(db_conn_str, "GFS"); tabw->addTab(weatherpanel, _("Weather data"), loadpoly); Populations *populations = new Populations(db_conn_str); tabw->addTab(populations, _("Populations"), loadpoly); Wt::WContainerWidget *docupanel = new Wt::WContainerWidget(); tabw->addTab(docupanel, _("Documentation"), loadpoly); sstr.str(""); sstr << "<iframe src=\"http://flightpred.svn.sourceforge.net/viewvc/flightpred/trunk/doc/index.html\" width=\"100%\" height=\"100%\"></iframe>"; Wt::WText *txIFrame = new Wt::WText(sstr.str(), Wt::XHTMLUnsafeText); docupanel->addWidget(txIFrame); docupanel->resize(Wt::WLength(100.0, Wt::WLength::Percentage), Wt::WLength(100.0, Wt::WLength::Percentage)); } catch(std::exception &ex) { std::cout << _("critical error during session initialization : ") << ex.what() << std::endl; new Wt::WText(ex.what(), root()); } }
// The env argument contains information about the new session, and the initial request. // It must be passed to the WApplication // constructor so it is typically also an argument // for your custom application constructor. DensityApp::DensityApp(const WEnvironment& env, RInside & R) : WApplication(env), R_(R) { setTitle("Witty WebApp With RInside"); // application title std::string tfcmd = "tfile <- tempfile(pattern=\"img\", tmpdir=\"/tmp\", fileext=\".png\")"; tempfile_ = Rcpp::as<std::string>(R_.parseEval(tfcmd)); // assign to 'tfile' in R, and report back bw_ = 100; kernel_ = 0; // parameters used to estimate the density cmd_ = "c(rnorm(100,0,1), rnorm(50,5,1))"; // random draw command string Wt::WGroupBox *wc = new Wt::WGroupBox("Density Estimation", root()); Wt::WHBoxLayout *layout = new Wt::WHBoxLayout(); Wt::WContainerWidget *midbox = new Wt::WContainerWidget(root()); layout->addWidget(midbox); Wt::WContainerWidget *container = new Wt::WContainerWidget(root()); layout->addWidget(container); wc->setLayout(layout, AlignTop | AlignJustify); midbox->addWidget(new WText("Density estimation scale factor (div. by 100)")); midbox->addWidget(new WBreak()); // insert a line break spin_ = new WSpinBox(midbox); spin_->setRange(5, 200); spin_->setValue(bw_); spin_->valueChanged().connect(this, &DensityApp::reportSpinner); midbox->addWidget(new WBreak()); // insert a line break midbox->addWidget(new WText("R Command for data generation")); // show some text midbox->addWidget(new WBreak()); // insert a line break codeEdit_ = new WLineEdit(midbox); // allow text input codeEdit_->setTextSize(30); codeEdit_->setText(cmd_); codeEdit_->setFocus(); // give focus codeEdit_->enterPressed().connect(this, &DensityApp::reportEdit); group_ = new Wt::WButtonGroup(container); // use button group to arrange radio buttons Wt::WRadioButton *button; button = new Wt::WRadioButton("Gaussian", container); new Wt::WBreak(container); group_->addButton(button, Gaussian); button = new Wt::WRadioButton("Epanechnikov", container); new Wt::WBreak(container); group_->addButton(button, Epanechnikov); button = new Wt::WRadioButton("Rectangular", container); new Wt::WBreak(container); group_->addButton(button, Rectangular); button = new Wt::WRadioButton("Triangular", container); new Wt::WBreak(container); group_->addButton(button, Triangular); button = new Wt::WRadioButton("Cosine", container); new Wt::WBreak(container); group_->addButton(button, Cosine); group_->setCheckedButton(group_->button(kernel_)); group_->checkedChanged().connect(this, &DensityApp::reportButton); Wt::WGroupBox *botbox = new Wt::WGroupBox("Resulting chart", root()); imgfile_ = new Wt::WFileResource("image/png", tempfile_); imgfile_->suggestFileName("density.png"); // name the clients sees of datafile img_ = new Wt::WImage(imgfile_, "PNG version", botbox); Wt::WGroupBox *stbox = new Wt::WGroupBox("Status", root()); greeting_ = new WText(stbox); // empty text greeting_->setText("Setting up..."); reportEdit(); // create a new RNG draw in Yvec_ plot(); // and draw a new density plot }
Wt::WContainerWidget *nav_bar() { // Main Container holding navbar and content Wt::WContainerWidget *container = new Wt::WContainerWidget(); // Content stack shows content, one at a time Wt::WStackedWidget *contentsStack = new Wt::WStackedWidget(container); contentsStack->addStyleClass("container"); // Container holding content for layout purposes Wt::WContainerWidget *container2 = new Wt::WContainerWidget(); // Create a NAVBAR Wt::WNavigationBar *navigation = new Wt::WNavigationBar(container); navigation->setTitle("Halo Viewer", "http://haloviewer.bluewizard.ca/"); navigation->setResponsive(true); navigation->addStyleClass("navbar-fixed-top"); navigation->addStyleClass("navbar-inner"); // Setup a Left-aligned menu. Wt::WMenu *leftMenu = new Wt::WMenu(contentsStack, container2); navigation->addMenu(leftMenu, Wt::AlignCenter); Wt::WText *searchResult = new Wt::WText("Buy or Sell... Bye!"); // Create Spartan profile SpartanProfile *mySpartan = new SpartanProfile(); // Create Profile view container Wt::WContainerWidget *profile = new Wt::WContainerWidget(); profile->addStyleClass("summary-container"); // User summary template (emblem, name, rank etc.) Wt::WTemplate *t = new Wt::WTemplate("<div class=\"summary-container\">\n<img src=\"${emblem-url}\" class=\"emblem-image\" />\n<div class=\"spartan-name\">${spartan-name}</div>\n<div class=\"spartan-rank\">SR ${spartan-rank}</div>\n</div>"); std::string emblem_url("https://image.halocdn.com/h5/emblems/311_0_31_48?width=256&hash=%2blRdfGUDXqlSen9Z1eRb8OoX%2fqYz9zaLqu3TNgYxffs%3d"); boost::replace_all(emblem_url, "&", "&"); t->bindString("emblem-url", emblem_url); t->bindWidget("spartan-name", new Wt::WText("CLWakaLaka")); t->bindWidget("spartan-rank", new Wt::WText("SR 74")); profile->addWidget(t); // Ranks Container shows playlist ranks for a given SpartanProfile Wt::WContainerWidget *summary_layout = new Wt::WContainerWidget(); PlaylistRanksContainer *ranks = new PlaylistRanksContainer(mySpartan); Wt::WContainerWidget *panels = new Wt::WContainerWidget(); panels->setWidth("60%"); Wt::WPanel *panel = new Wt::WPanel(); panel->setTitle("Collapsible panel"); panel->addStyleClass("centered-example"); panel->setCollapsible(true); Wt::WAnimation animation(Wt::WAnimation::SlideInFromTop, Wt::WAnimation::EaseOut, 100); panel->setAnimation(animation); Wt::WText *temp_text = new Wt::WText(mySpartan->printRecentMatches()); panel->setCentralWidget(temp_text); panels->addWidget(panel); RecentMatchesContainer *recent_matches_panel = new RecentMatchesContainer(mySpartan); ranks->setFloatSide(Wt::Left); recent_matches_panel->setFloatSide(Wt::Left); summary_layout->addWidget(ranks); summary_layout->addWidget(recent_matches_panel); // Create TabWidget for profile view Wt::WTabWidget *tabW = new Wt::WTabWidget(profile); Wt::WTextArea *text = new Wt::WTextArea(mySpartan->getRanks()); tabW->addTab(summary_layout, "Summary", Wt::WTabWidget::PreLoading); tabW->addTab(text, "Weapons", Wt::WTabWidget::PreLoading); tabW->addTab(new Wt::WTextArea("You could change any other style attribute of the" " tab widget by modifying the style class." " The style class 'trhead' is applied to this tab."), "Medals", Wt::WTabWidget::PreLoading)->setStyleClass("trhead"); tabW->setStyleClass("tabwidget"); // Add containers to Left Menu leftMenu->addItem("Profile", profile); leftMenu->addItem("Matches", new Wt::WText("Layout contents")); leftMenu->addItem("Sales", searchResult); // Setup a Right-aligned menu. Wt::WMenu *rightMenu = new Wt::WMenu(); navigation->addMenu(rightMenu, Wt::AlignRight); // Create a popup submenu for the Help menu. Wt::WPopupMenu *popup = new Wt::WPopupMenu(); popup->addItem("Contents"); popup->addItem("Index"); popup->addSeparator(); popup->addItem("About"); panel->expanded().connect(std::bind([=] () { temp_text->setText(mySpartan->printRecentMatches()); })); popup->itemSelected().connect(std::bind([=] (Wt::WMenuItem *item) { Wt::WMessageBox *messageBox = new Wt::WMessageBox ("Help", Wt::WString::fromUTF8("<p>Showing Help: {1}</p>").arg(item->text()), Wt::Information, Wt::Ok); messageBox->buttonClicked().connect(std::bind([=] () { delete messageBox; })); messageBox->show(); }, std::placeholders::_1)); Wt::WMenuItem *item = new Wt::WMenuItem("Help"); item->setMenu(popup); rightMenu->addItem(item); // Add a Search control. Wt::WLineEdit *edit = new Wt::WLineEdit(); edit->setEmptyText("Enter a search item"); edit->enterPressed().connect(std::bind([=] () { leftMenu->select(0); // is the index of the "Sales" mySpartan->updateProfile(edit->text().toUTF8()); mySpartan->printRanks(); std::cout << mySpartan->getGamertag() << std::endl; std::cout << mySpartan->getEmblem() << std::endl; if (boost::algorithm::contains(mySpartan->getEmblem(), "https:")) { // Update summary template std::string tmp_url = mySpartan->getEmblem(); boost::replace_all(tmp_url, "&", "&"); t->bindString("emblem-url", tmp_url); t->bindString("spartan-name", mySpartan->getGamertag()); t->bindString("spartan-rank", std::to_string(mySpartan->getSpartanRank())); // Update summary tab //tabW->widget(0)->setText(new Wt::WString(mySpartan->getRanks())); text->setText(mySpartan->getRanks()); ranks->update(); recent_matches_panel->update(); } })); navigation->addSearch(edit, Wt::AlignRight); container->addWidget(contentsStack); return container; }
MyTreeTableNode *MyTreeTableNode::addNode(MyTreeTableNode *parent, Wt::WString name, const long start, const long stop, bool mini ) { MyTreeTableNode *node = new MyTreeTableNode(name, 0, parent); Wt::WContainerWidget *labelArea = node->labelArea(); Wt::WWidget *labelWidget = labelArea->widget(0); //See source of WTreeNode. labelArea->removeWidget(labelWidget); node->startWidget = new TimeWidget(); //We make these, even if we're doing the mini-tree. We use these widgets to store the actual data, so that if we need the start or stop time, we can get them out of the widget and get the right numbers, even if we haven't saved the fragment set yet. node->startWidget->setTime(start); node->stopWidget = new TimeWidget(); node->stopWidget->setTime(stop); if (mini) { node->startButton = new Wt::WPushButton(name); } else { node->editWidget = new Wt::WInPlaceEdit(); std::string str = name.toUTF8(); str.erase(std::remove(str.begin(), str.end(), ' '), str.end()); //This removes whitespace if(str.length()<1) { node->editWidget->setText(Wt::WString::Empty); node->editWidget->setPlaceholderText("New Node"); } else { node->editWidget->setText(name); } node->editWidget->valueChanged().connect(std::bind([=]() { std::string str = node->editWidget->text().toUTF8(); str.erase(std::remove(str.begin(), str.end(), ' '), str.end()); //This removes whitespace if(str.length()<1) { node->editWidget->setText(Wt::WString::Empty); } node->text = node->editWidget->text(); })); node->text = node->editWidget->text(); node->startButton = new Wt::WPushButton("|>"); } //todo: add doubleclick trick to allow modal edit node->startButton->clicked().connect(std::bind([=]() { if(start == -1) { //We've clicked the startbutton on a group, so we need to find the first non-group widget. if (node->childNodes().size() > 0) { //So, there are children.. In this case take the first child and pretend we've clicked that startButton. It'll be recursive. MyTreeTableNode *firstChild = dynamic_cast<MyTreeTableNode*> (*(node->childNodes()).begin()); return firstChild->startButton->clicked().emit(Wt::WMouseEvent()); } else { //Where in a childless group, so we cannot play anything! return; } } Wt::Json::Object jStartBefore = zmq_conn::interact("inputs?"); Wt::Json::Array aStartBefore = jStartBefore.get("before"); signed long long startBefore = aStartBefore[2]; zmq_conn::interact(Wt::WString("event:stop")); //Probably needed to help stop the track from stopping the middle of a play Wt::WString command="play:"+std::to_string(start - startBefore * 1000); zmq_conn::interact(command); })); labelArea->addWidget(node->startButton); if(mini) { } else { //0 is startbutton now //node->setColumnWidget(1, node->startButton); node->setColumnWidget(1,node->editWidget ); node->setColumnWidget(2, node->startWidget); node->setColumnWidget(3, node->stopWidget); } return node; }
void SimpleWebWidget::login() { clear(); btnGroundPower_ = new Wt::WPushButton("Ground Power\nconnect/disconnect"); btnGroundAir_ = new Wt::WPushButton("Ground Air\n connect/disconnect"); btnDoor1_ = new Wt::WPushButton("Open/Close\n Door1"); btnDoor2_ = new Wt::WPushButton("Open/Close\n Door2"); btnDoor3_ = new Wt::WPushButton("Open/Close\n Door3"); btnPushBack1_ = new Wt::WPushButton("Start Pushback\nTail Left"); btnPushBack2_ = new Wt::WPushButton("Start Pushback\nStraight"); btnPushBack3_ = new Wt::WPushButton("Start Pushback\nTail Right"); btnPushBack4_ = new Wt::WPushButton("STOP\nPushBack"); btnVirtualKey1_ = new Wt::WPushButton("Send 1"); btnVirtualKey2_ = new Wt::WPushButton("Send 2"); btnVirtualKey3_ = new Wt::WPushButton("Send 3"); btnVirtualKey4_ = new Wt::WPushButton("Send 4"); btnVirtualKey5_ = new Wt::WPushButton("Send 5"); btnVirtualKey6_ = new Wt::WPushButton("Send 6"); btnVirtualKey7_ = new Wt::WPushButton("Send 7"); btnVirtualKey8_ = new Wt::WPushButton("Send 8"); btnVirtualKey9_ = new Wt::WPushButton("Send 9"); btnVirtualKey0_ = new Wt::WPushButton("Send 0"); btnVirtualKeyF12_ = new Wt::WPushButton("Send F12"); txtWxrDep = new Wt::WText("DEPARTURE AIRPORT IS NOT SET"); txtWxrTafDep = new Wt::WText("DEPARTURE AIRPORT IS NOT SET"); txtWxrArr = new Wt::WText("ARRIVAL AIRPORT IS NOT SET"); txtWxrTafArr = new Wt::WText("ARRIVAL AIRPORT IS NOT SET"); txtGSXText = new Wt::WText(""); btnGroundPower_->setStyleClass("btn-danger"); btnGroundAir_->setStyleClass("btn-danger"); btnDoor1_->setStyleClass("btn-danger"); btnDoor2_->setStyleClass("btn-danger"); btnDoor3_->setStyleClass("btn-danger"); btnPushBack1_->setStyleClass("btn-danger"); btnPushBack2_->setStyleClass("btn-danger"); btnPushBack3_->setStyleClass("btn-danger"); btnPushBack4_->setStyleClass("btn-danger"); dialog = new Wt::WDialog("No connection"); Wt::WLabel *label = new Wt::WLabel("Waiting for simulator connection with iFly 737NG", dialog->contents()); Wt::WNavigationBar *navigation = new Wt::WNavigationBar(); Wt::WStackedWidget *contentsStack = new Wt::WStackedWidget(); Wt::WContainerWidget *groundContainer = new Wt::WContainerWidget(); Wt::WContainerWidget *weatherContainer = new Wt::WContainerWidget(); Wt::WContainerWidget *mapContainer = new Wt::WContainerWidget(); Wt::WContainerWidget *infoContainer = new Wt::WContainerWidget(); Wt::WContainerWidget *gsxContainer = new Wt::WContainerWidget(); Wt::WContainerWidget *statusContainer = new Wt::WContainerWidget(); Wt::WVBoxLayout *mainVLayout = new WVBoxLayout(); setLayout(mainVLayout); // Create a navigation bar with a link to a web page. navigation->setTitle("737ng.kapsi.fi", "http://737ng.kapsi.fi"); navigation->setResponsive(true); // Setup a Left-aligned menu. contentsStack->addStyleClass("contents"); Wt::WMenu *leftMenu = new Wt::WMenu(contentsStack); navigation->addMenu(leftMenu); leftMenu->addItem("Ground", groundContainer); leftMenu->addItem("Weather", weatherContainer); leftMenu->addItem("Map", mapContainer); leftMenu->addItem("Info", infoContainer); leftMenu->addItem("GSX", gsxContainer); mainVLayout->addWidget(navigation, 0); mainVLayout->addWidget(contentsStack, 1); mainVLayout->addWidget(statusContainer, 0); Wt::WGroupBox *groundBox = new Wt::WGroupBox("Ground Equipment"); groundBox->addStyleClass("fieldset-header"); groundBox->addWidget(btnGroundPower_); groundBox->addWidget(btnGroundAir_); groundContainer->addWidget(groundBox); Wt::WGroupBox *doorBox = new Wt::WGroupBox("Aircraft Doors"); doorBox->addStyleClass("fieldset-header"); doorBox->addWidget(btnDoor1_); doorBox->addWidget(btnDoor2_); doorBox->addWidget(btnDoor3_); groundContainer->addWidget(doorBox); Wt::WGroupBox *pushBox = new Wt::WGroupBox("Default Pushback"); pushBox->addStyleClass("fieldset-header"); pushBox->addWidget(btnPushBack1_); pushBox->addWidget(btnPushBack2_); pushBox->addWidget(btnPushBack3_); pushBox->addWidget(new WBreak()); pushBox->addWidget(new WBreak()); pushBox->addWidget(btnPushBack4_); groundContainer->addWidget(pushBox); Wt::WGroupBox *wxrDepMetarBox = new Wt::WGroupBox("Departure Metar"); Wt::WGroupBox *wxrDepTafBox = new Wt::WGroupBox("Departure TAF"); Wt::WGroupBox *wxrArrMetarBox = new Wt::WGroupBox("Arrival Metar"); Wt::WGroupBox *wxrArrTafBox = new Wt::WGroupBox("Arrival TAF"); wxrDepMetarBox->addStyleClass("fieldset-header"); wxrDepTafBox->addStyleClass("fieldset-header"); wxrArrMetarBox->addStyleClass("fieldset-header"); wxrArrTafBox->addStyleClass("fieldset-header"); wxrDepMetarBox->addWidget(txtWxrDep); wxrDepTafBox->addWidget(txtWxrTafDep); wxrArrMetarBox->addWidget(txtWxrArr); wxrArrTafBox->addWidget(txtWxrTafArr); weatherContainer->addWidget(wxrDepMetarBox); weatherContainer->addWidget(wxrDepTafBox); weatherContainer->addWidget(wxrArrMetarBox); weatherContainer->addWidget(wxrArrTafBox); // Map tab //Google map test. No key needed for localhost. map = new Wt::WGoogleMap(Wt::WGoogleMap::Version3); map->setMapTypeControl(Wt::WGoogleMap::DefaultControl); map->enableScrollWheelZoom(); // settings here Wt::WFitLayout* mapBoxLayout = new Wt::WFitLayout(); mapContainer->setLayout(mapBoxLayout); Wt::WGroupBox *mapBox = new Wt::WGroupBox("Map"); mapBox->addStyleClass("fieldset-header"); mapBoxLayout->addWidget(mapBox); Wt::WFitLayout* mapLayout = new Wt::WFitLayout(); mapBox->setLayout(mapLayout); mapLayout->addWidget(map); // Flight info data tab starts here Wt::WContainerWidget *infoFirstRowContainer = new Wt::WContainerWidget(); Wt::WHBoxLayout *infoFirstRowHLayout = new WHBoxLayout(); infoFirstRowContainer->setLayout(infoFirstRowHLayout); Wt::WContainerWidget *infoSecondRowContainer = new Wt::WContainerWidget(); Wt::WHBoxLayout *infoSecondRowHLayout = new WHBoxLayout(); infoSecondRowContainer->setLayout(infoSecondRowHLayout); infoContainer->addWidget(infoFirstRowContainer); infoContainer->addWidget(infoSecondRowContainer); // infobox with flight no and dep and arr icao codes if available txtAlt = new Wt::WText("32013"); txtSpeed = new Wt::WText("450"); txtTemperature = new Wt::WText("-55"); txtOnGround = new Wt::WText("Yes/No"); Wt::WContainerWidget *flightInfoContainer1 = new Wt::WContainerWidget(); Wt::WContainerWidget *flightInfoContainer2 = new Wt::WContainerWidget(); Wt::WContainerWidget *flightInfoContainer3 = new Wt::WContainerWidget(); Wt::WContainerWidget *flightInfoContainer4 = new Wt::WContainerWidget(); flightInfoContainer1->addWidget(new Wt::WText("Alt: ")); flightInfoContainer1->addWidget(new WBreak()); flightInfoContainer1->addWidget(new Wt::WText("Speed: ")); flightInfoContainer2->addWidget(txtAlt); flightInfoContainer2->addWidget(new WBreak()); flightInfoContainer2->addWidget(txtSpeed); flightInfoContainer3->addWidget(new Wt::WText("Temp: ")); flightInfoContainer3->addWidget(new WBreak()); flightInfoContainer3->addWidget(new Wt::WText("On ground: ")); flightInfoContainer4->addWidget(txtTemperature); flightInfoContainer4->addWidget(new WBreak()); flightInfoContainer4->addWidget(txtOnGround); Wt::WHBoxLayout *flightInfoHLayout = new WHBoxLayout(); flightInfoHLayout->addWidget(flightInfoContainer1); flightInfoHLayout->addWidget(flightInfoContainer2); flightInfoHLayout->addWidget(flightInfoContainer3); flightInfoHLayout->addWidget(flightInfoContainer4); Wt::WContainerWidget *flightInfoContainer = new Wt::WContainerWidget(); flightInfoContainer->setLayout(flightInfoHLayout); infoBox = new Wt::WGroupBox(" ( - )"); infoBox->addStyleClass("fieldset-header"); infoBox->addWidget(flightInfoContainer); // OOOI box with out off on in times if available txtOut = new Wt::WText("00:00"); txtOff = new Wt::WText("00:00"); txtOn = new Wt::WText("00:00"); txtIn = new Wt::WText("00:00"); Wt::WContainerWidget *oooiContainer1 = new Wt::WContainerWidget(); Wt::WContainerWidget *oooiContainer2 = new Wt::WContainerWidget(); Wt::WContainerWidget *oooiContainer3 = new Wt::WContainerWidget(); Wt::WContainerWidget *oooiContainer4 = new Wt::WContainerWidget(); oooiContainer1->addWidget(new Wt::WText("Out: ")); oooiContainer1->addWidget(new WBreak()); oooiContainer1->addWidget(new Wt::WText("Off: ")); oooiContainer2->addWidget(txtOut); oooiContainer2->addWidget(new WBreak()); oooiContainer2->addWidget(txtOff); oooiContainer3->addWidget(new Wt::WText("On: ")); oooiContainer3->addWidget(new WBreak()); oooiContainer3->addWidget(new Wt::WText("In: ")); oooiContainer4->addWidget(txtOn); oooiContainer4->addWidget(new WBreak()); oooiContainer4->addWidget(txtIn); Wt::WHBoxLayout *oooiHLayout = new WHBoxLayout(); oooiHLayout->addWidget(oooiContainer1); oooiHLayout->addWidget(oooiContainer2); oooiHLayout->addWidget(oooiContainer3); oooiHLayout->addWidget(oooiContainer4); Wt::WContainerWidget *oooiContainer = new Wt::WContainerWidget(); oooiContainer->setLayout(oooiHLayout); Wt::WGroupBox *oooiBox = new Wt::WGroupBox("OOOI"); oooiBox->addStyleClass("fieldset-header"); oooiBox->addWidget(oooiContainer); // Destination box txtDestinationDTG = new Wt::WText("345"); txtDestinationETA = new Wt::WText("23:59:03"); txtDestinationFuel = new Wt::WText("2900"); Wt::WContainerWidget *destinationContainer1 = new Wt::WContainerWidget(); Wt::WContainerWidget *destinationContainer2 = new Wt::WContainerWidget(); Wt::WContainerWidget *destinationContainer3 = new Wt::WContainerWidget(); Wt::WContainerWidget *destinationContainer4 = new Wt::WContainerWidget(); destinationContainer1->addWidget(new Wt::WText("ETA: ")); destinationContainer1->addWidget(new WBreak()); destinationContainer1->addWidget(new Wt::WText("DTG: ")); destinationContainer2->addWidget(txtDestinationETA); destinationContainer2->addWidget(new WBreak()); destinationContainer2->addWidget(txtDestinationDTG); destinationContainer3->addWidget(new Wt::WText("Fuel: ")); destinationContainer4->addWidget(txtDestinationFuel); Wt::WHBoxLayout *destinationHLayout = new WHBoxLayout(); destinationHLayout->addWidget(destinationContainer1); destinationHLayout->addWidget(destinationContainer2); destinationHLayout->addWidget(destinationContainer3); destinationHLayout->addWidget(destinationContainer4); Wt::WContainerWidget *destinationContainer = new Wt::WContainerWidget(); destinationContainer->setLayout(destinationHLayout); Wt::WGroupBox *destinationBox = new Wt::WGroupBox("Destination"); destinationBox->addStyleClass("fieldset-header"); destinationBox->addWidget(destinationContainer); // Last waypoint box Wt::WContainerWidget *lastWptContainer1 = new Wt::WContainerWidget(); Wt::WContainerWidget *lastWptContainer2 = new Wt::WContainerWidget(); txtLastName = new Wt::WText("ROVIL"); txtLastAlt = new Wt::WText("FL280"); txtLastATA = new Wt::WText("20:38:51"); txtLastFuel = new Wt::WText("4300"); lastWptContainer1->addWidget(new Wt::WText("Name: ")); lastWptContainer1->addWidget(new WBreak()); lastWptContainer1->addWidget(new Wt::WText("ATA: ")); lastWptContainer1->addWidget(new WBreak()); lastWptContainer1->addWidget(new Wt::WText("Fuel: ")); lastWptContainer1->addWidget(new WBreak()); lastWptContainer1->addWidget(new Wt::WText("Alt: ")); lastWptContainer2->addWidget(txtLastName); lastWptContainer2->addWidget(new WBreak()); lastWptContainer2->addWidget(txtLastATA); lastWptContainer2->addWidget(new WBreak()); lastWptContainer2->addWidget(txtLastFuel); lastWptContainer2->addWidget(new WBreak()); lastWptContainer2->addWidget(txtLastAlt); Wt::WHBoxLayout *lastWptHLayout = new WHBoxLayout(); lastWptHLayout->addWidget(lastWptContainer1); lastWptHLayout->addWidget(lastWptContainer2); Wt::WContainerWidget *lastWpContainer = new Wt::WContainerWidget(); lastWpContainer->setLayout(lastWptHLayout); Wt::WGroupBox *progressLastBox = new Wt::WGroupBox("Last WPT"); progressLastBox->addStyleClass("fieldset-header"); progressLastBox->addWidget(lastWpContainer); // Actual waypoint box Wt::WContainerWidget *actWpContainer1 = new Wt::WContainerWidget(); Wt::WContainerWidget *actWpContainer2 = new Wt::WContainerWidget(); txtActName = new Wt::WText("TESTI"); txtActETA = new Wt::WText("20:48:32"); txtActFuel = new Wt::WText("4000"); txtActDTG = new Wt::WText("23"); actWpContainer1->addWidget(new Wt::WText("Name: ")); actWpContainer1->addWidget(new WBreak()); actWpContainer1->addWidget(new Wt::WText("ETA: ")); actWpContainer1->addWidget(new WBreak()); actWpContainer1->addWidget(new Wt::WText("Fuel: ")); actWpContainer1->addWidget(new WBreak()); actWpContainer1->addWidget(new Wt::WText("DTG: ")); actWpContainer2->addWidget(txtActName); actWpContainer2->addWidget(new WBreak()); actWpContainer2->addWidget(txtActETA); actWpContainer2->addWidget(new WBreak()); actWpContainer2->addWidget(txtActFuel); actWpContainer2->addWidget(new WBreak()); actWpContainer2->addWidget(txtActDTG); Wt::WHBoxLayout *actWptHLayout = new WHBoxLayout(); actWptHLayout->addWidget(actWpContainer1); actWptHLayout->addWidget(actWpContainer2); Wt::WContainerWidget *actWpContainer = new Wt::WContainerWidget(); actWpContainer->setLayout(actWptHLayout); Wt::WGroupBox *progressActBox = new Wt::WGroupBox("Actual WPT"); progressActBox->addStyleClass("fieldset-header"); progressActBox->addWidget(actWpContainer); // Next Waypoint Box Wt::WContainerWidget *nextWpContainer1 = new Wt::WContainerWidget(); Wt::WContainerWidget *nextWpContainer2 = new Wt::WContainerWidget(); txtNextName = new Wt::WText("FIXME"); txtNextETA = new Wt::WText("21:02:22"); txtNextFuel = new Wt::WText("3700"); txtNextDTG = new Wt::WText("46"); nextWpContainer1->addWidget(new Wt::WText("Name: ")); nextWpContainer1->addWidget(new WBreak()); nextWpContainer1->addWidget(new Wt::WText("ETA: ")); nextWpContainer1->addWidget(new WBreak()); nextWpContainer1->addWidget(new Wt::WText("Fuel: ")); nextWpContainer1->addWidget(new WBreak()); nextWpContainer1->addWidget(new Wt::WText("DTG: ")); nextWpContainer2->addWidget(txtNextName); nextWpContainer2->addWidget(new WBreak()); nextWpContainer2->addWidget(txtNextETA); nextWpContainer2->addWidget(new WBreak()); nextWpContainer2->addWidget(txtNextFuel); nextWpContainer2->addWidget(new WBreak()); nextWpContainer2->addWidget(txtNextDTG); Wt::WHBoxLayout *nextWptHLayout = new WHBoxLayout(); nextWptHLayout->addWidget(nextWpContainer1); nextWptHLayout->addWidget(nextWpContainer2); Wt::WContainerWidget *nextWpContainer = new Wt::WContainerWidget(); nextWpContainer->setLayout(nextWptHLayout); Wt::WGroupBox *progressNextBox = new Wt::WGroupBox("Next WPT"); progressNextBox->addStyleClass("fieldset-header"); progressNextBox->addWidget(nextWpContainer); // add groupboxes to Layouts infoFirstRowHLayout->addWidget(infoBox); infoFirstRowHLayout->addWidget(oooiBox); infoFirstRowHLayout->addWidget(destinationBox); infoSecondRowHLayout->addWidget(progressLastBox); infoSecondRowHLayout->addWidget(progressActBox); infoSecondRowHLayout->addWidget(progressNextBox); // GSX tab starts here gsxBox = new Wt::WGroupBox("GSX Menu"); gsxBox->addStyleClass("fieldset-header"); gsxContainer->addWidget(gsxBox); Wt::WTable* gsxTable = new Wt::WTable(); gsxTable->setWidth(Wt::WLength("100%")); btnVirtualKeyF12_->addStyleClass("buttongsx"); btnVirtualKey1_->addStyleClass("buttongsx"); btnVirtualKey2_->addStyleClass("buttongsx"); btnVirtualKey3_->addStyleClass("buttongsx"); btnVirtualKey4_->addStyleClass("buttongsx"); btnVirtualKey5_->addStyleClass("buttongsx"); btnVirtualKey6_->addStyleClass("buttongsx"); btnVirtualKey7_->addStyleClass("buttongsx"); btnVirtualKey8_->addStyleClass("buttongsx"); btnVirtualKey9_->addStyleClass("buttongsx"); btnVirtualKey0_->addStyleClass("buttongsx"); btnVirtualKey1_->hide(); btnVirtualKey2_->hide(); btnVirtualKey3_->hide(); btnVirtualKey4_->hide(); btnVirtualKey5_->hide(); btnVirtualKey6_->hide(); btnVirtualKey7_->hide(); btnVirtualKey8_->hide(); btnVirtualKey9_->hide(); btnVirtualKey0_->hide(); gsxTable->elementAt(0, 0)->addWidget(btnVirtualKey1_); gsxTable->elementAt(0, 1)->addWidget(btnVirtualKey6_); gsxTable->elementAt(1, 0)->addWidget(btnVirtualKey2_); gsxTable->elementAt(1, 1)->addWidget(btnVirtualKey7_); gsxTable->elementAt(2, 0)->addWidget(btnVirtualKey3_); gsxTable->elementAt(2, 1)->addWidget(btnVirtualKey8_); gsxTable->elementAt(3, 0)->addWidget(btnVirtualKey4_); gsxTable->elementAt(3, 1)->addWidget(btnVirtualKey9_); gsxTable->elementAt(4, 0)->addWidget(btnVirtualKey5_); gsxTable->elementAt(4, 1)->addWidget(btnVirtualKey0_); gsxTable->elementAt(6, 0)->addWidget(btnVirtualKeyF12_); gsxBox->addWidget(gsxTable); // Bottom statuscontaier with GSX text txtGSXText->addStyleClass("gsxtext"); statusContainer->addWidget(txtGSXText); // Bind the C++ and JavaScript event handlers. btnGroundPower_->clicked().connect(this, &SimpleWebWidget::pressedGroundPower); btnGroundAir_->clicked().connect(this, &SimpleWebWidget::pressedGroundAir); btnDoor1_->clicked().connect(this, &SimpleWebWidget::pressedButtonDoor1); btnDoor2_->clicked().connect(this, &SimpleWebWidget::pressedButtonDoor2); btnDoor3_->clicked().connect(this, &SimpleWebWidget::pressedButtonDoor3); btnPushBack1_->clicked().connect(this, &SimpleWebWidget::pressedPushBack1); btnPushBack2_->clicked().connect(this, &SimpleWebWidget::pressedPushBack2); btnPushBack3_->clicked().connect(this, &SimpleWebWidget::pressedPushBack3); btnPushBack4_->clicked().connect(this, &SimpleWebWidget::pressedPushBack4); btnVirtualKey1_->clicked().connect(this, &SimpleWebWidget::pressedVirtualKey1); btnVirtualKey2_->clicked().connect(this, &SimpleWebWidget::pressedVirtualKey2); btnVirtualKey3_->clicked().connect(this, &SimpleWebWidget::pressedVirtualKey3); btnVirtualKey4_->clicked().connect(this, &SimpleWebWidget::pressedVirtualKey4); btnVirtualKey5_->clicked().connect(this, &SimpleWebWidget::pressedVirtualKey5); btnVirtualKey6_->clicked().connect(this, &SimpleWebWidget::pressedVirtualKey6); btnVirtualKey7_->clicked().connect(this, &SimpleWebWidget::pressedVirtualKey7); btnVirtualKey8_->clicked().connect(this, &SimpleWebWidget::pressedVirtualKey8); btnVirtualKey9_->clicked().connect(this, &SimpleWebWidget::pressedVirtualKey9); btnVirtualKey0_->clicked().connect(this, &SimpleWebWidget::pressedVirtualKey0); btnVirtualKeyF12_->clicked().connect(this, &SimpleWebWidget::pressedVirtualKeyF12); // setup a timer which calls MyClass::timeout() every 60 seconds, until timer->stop() is called. Wt::WTimer *timer = new Wt::WTimer(); timer->setInterval(60000); timer->timeout().connect(this, &SimpleWebWidget::timerTimeout); timer->start(); connect(); }