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


C++ ConfigurationType::getElements方法代码示例

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


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

示例1: initialize

void ToolboxLayoutManagerBase::initialize( ConfigurationType configuration)
{
    OSLM_ASSERT("Bad configuration name "<<configuration->getName()<< ", must be layout",
                configuration->getName() == "layout");
    m_views.clear();
    for (ConfigurationType view : configuration->getElements())
    {
        if( view->getName() == "view" )
        {
            ViewInfo vi;
            if( view->hasAttribute("border") )
            {
                std::string border = view->getExistingAttributeValue("border");
                vi.m_border = ::boost::lexical_cast< int >(border);
            }
            if( view->hasAttribute("caption") )
            {
                vi.m_caption = view->getExistingAttributeValue("caption");
            }
            if( view->hasAttribute("minWidth") )
            {
                std::string width = view->getExistingAttributeValue("minWidth");
                vi.m_minSize.first = ::boost::lexical_cast< int >(width);
            }
            if( view->hasAttribute("minHeight") )
            {
                std::string height = view->getExistingAttributeValue("minHeight");
                vi.m_minSize.second = ::boost::lexical_cast< int >(height);
            }
            if( view->hasAttribute("visible") )
            {
                std::string visible = view->getExistingAttributeValue("visible");
                OSLM_ASSERT("Incorrect value for \"visible\" attribute "<<visible,
                            (visible == "true") || (visible == "false") ||
                            (visible == "yes") || (visible == "no"));
                vi.m_visible = ((visible == "true") || (visible == "yes"));
            }
            if( view->hasAttribute("expanded") )
            {
                std::string expanded = view->getExistingAttributeValue("expanded");
                OSLM_ASSERT("Incorrect value for \"expanded\" attribute "<<expanded,
                            (expanded == "true") || (expanded == "false") ||
                            (expanded == "yes") || (expanded == "no"));
                vi.m_expanded = ((expanded == "true") || (expanded == "yes"));
            }
            if( view->hasAttribute("useScrollBar") )
            {
                std::string useScrollBar = view->getExistingAttributeValue("useScrollBar");
                OSLM_ASSERT("Incorrect value for \"useScrollBar\" attribute "<<useScrollBar,
                            (useScrollBar == "yes") || (useScrollBar == "no"));
                vi.m_useScrollBar = (useScrollBar=="yes");
            }
            m_views.push_back(vi);
        }
    }
}
开发者ID:fw4spl-org,项目名称:fw4spl,代码行数:56,代码来源:ToolboxLayoutManagerBase.cpp


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