Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Wt/WApplication>
- #include <Wt/WVBoxLayout>
- #include <Wt/WHBoxLayout>
- #include <Wt/WLineEdit>
- #include <Wt/WPushButton>
- #include <Wt/WDialog>
- using namespace Wt;
- class Dialog : public WDialog
- {
- public:
- Dialog ()
- : WDialog("title")
- {
- auto layout = new WVBoxLayout(contents());
- layout->addWidget(new WLineEdit("foo"));
- layout->addWidget(new WLineEdit("bar"));
- auto buttonLayout = new WHBoxLayout(footer());
- buttonLayout->addWidget(new WPushButton("OK"));
- buttonLayout->addWidget(new WPushButton("Cancel"));
- }
- };
- class DialogOnFirstPage : public WApplication {
- std::unique_ptr<WDialog> dialog;
- public:
- DialogOnFirstPage::DialogOnFirstPage (const WEnvironment& env)
- : WApplication(env)
- {
- dialog.reset(new Dialog);
- dialog->show();
- }
- static Wt::WApplication* CreateApplication (const Wt::WEnvironment& env)
- {
- return new DialogOnFirstPage(env);
- }
- };
- int main (int argc, char** argv)
- {
- return WRun(argc, argv, &DialogOnFirstPage::CreateApplication);
- }
Advertisement
Add Comment
Please, Sign In to add comment