本文整理汇总了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);
}
}
}