3 #include <Wt/WPushButton.h> 5 #include <Wt/WApplication.h> 6 #include <Wt/WLineEdit.h> 8 #include "PopupYesNo.h" 10 Wtx::PopupYesNo::PopupYesNo(
const std::string & question )
11 :
Wt::WDialog(
"Yes/No")
13 contents()-> addNew<Wt::WText>(question);
14 contents()-> addNew<Wt::WBreak>();
15 contents()-> addNew<Wt::WPushButton>(
"Yes")->
16 clicked().connect( [=]()
18 m_answered.emit( Wt::StandardButton::Yes );
22 contents()-> addNew<Wt::WPushButton>(
"No")->
23 clicked().connect( [=]()
25 m_answered.emit( Wt::StandardButton::No );
29 rejectWhenEscapePressed();
37 auto popup = wApp-> addChild( std::make_unique<Wtx::PopupYesNo>( question ) );
38 popup-> finished().connect( [=](){ wApp-> removeChild(popup); });
42 Wt::Signal<Wt::StandardButton> & Wtx::PopupYesNo::answered()