コード例 #1
0
ファイル: UserManager.hpp プロジェクト: lyase/witty-plus
 /// Handle an application dialog being shown
 void onDialogExecuted(WDialog* dlg) {
     WMessageBox* msgBox = dynamic_cast<WMessageBox*>(dlg);
     if (msgBox != 0)
         lastMessage = msgBox->text();
     lastTitle = dlg->caption();
     dlg->accept(); // Close it .. we're running tests
 }
コード例 #2
0
CookiesLawDisclaimer::CookiesLawDisclaimer(WContainerWidget* parent, const std::function<void()> &runOnAccepted)
    : WCompositeWidget(parent)
{
  WContainerWidget *content = new WContainerWidget;
  content->addStyleClass("alert alert-danger");
  content->addWidget(new WText("cookies_law_disclaimer"_wtr));
  auto readMoreButton = new WPushButton("cookies_law_readmore"_wtr, content);
  readMoreButton->setStyleClass("btn-link");
  readMoreButton->clicked().connect([=](const WMouseEvent &){
    WMessageBox *messageBox = new WMessageBox("cookies_law_readmore_caption"_wtr, "cookies_law_readmore_text"_wtr, Information, Ok, this);
    messageBox->contents()->setOverflow(WContainerWidget::OverflowAuto);
    messageBox->setHeight(500);
    messageBox->buttonClicked().connect([=](StandardButton, _n5){
      delete messageBox;
    });
    messageBox->show();
  });
  auto agreeButton = new WPushButton("cookies_law_agree"_wtr, content);
  agreeButton->setStyleClass("btn-link");
  agreeButton->clicked().connect([=](const WMouseEvent&){
    wApp->setCookie(COOKIES_LAW_COOKIE_NAME, COOKIES_LAW_COOKIE_VALUE, 60 * 60 * 24 * 365);
    runOnAccepted();
    delete this;
  });
  content->addStyleClass("cookies_law_agreement");
  setImplementation(content);
}
コード例 #3
0
ファイル: AuthWidget.C プロジェクト: 913862627/wt
void AuthWidget::displayInfo(const WString& m)
{
  delete messageBox_;

  WMessageBox *box = new WMessageBox(tr("Wt.Auth.notice"), m, NoIcon, Ok);
  box->buttonClicked().connect(this, &AuthWidget::closeDialog);
  box->show();

  messageBox_ = box;
}
コード例 #4
0
ファイル: MapWidget.cpp プロジェクト: guorenxu/CloudBook
void MapWidget::EnemyTownMessageBox()
{
	WMessageBox *messageBox = new WMessageBox
	("This is the enemy's town.",
	 "Here you will be able to check on how they are doing and declare attacks.",
	 Wt::Information, Wt::Cancel);

	messageBox->setModal(true);

	messageBox->show();

    messageBox->buttonClicked().connect(std::bind([=] () {

	delete messageBox;    }));
}
コード例 #5
0
ファイル: TreeViewDragDrop.C プロジェクト: USP/wtcpp
  /** \brief Process the result of the popup menu
   */
  void popupAction() {
    if (popup_->result()) {
      /*
       * You could also bind extra data to an item using setData() and
       * check here for the action asked. For now, we just use the text.
       */
      WString text = popup_->result()->text();
      popup_->hide();

      popupActionBox_ = new WMessageBox("Sorry.","Action '" + text
					+ "' is not implemented.", NoIcon, Ok);
      popupActionBox_->buttonClicked()
	.connect(this, &TreeViewDragDrop::dialogDone);
      popupActionBox_->show();
    } else {
      popup_->hide();
    }
  }