Project

General

Profile

Bug #5838 ยป issue_5838.cpp

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

 
#include <Wt/WApplication>
#include <Wt/WComboBox>
#include <Wt/WContainerWidget>
#include <Wt/WDialog>
#include <Wt/WPushButton>
#include <Wt/WServer>
#include <Wt/WText>

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

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

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

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

dialog->contents()->addWidget(scanner_list);
dialog->contents()->addWidget(concenter);

dialog->exec();
}));

return app;
});
}
    (1-1/1)