当前位置: 首页>>代码示例>>C++>>正文


C++ WVBoxLayout::addWidget方法代码示例

本文整理汇总了C++中WVBoxLayout::addWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ WVBoxLayout::addWidget方法的具体用法?C++ WVBoxLayout::addWidget怎么用?C++ WVBoxLayout::addWidget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WVBoxLayout的用法示例。


在下文中一共展示了WVBoxLayout::addWidget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AbstractUi

WebUi::WebUi(WApplication *app) :
    AbstractUi(),
    m_app(app)
{
    app->setTitle("Quassel web interface");
    WVBoxLayout *layout = new WVBoxLayout;
    app->root()->setLayout(layout);
    
    /*m_loginButton = new WPushButton("Connect");
    m_loginButton->clicked().connect(this, &WebUi::connect);
    layout->addWidget(m_loginButton);*/

    _chatView = new WTableView(app->root());
    layout->addWidget(_chatView);

    _inputWidget = new WLineEdit(app->root());
    layout->addWidget(_inputWidget);
    

    QObject::connect(Client::coreConnection(), SIGNAL(userAuthenticationRequired(CoreAccount*,bool*,QString)), SLOT(userAuthenticationRequired(CoreAccount*,bool*,QString)));
    QObject::connect(Client::coreConnection(), SIGNAL(connectionMsg(QString)), SLOT(printMsg(QString)));
    QObject::connect(Client::coreConnection(), SIGNAL(progressTextChanged(QString)), SLOT(printMsg(QString)));
    QObject::connect(Client::coreConnection(), SIGNAL(connectionError(QString)), SLOT(printMsg(QString)));
    QObject::connect(Client::coreConnection(), SIGNAL(connectionErrorPopup(QString)), SLOT(printMsg(QString)));
    //QObject::connect(Client::coreConnection(), SIGNAL(userAuthenticationRequired(CoreAccount*,bool*,QString)), SLOT(userAuthenticationRequired(CoreAccount*,bool*,QString)));
    //Client::coreAccountModel()->load();
    //if (!Client::coreConnection()->connectToCore()) {
        bool ok;
        userAuthenticationRequired(0, &ok, "");
    //}
}
开发者ID:biffhero,项目名称:quassel-web,代码行数:31,代码来源:webui.cpp

示例2: doEditPage

void WsContent::doEditPage(std::string path)
{
  std::string newPath = path;
  boost::algorithm::replace_first(newPath, "/Edit", "");
  boost::algorithm::replace_first(newPath, "/SiteMap", "");
  std::string sPathWithoutPrefix = WsApp->WsModules().pathWithoutPrefix(newPath); // ex. /SiteMap
  std::string     sysPath(m_sDocumentRoot + sPathWithoutPrefix);
  WsUser*         pUser       = WsApp->wsUser();
  NodePtr         pNode       = pUser->getAccessRoot()->eatPath(sPathWithoutPrefix);
  if (!pNode.get() ) {
    addWidget(new WsErrorPage(WsErrorPage::Error, path, pUser, "Returned node is null"));
    return;
  }
  clear();
  setOverflow(WContainerWidget::OverflowAuto);
  WVBoxLayout* vbox = new WVBoxLayout();
  setLayout(vbox);
  WsFormConfig* m_formConfig = new WsFormConfig(pNode, WsApp->WsModules());
  vbox->addWidget(m_formConfig, 0);
  vbox->addWidget(WsApp->WsModules().module("WsModEditorUploader")->createContents());
  std::string     strExt(boost::filesystem::extension(sPathWithoutPrefix));
  if ( strExt == ".fhtml" ) {
    if ( !gdcore_isPathFile(sysPath) ) return;
    gdFHtmlEditor* pEditor = new gdFHtmlEditor("", false);
    pEditor->setCurrentPath(sysPath);
    pEditor->readFile();
    m_formConfig->setEditorFhtml(pEditor);
    pEditor->resize(WLength(100, WLength::Percentage), WLength(400));
    vbox->addWidget(pEditor, 1);
  }
}
开发者ID:Wittyshare,项目名称:wittyshare,代码行数:31,代码来源:WsContent.cpp

示例3: init

void gdContainerBar::init()
{
  makeToolbar();
  WVBoxLayout*       vbox = new WVBoxLayout();
  if ( !m_pPanel || !m_pPanel->titleBar() )
    vbox->addWidget(m_pToolBar,  0);
  //   else
  //     m_pPanel->titleBarWidget()->addWidget(m_pToolBar);
  vbox->addWidget(m_pView, 1);
  resize(WLength(100, WLength::Percentage), WLength(100, WLength::Percentage));
  setOverflow(WContainerWidget::OverflowHidden);
  setLayout(vbox);
  view()->model()->rowsInserted().connect(SLOT(this, gdContainerBar::doModelRowCountChanged));
  view()->model()->rowsRemoved() .connect(SLOT(this, gdContainerBar::doModelRowCountChanged));
}
开发者ID:Wittyshare,项目名称:gdwtcore,代码行数:15,代码来源:gdContainerBar.cpp

示例4: WContainerWidget

///
//  Constructor
//
ResultsTable::ResultsTable(WContainerWidget *parent) :
    WContainerWidget(parent),
    mSortFilterProxyModel(NULL)
{
    setStyleClass("tabdiv");

    mModel = new WStandardItemModel(this);
    mModel->insertColumns(0, 11);
    mModel->setHeaderData(0, boost::any(WString::fromUTF8("Date")));
    mModel->setHeaderData(1, boost::any(WString::fromUTF8("User")));
    mModel->setHeaderData(2, boost::any(WString::fromUTF8("MRID")));
    mModel->setHeaderData(3, boost::any(WString::fromUTF8("Name")));
    mModel->setHeaderData(4, boost::any(WString::fromUTF8("Scan Name")));
    mModel->setHeaderData(5, boost::any(WString::fromUTF8("Birthday")));
    mModel->setHeaderData(6, boost::any(WString::fromUTF8("Scan Date")));
    mModel->setHeaderData(7, boost::any(WString::fromUTF8("Manufacturer")));
    mModel->setHeaderData(8, boost::any(WString::fromUTF8("Model")));
    mModel->setHeaderData(9, boost::any(WString::fromUTF8("Software Ver")));
    mModel->setHeaderData(10, boost::any(WString::fromUTF8("Pipeline")));
    mModel->invisibleRootItem()->setRowCount(0);

    mTreeView = new WTreeView();
    mTreeView->setRootIsDecorated(false);
    mTreeView->setAlternatingRowColors(true);
    mTreeView->setSelectionMode(SingleSelection);
    mTreeView->doubleClicked().connect(SLOT(this, ResultsTable::jobSelected));
    mTreeView->clicked().connect(SLOT(this, ResultsTable::jobClicked));

    WVBoxLayout *layout = new WVBoxLayout();
    layout->addWidget(mTreeView);

    setLayout(layout);

    resetAll();
}
开发者ID:FNNDSC,项目名称:web,代码行数:38,代码来源:ResultsTable.cpp

示例5: createUI

  /*! \brief Setup the user interface.
   */
  void createUI() {
    WContainerWidget *w = root();
    w->setStyleClass("maindiv");

    /*
     * The main layout is a 3x2 grid layout.
     */
    WGridLayout *layout = new WGridLayout();
    layout->addWidget(createTitle("Folders"), 0, 0);
    layout->addWidget(createTitle("Files"), 0, 1);
    layout->addWidget(folderView(), 1, 0);
    layout->setColumnResizable(0);

    // select the first folder
    folderView_->select(folderModel_->index(0, 0, folderModel_->index(0, 0)));

    WVBoxLayout *vbox = new WVBoxLayout();
    vbox->addWidget(fileView(), 1);
    vbox->addWidget(pieChart(), 1);
    vbox->setResizable(0);

    layout->addLayout(vbox, 1, 1);

    layout->addWidget(aboutDisplay(), 2, 0, 1, 2);

    /*
     * Let row 1 and column 1 take the excess space.
     */
    layout->setRowStretch(1, 1);
    layout->setColumnStretch(1, 1);

    w->setLayout(layout);
  }
开发者ID:USP,项目名称:wtcpp,代码行数:35,代码来源:TreeViewDragDrop.C

示例6: letLogin

void SimpleChatWidget::letLogin()
{
  disconnect();

  clear();

  WVBoxLayout *vLayout = new WVBoxLayout();
  setLayout(vLayout, AlignLeft | AlignTop);

  WHBoxLayout *hLayout = new WHBoxLayout();
  vLayout->addLayout(hLayout);

  hLayout->addWidget(new WLabel("User name:"), 0, AlignMiddle);
  hLayout->addWidget(userNameEdit_ = new WLineEdit(user_), 0, AlignMiddle);
  userNameEdit_->setFocus();

  WPushButton *b = new WPushButton("Login");
  hLayout->addWidget(b, 0, AlignMiddle);

  b->clicked().connect(this, &SimpleChatWidget::login);
  userNameEdit_->enterPressed().connect(this, &SimpleChatWidget::login);

  vLayout->addWidget(statusMsg_ = new WText());
  statusMsg_->setTextFormat(PlainText);
}
开发者ID:bvanhauwaert,项目名称:wt,代码行数:25,代码来源:SimpleChatWidget.C

示例7: WContainerWidget

///
//  Constructor
//
MonitorPage::MonitorPage(const MRIBrowser *mriBrowser,
                         WContainerWidget *parent) :
    WContainerWidget(parent),
    mMRIBrowser(mriBrowser)
{
    setStyleClass("tabdiv");

    WGridLayout *layout = new WGridLayout();
    layout->addWidget(createTitle("Cluster Jobs"), 0, 0);

    WTabWidget *tabWidget = new WTabWidget();
    tabWidget->setStyleClass("toptabdiv");
    mMonitorLogTab = new MonitorLogTab(mriBrowser);
    mMonitorResultsTab = new MonitorResultsTab(mriBrowser);
    tabWidget->addTab(mMonitorResultsTab, "Results");
    tabWidget->addTab(mMonitorLogTab, "Logs");
    layout->addWidget(tabWidget, 1, 1);

    WVBoxLayout *clusterJobsLayout = new WVBoxLayout();
    mClusterJobBrowser = new ClusterJobBrowser();
    mPatientInfoBox = new PatientInfoBox();
    mPatientInfoBox->setStyleClass("verysmallgroupdiv");

    clusterJobsLayout->addWidget(mClusterJobBrowser);
    clusterJobsLayout->addWidget(mPatientInfoBox);

    layout->addLayout(clusterJobsLayout, 1, 0);


    // Let row 1 and column 2 take the excess space.
    layout->setRowStretch(1, 1);
    layout->setColumnStretch(1, 1);

    setLayout(layout);

    // Make connections
    mClusterJobBrowser->clusterJobSelected().connect(SLOT(this, MonitorPage::jobSelectedChanged));

    // All items in the tabbed widget need to be resized to 100% to
    // fill the contents.  This trick came from the Wt WTabWidget
    // documentation and took me a good half a day to figure out.
    mMonitorLogTab->resize(WLength(100, WLength::Percentage),
                           WLength(100, WLength::Percentage));
    mMonitorResultsTab->resize(WLength(100, WLength::Percentage),
                               WLength(100, WLength::Percentage));

}
开发者ID:FNNDSC,项目名称:web,代码行数:50,代码来源:MonitorPage.cpp

示例8: createLayout

void SimpleChatWidget::createLayout(WWidget *messages, WWidget *userList,
				    WWidget *messageEdit,
				    WWidget *sendButton, WWidget *logoutButton)
{
  /*
   * Create a vertical layout, which will hold 3 rows,
   * organized like this:
   *
   * WVBoxLayout
   * --------------------------------------------
   * | nested WHBoxLayout (vertical stretch=1)  |
   * |                              |           |
   * |  messages                    | userList  |
   * |   (horizontal stretch=1)     |           |
   * |                              |           |
   * --------------------------------------------
   * | message edit area                        |
   * --------------------------------------------
   * | WHBoxLayout                              |
   * | send | logout                            |
   * --------------------------------------------
   */
  WVBoxLayout *vLayout = new WVBoxLayout();

  // Create a horizontal layout for the messages | userslist.
  WHBoxLayout *hLayout = new WHBoxLayout();

  // Add widget to horizontal layout with stretch = 1
  hLayout->addWidget(messages, 1);
  messages->setStyleClass("chat-msgs");

    // Add another widget to horizontal layout with stretch = 0
  hLayout->addWidget(userList);
  userList->setStyleClass("chat-users");

  hLayout->setResizable(0, true);

  // Add nested layout to vertical layout with stretch = 1
  vLayout->addLayout(hLayout, 1);

  // Add widget to vertical layout with stretch = 0
  vLayout->addWidget(messageEdit);
  messageEdit->setStyleClass("chat-noedit");

  // Create a horizontal layout for the buttons.
  hLayout = new WHBoxLayout();

  // Add button to horizontal layout with stretch = 0
  hLayout->addWidget(sendButton);

  // Add button to horizontal layout with stretch = 0
  hLayout->addWidget(logoutButton);

  // Add nested layout to vertical layout with stretch = 0
  vLayout->addLayout(hLayout, 0, AlignLeft);

  setLayout(vLayout);
}
开发者ID:LifeGo,项目名称:wt,代码行数:58,代码来源:SimpleChatWidget.C

示例9: search_presenting

void Example::search_presenting(WContainerWidget* cw,
                                const MapViewer::GeoNodes& nodes) {
    WContainerWidget* cw_n = new WContainerWidget();
    WVBoxLayout* vl = new WVBoxLayout();
    BOOST_FOREACH (MapViewer::GeoNode node, nodes) {
        Coordinate& pos = node.first;
        vl->addWidget(new WText(node.second + "<br />" +
                                str(boost::format("%.4f %.4f")
                                    % pos.longitude() % pos.latitude())),
                      AlignTop);
    }
开发者ID:NCAR,项目名称:wt-classes,代码行数:11,代码来源:map-viewer.cpp

示例10: renderUI

void AdsEditor::renderUI() {
  AdsApplication *app = AdsApplication::adsApplication();
  cppdb::session &db = app->db_;
  
  clear();
  WPushButton *btn = new WPushButton("Criar Anuncio", this);
  btn->clicked().connect(this, &AdsEditor::novoAnuncio);
  WPushButton *update = new WPushButton("Atualiza", this);
  update->clicked().connect(this, &AdsEditor::renderUI);
  new WBreak(this);
  new WBreak(this);
  new WText("<h3>Lista de Anuncios</h3>",this);
  
  Wt::WContainerWidget *w = new Wt::WContainerWidget(this);
  w->resize(600, WLength::Auto);
  WVBoxLayout *layout = new Wt::WVBoxLayout();
  cppdb::result res = db <<
    "select id, titulo, url, imagem, texto, ativo "
    " from anuncio";
  while(res.next()) {
    WContainerWidget *cont = new WContainerWidget();
    AdsAnuncio *anuncio = new AdsAnuncio(cont);
    
    res >>  anuncio->id >> anuncio->titulo_ >> anuncio->link_ >>
      anuncio->imagem_ >> anuncio->texto_ >> anuncio->ativo_;    
    
    WPushButton *tituloBtn = new WPushButton("Titulo",cont);
    tituloBtn->clicked().connect(anuncio, &AdsAnuncio::editarTitulo);
    
    WPushButton *urlBtn = new WPushButton("URL",cont);
    urlBtn->clicked().connect(anuncio, &AdsAnuncio::editarURL);
    
    WPushButton *imagemBtn = new WPushButton("Imagem",cont);
    imagemBtn->clicked().connect(anuncio, &AdsAnuncio::editarImagem);
    
    WPushButton *textoBtn = new WPushButton("Texto",cont);
    textoBtn->clicked().connect(anuncio, &AdsAnuncio::editarTexto);
    
    WCheckBox *ativoCheck = new Wt::WCheckBox("Ativo",cont);
    if(anuncio->ativo_ == 1)
      ativoCheck->setChecked(true);
    else 
      ativoCheck->setChecked(false);
    ativoCheck->changed().connect(anuncio, &AdsAnuncio::changeAtiva);

    WPushButton *deletaBtn = new WPushButton("Deleta",cont);
    deletaBtn->clicked().connect(anuncio, &AdsAnuncio::deletaAnuncio);

    anuncio->renderUI();
    layout->addWidget(cont);
  }
  w->setLayout(layout);
}
开发者ID:trumae,项目名称:PractWave,代码行数:53,代码来源:AdsEditor.cpp

示例11: WContainerWidget

HydrovoltsConnectChartView::HydrovoltsConnectChartView(
    HydrovoltsConnectModel* pModel,
    WContainerWidget* parent):
    WContainerWidget(parent),
    m_y1(HydrovoltsConnectModel::COL_POWER),
    m_y2(HydrovoltsConnectModel::COL_POWER, LineSeries, Y2Axis)
{
    m_pModel = pModel;
    resize(WLength::Auto, 600);
    //resize(WLength::Auto, WLength::Auto);

    setStyleClass("layoutdiv");
    CreateChart();
    HydrovoltsConnectChartToolbar* pToolbar = new HydrovoltsConnectChartToolbar( m_pModel, this);
    pToolbar->y1Changed().connect(this, &HydrovoltsConnectChartView::OnY1Changed);
    pToolbar->y2Changed().connect(this, &HydrovoltsConnectChartView::OnY2Changed);

    WVBoxLayout *pLayout = new WVBoxLayout();

    if (pLayout != NULL && m_pChart != NULL && pToolbar != NULL)
    {

        setWidth(WLength::Auto);

        // Toolbar
        pLayout->addWidget(pToolbar);
        pLayout->setStretchFactor(pToolbar, 0);

        // Chart
        pLayout->addWidget(m_pChart);
        pLayout->setStretchFactor(m_pChart,100);
        //pLayout->setRowStretch();
        //pLayout->setColumnStretch();

        setLayoutSizeAware(true);
        setLayout(pLayout);
    }
}
开发者ID:hydrovolts,项目名称:hvconnect,代码行数:38,代码来源:HydrovoltsConnectChartView.cpp

示例12: setup

void Home::setup()
{
  /*
   * This function switches between the two major components of the homepage,
   * depending on the internal path:
   * /src -> source viewer
   * /... -> homepage
   *
   * FIXME: we should take into account language /cn/src ...
   */
  std::string base = internalPathNextPart("/");

  if (base == SRC_INTERNAL_PATH) {
    if (!sourceViewer_) {
      delete homePage_;
      homePage_ = 0;

      root()->clear();

      sourceViewer_ = sourceViewer("/" + SRC_INTERNAL_PATH + "/");
      WVBoxLayout *layout = new WVBoxLayout();
      layout->setContentsMargins(0, 0, 0, 0);
      layout->addWidget(sourceViewer_);
      root()->setLayout(layout);
    }
  } else {
    if (!homePage_) {
      delete sourceViewer_;
      sourceViewer_ = 0;

      root()->clear();

      createHome();
      root()->addWidget(homePage_);

      setLanguageFromPath();
    }
  }
}
开发者ID:GuLinux,项目名称:wt,代码行数:39,代码来源:Home.C

示例13: viewDirectory

void WsContent::viewDirectory(const std::string& path)
{
  WsUser*         pUser        = WsApp->wsUser();
  NodePtr pRootNode    = pUser->getAccessRoot();
  if ( !pRootNode ) {
    wApp->log("notice") <<  "WsContent::viewDirectory() : Path = " << path << ", getAccessRoot() is null";
    return;
  }
  NodePtr pNode        = pRootNode.get()->eatPath(path);
  if ( !pNode.get() ) {
    wApp->log("notice") <<  "WsContent::viewDirectory() : Path = " << path << ", getAccessRoot() eatPath is null";
    return;
  }
  std::string     sInitPage    = pNode.get()->getProperties().get()->get("global", "initial_page", "");
  if ( sInitPage.size() > 0 ) {
    std::string newPage =  pNode.get()->getPath().string() + "/" + sInitPage;
    wApp->log("notice") <<  "WsContent::viewDirectory() : set initial page to " << newPage;
    return wApp->setInternalPath(newPage, true);
  }
  clear();
  if ( !(pUser->isAdministrator() || pUser->isEditor()) )
    if ( WsLayoutProperties::instance()->get("global", "use_content_directory_view", "false") == "false" ) return;
  WsApp->hideImages(false);
  WWidget* w = WsApp->WsModules().module("WsModDirectoryView2")->createContents();
  WsOptions* wOpt = dynamic_cast<WsOptions*>(w);
  wOpt->setOption("rootPath", path);
  if ( 0 ) {
    WVBoxLayout*  vBox = new WVBoxLayout();
    vBox->addWidget(w, 1);
    setLayout(vBox);
    setOverflow(WContainerWidget::OverflowHidden);
  } else {
    addWidget(w);
    setOverflow(WContainerWidget::OverflowAuto);
  }
}
开发者ID:Wittyshare,项目名称:wittyshare,代码行数:36,代码来源:WsContent.cpp

示例14: selectWidget

void WsContent::selectWidget(std::string path)
{
  std::string             sysPath(m_sDocumentRoot + path);
  boost::filesystem::path p(path);
  std::string             strExt (p.extension().string());
  std::string             strName(p.stem().string());
  std::string             strFileName(strName + strExt);
  std::string             fileContent;
  if ( m_bLogContent )
    wApp->log("notice") << "WsContent::selectWidget :  path = " << path << " name = " << strName << " extension = " << strExt << " system path = " << sysPath;
  // This extension is mainly created for allowing text in a image without a link
  if ( strExt == ".nolink" ) {
    addWidget(new WsErrorPage(WsErrorPage::Error, path, 0, "Extension not allowed", true));
    return;
  }
  // .html
  if ( strExt == ".html" ) {
    if ( m_bLogContent )
      wApp->log("notice") << "WsContent::selectWidget : render a html file : " << sysPath;
    if ( !m_bAllowHtmlRendering ) {
      addWidget(new WsErrorPage(WsErrorPage::Error, path, 0, "Rendering a html file is not allowed"));
      return;
    }
    clear();
    WsApp->hideImages(false);
    WText* pIFrame = new WText();
    pIFrame->setTextFormat(XHTMLUnsafeText);
    pIFrame->setText("<iframe src='" + m_sRelativeDocumentRoot + path + "' height='98%' width='100%' frameborder='0'></iframe>");
    addWidget(pIFrame);
    return;
  }
  // .form
  if ( strExt == ".form" ) {
    if ( m_bLogContent )
      wApp->log("notice") << "WsContent::selectWidget : render a form : " << sysPath;
    clear();
    m_curWForm = new gdWForm(sysPath);
    addWidget(m_curWForm);
    return;
  }
  // .itpl, Inside template : Extension that create a template in the content.
  if ( strExt == ".itpl" ) {
    if ( m_bLogContent )
      wApp->log("notice") << "WsContent::selectWidget : render an inside template : " << sysPath;
    clear();
    WsTemplate* pTemplate = new WsTemplate(strFileName);
    addWidget(pTemplate);
    return;
  }
  // directory
  if ( gdcore_isPathDirectory(sysPath) ) {
    if ( m_bLogContent )
      wApp->log("notice") << "WsContent::selectWidget : render a directory : " << sysPath;
    viewDirectory(path);
    return;
  }
  /*
  Koen : mmm this is a tricky problem. you could do this using an internal path so that you can first let the user authenticate, if necessary, and then you redirect to a static resource with some randomly generated token in the URL so that you can serve the file
  so the permalink is clean, like /cms/folder1/folder2/file.doc
  if your app is deployed at / or /cms, you handle the internal path, authenticate, etc...
  then finally, you create a random ID, and redirect to /resource/folder1/folder2/file.doc?auth=randomid
  and this is handled by a WResource which checks the path and serves the file
  if you prefer I can create a small example ...
  ooops ! must run !
  */
  if ( strExt == ".rss" ) {
    if ( m_bLogContent )
      wApp->log("notice") << "WsContent::selectWidget : render a " << strExt << " file : " << sysPath;
    clear();
    WsApp->hideImages(false);
    addWidget(new WText("Download file : " + path + " ..."));
    return wApp->redirect(m_sRelativeDocumentRoot + path);
  }
  for (int iModule = 0; iModule < WsApp->WsModules().modules().size(); iModule++) {
    WsModule* curModule = WsApp->WsModules().modules()[iModule]->module;
    if ( curModule->isLoaded() ) continue;
    if ( (strExt.size() == 0  && strName == curModule->fileName()) || (strExt.size() > 0 && strExt == curModule->extension(strExt))  ) {
      if ( m_bLogContent )
        if ( strExt == curModule->extension(strExt) )
          wApp->log("notice") << "WsContent::selectWidget : module, render a " << strExt << " file extension : " << sysPath;
        else
          wApp->log("notice") << "WsContent::selectWidget : module, render " << strName << " file name: " << sysPath;
      clear();
      WsApp->hideImages(curModule->hideImages());
      curModule->setSysPath(sysPath);
      curModule->setDiffPath(m_sRelativeDocumentRoot);
      WWidget* w = curModule->createContents();
      if ( w ) {
        if ( asString(curModule->option("useLayout")) == "true" ) {
          WVBoxLayout* vbox = new WVBoxLayout();
          vbox->addWidget(w, 1);
          setLayout(vbox);
        } else {
          addWidget(w);
        }
      } else {
        wApp->log("notice") << "WsContent::selectWidget : module, render " << curModule->moduleName() << " CANNOT call create content: ";
      }
      return;
    }
//.........这里部分代码省略.........
开发者ID:Wittyshare,项目名称:wittyshare,代码行数:101,代码来源:WsContent.cpp

示例15: BaseWidget

IdeaSubmit::IdeaSubmit(CgiRoot *cgi, Wt::WDialog *parentDialog, bool editMode, size_t editRowId) : BaseWidget(cgi),
    m_dlgParent(parentDialog),
    m_editMode(editMode),
    m_editRowId(editRowId),
    m_editCompletedHandler(this)
{
    this->clear();
    this->addWidget(Layout());

    this->setOverflow(WContainerWidget::OverflowAuto);

    Div *dvButtonWrappers = new Div();
    Div *dvButtons = new Div(dvButtonWrappers, "dvDialogButtons");
    WPushButton *submitButton;
    if (!m_editMode)
        submitButton = new WPushButton(m_lang->GetString("HOME_SUBMIT_IDEA_DLG_OK_BUTTON"), dvButtons);
    else
        submitButton = new WPushButton(m_lang->GetString("HOME_SUBMIT_IDEA_DLG_OK_EDIT_BUTTON"), dvButtons);
    WPushButton *returnButton = new WPushButton(m_lang->GetString("HOME_SUBMIT_IDEA_DLG_RETURN_BUTTON"), dvButtons);

    submitButton->setStyleClass("dialogButton");
    returnButton->setStyleClass("dialogButton");

    WVBoxLayout *layout = new WVBoxLayout();

    layout->addWidget(this);
    layout->setStretchFactor(this, 1);

    layout->addWidget(dvButtonWrappers );
    layout->setStretchFactor(dvButtonWrappers , 0);


    m_dlgParent->contents()->setLayout(layout);

    if (m_editMode) {
        string title;
        int typegamesentertainment;
        int typehygienehealth;
        int typenewsinfo;
        int typelearning;
        int typenonepresenceservices;
        int typeonlineshopping;
        int typeothers;
        string typeotherstext;
        string description;
        int audienceteens;
        int audienceparents;
        int audienceboys;
        int audiencegirls;
        int audiencewomen;
        int audiencemen;
        int audiencechilds;
        int audienceallfamilymembers;
        string usage;
        string similar;
        string difference;

        result r = m_db->Sql() << "SELECT title, "
                                  "typegamesentertainment, typehygienehealth, typenewsinfo, typelearning, "
                                  "typenonepresenceservices, typeonlineshopping, typeothers, typeotherstext, "
                                  "description, "
                                  "audienceteens, audienceparents, audienceboys, audiencegirls, audiencewomen, "
                                  "audiencemen, audiencechilds, audienceallfamilymembers, "
                                  "usage, similar, difference "
                                  "FROM [" + m_dbTables->Table("IDEAS")
                                  + "] WHERE rowid=?;" << m_editRowId << row;
        if (!r.empty()) {
            r >> title >> typegamesentertainment >> typehygienehealth
              >> typenewsinfo >> typelearning >> typenonepresenceservices >> typeonlineshopping
              >> typeothers >> typeotherstext >> description >> audienceteens >> audienceparents >> audienceboys
              >> audiencegirls >> audiencewomen >> audiencemen >> audiencechilds >> audienceallfamilymembers
              >> usage >> similar >> difference;

            title = Crypto::Decrypt(title);
            typeotherstext = Crypto::Decrypt(typeotherstext);
            description = Crypto::Decrypt(description);
            usage = Crypto::Decrypt(usage);
            similar = Crypto::Decrypt(similar);
            difference = Crypto::Decrypt(difference);

            m_typeGamesEntertainmentCheckBox->setChecked(typegamesentertainment);
            m_typeHygieneHealthCheckBox->setChecked(typehygienehealth);
            m_typeNewsInfoCheckBox->setChecked(typenewsinfo);
            m_typeLearningCheckBox->setChecked(typelearning);
            m_typeNonePresenceServicesCheckBox->setChecked(typenonepresenceservices);
            m_typeOnlineShoppingCheckBox->setChecked(typeonlineshopping);
            m_typeOthersCheckBox->setChecked(typeothers);
            if (typeothers)
                m_typeOthersTextLineEdit->setText(WString::fromUTF8(typeotherstext));
            m_titleLineEdit->setText(WString::fromUTF8(title));
            m_descriptionTextArea->setText(WString::fromUTF8(description));
            m_audienceTeensCheckBox->setChecked(audienceteens);
            m_audienceParentsCheckBox->setChecked(audienceparents);
            m_audienceBoysCheckBox->setChecked(audienceboys);
            m_audienceGirlsCheckBox->setChecked(audiencegirls);
            m_audienceWomenCheckBox->setChecked(audiencewomen);
            m_audienceMenCheckBox->setChecked(audiencemen);
            m_audienceChildsCheckBox->setChecked(audiencechilds);
            m_audienceAllFamilyMembersCheckBox->setChecked(audienceallfamilymembers);
            m_usageTextArea->setText(WString::fromUTF8(usage));
//.........这里部分代码省略.........
开发者ID:Siadatian,项目名称:samsungdforum.ir,代码行数:101,代码来源:ideasubmit.cpp


注:本文中的WVBoxLayout::addWidget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。