Exemplo n.º 1
0
Arquivo: Main.cpp Projeto: runya-v/run
        /*!
         * \brief Конструктор класса сайта.
         * \param[in] Класс хранения окружения сайта
         */
        CompanyesApplication(const Wt::WEnvironment& env)
            : Wt::WApplication(env)
        {
            this->messageResourceBundle().use(this->appRoot() + "rus_locale");
            this->useStyleSheet(this->appRoot() + "main.css");
            this->setTitle(Wt::WString::tr("Title"));

            Wt::WApplication *app = Wt::WApplication::instance();
            app->setLoadingIndicator(new Wt::WOverlayLoadingIndicator());
            app->styleSheet().addRule("body", "margin: 0px");

            Wt::WStackedWidget* contents = new Wt::WStackedWidget();
            contents->setOverflow(Wt::WContainerWidget::OverflowAuto);
            contents->setPositionScheme(Wt::Relative);

            Wt::WMenu* menu = new Wt::WMenu(contents, Wt::Vertical, 0);
            menu->setRenderAsList(true);
            menu->setStyleClass("menu");

            std::string absolute_path = boost::filesystem::system_complete(boost::filesystem::path(".")).string();
            new RegionsCreator(absolute_path, contents, menu);

            Wt::WHBoxLayout* hlayout = new Wt::WHBoxLayout();
            hlayout->addWidget(menu, 0);
            hlayout->addWidget(contents, 1);

            Wt::WVBoxLayout* vlayout = new Wt::WVBoxLayout(this->root());
            vlayout->addWidget(new Wt::WText(Wt::WString::tr("Header")), 0);
            vlayout->addLayout(hlayout, 1);
        }
Exemplo n.º 2
0
void MainPage::setMainPage(){
    Wt::WHBoxLayout *mainLayout = new Wt::WHBoxLayout();
    root()->setLayout(mainLayout);
    mainLayout->setContentsMargins(0, 10, 0, 0);
    mainLayout->setSpacing(0);


    Wt::WStackedWidget *contents = new Wt::WStackedWidget(0);
    contents->setOverflow(WContainerWidget::OverflowAuto);    
    contents->setStyleClass("contentsp");
    contents->setPositionScheme(Relative); // without needs testing on IE...

    // create a menu
    Wt::WMenu *menu = new Wt::WMenu(contents, Wt::Vertical, 0);
    menu->setRenderAsList(true);
    menu->addStyleClass("menu");

    mainLayout->addWidget(menu);
    mainLayout->addWidget(contents,1);
    mainLayout->addWidget(new Notification());    

    TabWidget *ftp = new TabWidget();
    ftp->addTab("General options", new Wt::WText("Not yet available"));
    ftp->addTab("Users management", new FtpUserController());

    TabWidget *samba = new TabWidget();
    samba->addTab("General options", new Wt::WText("Not yet available"));
    samba->addTab("More options", new Wt::WText("Not yet available"));

    menu->addItem("FTP", ftp);
    menu->addItem("Samba", samba);



    std::vector<WWidget*>::const_iterator a;

    for(a = root()->children().begin();
        a < (root()->children().end());
        a++){        

        if (dynamic_cast<WText*>(*a) != NULL)
          {
            std::cout << dynamic_cast<WText*>(*a)->text() << std::endl;
          }
    }

}