3 #include <Wt/WPushButton.h> 5 #include <Wt/WApplication.h> 7 #include "PopupMessage.h" 9 Wtx::PopupMessage::PopupMessage(
const std::string & message )
10 :
Wt::WDialog(
"Alert")
12 contents()-> addNew<Wt::WText>(message,Wt::TextFormat::UnsafeXHTML);
13 contents()-> addNew<Wt::WBreak>();
14 contents()-> addNew<Wt::WPushButton>(
"Ok")->
15 clicked().connect( [=]()
20 rejectWhenEscapePressed();
28 auto popup = wApp-> addChild( std::make_unique<Wtx::PopupMessage>( message ) );
29 popup-> finished().connect( [=](){ wApp-> removeChild(popup); });
35 return show( message.toUTF8() );
40 return show( std::string(message) );
47 Wt::Signal<std::string> & Wtx::PopupMessage::finished()