Project

General

Profile

Bug #5838 ยป issue_5838.cpp

Roel Standaert, 08/08/2017 04:11 PM

 
1
#include <Wt/WApplication>
2
#include <Wt/WComboBox>
3
#include <Wt/WContainerWidget>
4
#include <Wt/WDialog>
5
#include <Wt/WPushButton>
6
#include <Wt/WServer>
7
#include <Wt/WText>
8

    
9
int main(int argc, char *argv[])
10
{
11
  return Wt::WRun(argc, argv, [](const Wt::WEnvironment &env) {
12
    Wt::WApplication *app = new Wt::WApplication(env);
13

    
14
    Wt::WPushButton *btn = new Wt::WPushButton("Open dialog", app->root());
15
    btn->clicked().connect(std::bind([=]{
16
      Wt::WDialog *dialog = new Wt::WDialog("TEST");
17
      dialog->setWidth(400);
18
      dialog->setHeight(480);
19
      Wt::WComboBox *scanner_list = new Wt::WComboBox;
20
//      scanner_list->addItem("...");
21

    
22
      Wt::WContainerWidget *concenter = new Wt::WContainerWidget;
23
      concenter->setContentAlignment(Wt::AlignCenter);
24
      concenter->setPositionScheme(Wt::Absolute);
25

    
26
      concenter->addWidget(new Wt::WText("TESTDIALOG"));
27

    
28
      dialog->contents()->addWidget(scanner_list);
29
      dialog->contents()->addWidget(concenter);
30

    
31
      dialog->exec();
32
    }));
33

    
34
    return app;
35
  });
36
}
    (1-1/1)