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


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

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


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

示例1: 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

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