Guest User

Untitled

a guest
Apr 16th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.18 KB | None | 0 0
  1.      
  2. #include <Wt/WApplication>
  3. #include <Wt/WVBoxLayout>
  4. #include <Wt/WHBoxLayout>
  5. #include <Wt/WLineEdit>
  6. #include <Wt/WPushButton>
  7. #include <Wt/WDialog>
  8.      
  9.  
  10. using namespace Wt;    
  11.      
  12.  
  13. class Dialog : public WDialog
  14. {
  15.    public:
  16.       Dialog ()
  17.       : WDialog("title")
  18.       {
  19.          auto layout = new WVBoxLayout(contents());
  20.  
  21.          layout->addWidget(new WLineEdit("foo"));
  22.          layout->addWidget(new WLineEdit("bar"));
  23.  
  24.          auto buttonLayout = new WHBoxLayout(footer());
  25.          buttonLayout->addWidget(new WPushButton("OK"));
  26.          buttonLayout->addWidget(new WPushButton("Cancel"));
  27.       }
  28. };
  29.  
  30.  
  31. class DialogOnFirstPage : public WApplication {
  32.    std::unique_ptr<WDialog> dialog;
  33.  
  34.    public:
  35.       DialogOnFirstPage::DialogOnFirstPage (const WEnvironment& env)
  36.       : WApplication(env)
  37.       {
  38.          dialog.reset(new Dialog);
  39.          dialog->show();
  40.       }
  41.      
  42.       static Wt::WApplication* CreateApplication (const Wt::WEnvironment& env)
  43.       {
  44.          return new DialogOnFirstPage(env);
  45.       }
  46. };
  47.      
  48. int main (int argc, char** argv)
  49. {
  50.    return WRun(argc, argv, &DialogOnFirstPage::CreateApplication);
  51. }
Advertisement
Add Comment
Please, Sign In to add comment