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


C++ WText::setTextFormat方法代码示例

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


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

示例1: analyzers

void
WFunctionSummary::init() {
    Wt::WVBoxLayout *vbox = new Wt::WVBoxLayout;
    this->setLayout(vbox);

    analyzers().push_back(FunctionEntryAddress::instance());
    analyzers().push_back(FunctionName::instance());
    analyzers().push_back(FunctionSizeBytes::instance());
    analyzers().push_back(FunctionSizeInsns::instance());
    analyzers().push_back(FunctionSizeBBlocks::instance());
    analyzers().push_back(FunctionSizeDBlocks::instance());
    analyzers().push_back(FunctionNDiscontiguousBlocks::instance());
    analyzers().push_back(FunctionNIntervals::instance());
    analyzers().push_back(FunctionImported::instance());
    analyzers().push_back(FunctionExported::instance());
    analyzers().push_back(FunctionNCallers::instance());
    analyzers().push_back(FunctionNReturns::instance());
    analyzers().push_back(FunctionMayReturn::instance());
    analyzers().push_back(FunctionStackDelta::instance());

    // Build a table to hold analysis results. The results will be organized into NCOLS each occupying two table columns (one
    // for the name and one for the value).
    const size_t NROWS = (analyzers_.size() + NCOLS - 1) / NCOLS;
    wAnalysisResultTable_ = new Wt::WTable();
    vbox->addWidget(wAnalysisResultTable_);

    Wt::WCssDecorationStyle labelDecor;
    labelDecor.setBackgroundColor(toWt(Color::HSV(0, 0, 0.95)));
    for (size_t col=0, i=0; col<NCOLS && i<analyzers_.size(); ++col) {
        for (size_t row=0; row<NROWS && i<analyzers_.size(); ++row) {
            Wt::WText *wLabel = new Wt::WText("<b>" + analyzers_[i]->name() + "</b>");
            wLabel->setToolTip(analyzers_[i]->toolTip());
            wAnalysisResultTable_->elementAt(row, 2*col+0)->addWidget(wLabel);
            wAnalysisResultTable_->elementAt(row, 2*col+0)->setContentAlignment(Wt::AlignRight);
            wAnalysisResultTable_->elementAt(row, 2*col+0)->setDecorationStyle(labelDecor);

            Wt::WText *wValue = new Wt::WText;
            wValue->setTextFormat(Wt::PlainText);
            analyzerResults_.push_back(wValue);
            analyzerResults_.back()->setToolTip(analyzers_[i]->toolTip());
            wAnalysisResultTable_->elementAt(row, 2*col+1)->addWidget(analyzerResults_.back());
            wAnalysisResultTable_->elementAt(row, 2*col+1)->setPadding(Wt::WLength(1, Wt::WLength::FontEm), Wt::Left);
            wAnalysisResultTable_->elementAt(row, 2*col+1)->setPadding(Wt::WLength(10, Wt::WLength::FontEm), Wt::Right);
            ++i;
        }
    }

    // Text area to hold function comments
    wFunctionComments_ = new Wt::WTextArea;
    vbox->addWidget(wFunctionComments_, 1 /*stretch*/);

    // FIXME[Robb P. Matzke 2015-05-06]: We don't provide a way to save results yet, so don't allow comment editing
    wFunctionComments_->setEnabled(false);
}
开发者ID:JamesLinus,项目名称:rose,代码行数:54,代码来源:WFunctionSummary.C


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