13 #include "fwGui/layoutManager/ToolboxLayoutManagerBase.hpp" 15 #include <fwCore/base.hpp> 17 #include <boost/lexical_cast.hpp> 23 namespace layoutManager
27 const ToolboxLayoutManagerBase::RegistryKeyType ToolboxLayoutManagerBase::REGISTRY_KEY =
28 "::fwGui::ToolboxLayoutManager";
46 OSLM_ASSERT(
"Bad configuration name "<<configuration->getName()<<
", must be layout",
47 configuration->getName() ==
"layout");
49 for (ConfigurationType view : configuration->getElements())
51 if( view->getName() ==
"view" )
54 if( view->hasAttribute(
"border") )
56 std::string border = view->getExistingAttributeValue(
"border");
57 vi.m_border = ::boost::lexical_cast<
int >(border);
59 if( view->hasAttribute(
"caption") )
61 vi.m_caption = view->getExistingAttributeValue(
"caption");
63 if( view->hasAttribute(
"minWidth") )
65 std::string width = view->getExistingAttributeValue(
"minWidth");
66 vi.m_minSize.first = ::boost::lexical_cast<
int >(width);
68 if( view->hasAttribute(
"minHeight") )
70 std::string height = view->getExistingAttributeValue(
"minHeight");
71 vi.m_minSize.second = ::boost::lexical_cast<
int >(height);
73 if( view->hasAttribute(
"visible") )
75 std::string visible = view->getExistingAttributeValue(
"visible");
76 OSLM_ASSERT(
"Incorrect value for \"visible\" attribute "<<visible,
77 (visible ==
"true") || (visible ==
"false") ||
78 (visible ==
"yes") || (visible ==
"no"));
79 vi.m_visible = ((visible ==
"true") || (visible ==
"yes"));
81 if( view->hasAttribute(
"expanded") )
83 std::string expanded = view->getExistingAttributeValue(
"expanded");
84 OSLM_ASSERT(
"Incorrect value for \"expanded\" attribute "<<expanded,
85 (expanded ==
"true") || (expanded ==
"false") ||
86 (expanded ==
"yes") || (expanded ==
"no"));
87 vi.m_expanded = ((expanded ==
"true") || (expanded ==
"yes"));
89 if( view->hasAttribute(
"useScrollBar") )
91 std::string useScrollBar = view->getExistingAttributeValue(
"useScrollBar");
92 OSLM_ASSERT(
"Incorrect value for \"useScrollBar\" attribute "<<useScrollBar,
93 (useScrollBar ==
"yes") || (useScrollBar ==
"no"));
94 vi.m_useScrollBar = (useScrollBar==
"yes");
96 m_views.push_back(vi);
#define OSLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
The namespace fwGui contains the base interface for IHM services.