Guest User

Untitled

a guest
Jun 24th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.41 KB | None | 0 0
  1. #include <QCoreApplication>
  2.  
  3. #include <Agui/UI/AWidget>
  4. #include <Agui/UI/ALayout>
  5. #include <Agui/ACore>
  6. #include <Agui/UI/Style/ABorderRadius.h>
  7. #include <Agui/UI/Style/ABorderWidth.h>
  8. #include <Agui/UI/Style/ABackgroundColor.h>
  9. #include <Agui/UI/Style/AGradient.h>
  10. #include <Agui/UI/Style/AColor.h>
  11.  
  12. using namespace Agui;
  13. int main(int argc, char *argv[])
  14. {
  15.     QCoreApplication a(argc, argv);
  16.  
  17.     ACore core(0, 800, 600);
  18.     core.start();
  19.  
  20.     AWidget* dialog = new AWidget();
  21.     dialog->resize(500, 200);
  22.     dialog->move(100, 350);
  23.  
  24.     ALayout* mainLayout = new ALayout(ALayout::Vertical, 2, 0);
  25.  
  26.     AWidget* dialogTitle = new AWidget();
  27.     dialogTitle->setHeight(30);
  28.  
  29.     ABorderRadius titleRad(4, 4, 0, 0);
  30.     ABorderWidth titleBW(0);
  31.     ABackgroundColor titleBg(0, 0, 0, 150);
  32.  
  33.  
  34.  
  35.     dialogTitle->addStyleOption(&titleRad);
  36.     dialogTitle->addStyleOption(&titleBW);
  37.     dialogTitle->addStyleOption(&titleBg);
  38.  
  39.     ALayout* contentLayout  = new ALayout(ALayout::Vertical, 0, 4);
  40.  
  41.     mainLayout->addWidget(dialogTitle, LayoutItemStretchingNo);
  42.  
  43.     AWidget* content        = new AWidget();
  44.  
  45.     ABorderRadius contentRad(0, 0, 4, 4);
  46.     ABackgroundColor contentBg(200, 200, 200, 150);
  47.  
  48.     content->addStyleOption(&contentRad);
  49.     content->addStyleOption(&contentBg);
  50.  
  51.     contentLayout->addWidget(content);
  52.  
  53.     mainLayout->addLayout(contentLayout);
  54.  
  55.     dialog->setLayout(mainLayout);
  56.  
  57.     dialog->show();
  58.  
  59.     core.screenshot();
  60.  
  61.     return a.exec();
  62. }
Add Comment
Please, Sign In to add comment