Bug #6219 ยป bugreport-multipleDialogs.cpp
1 |
#include <Wt/WApplication.h>
|
---|---|
2 |
#include <Wt/WContainerWidget.h>
|
3 |
#include <Wt/WPushButton.h>
|
4 |
#include <Wt/WText.h>
|
5 |
#include <Wt/WDialog.h>
|
6 |
|
7 |
using namespace Wt; |
8 |
|
9 |
class BugReportApp : public WApplication |
10 |
{
|
11 |
public:
|
12 |
BugReportApp(const WEnvironment& env); |
13 |
};
|
14 |
|
15 |
BugReportApp::BugReportApp(const WEnvironment& env) |
16 |
: WApplication(env) |
17 |
{
|
18 |
setTitle("BUG REPORT"); |
19 |
|
20 |
//DIALOG//
|
21 |
WDialog *dialog1 = addChild(std::make_unique<Wt::WDialog>()); |
22 |
dialog1->contents()->addNew<Wt::WText>("DIALOG ONE"); |
23 |
dialog1->setTitleBarEnabled(true); |
24 |
dialog1->setTransient(true); |
25 |
dialog1->setClosable(true); |
26 |
dialog1->show(); |
27 |
|
28 |
WDialog *dialog2 = addChild(std::make_unique<Wt::WDialog>()); |
29 |
dialog2->contents()->addNew<Wt::WText>("DIALOG TWO"); |
30 |
dialog2->setTitleBarEnabled(true); |
31 |
dialog2->setTransient(true); |
32 |
dialog2->setClosable(true); |
33 |
dialog2->show(); |
34 |
}
|
35 |
|
36 |
int main(int argc, char **argv) |
37 |
{
|
38 |
return WRun(argc, argv, [](const WEnvironment& env)->auto{ return std::make_unique<BugReportApp>(env); }); |
39 |
}
|
40 |
|