7 #include "fwGui/registrar/MenuBarRegistrar.hpp" 9 #include "fwGui/GuiRegistry.hpp" 11 #include <fwServices/macros.hpp> 12 #include <fwServices/op/Get.hpp> 14 #include <fwTools/fwID.hpp> 40 return ::fwGui::GuiRegistry::getSIDMenuBar(
m_sid);
46 std::vector< ::fwGui::container::fwMenu::sptr > menus)
49 ::fwGui::container::fwMenu::sptr menu = menus.at(
m_menuSids[menuSid].first );
57 OSLM_ASSERT(
"Bad configuration name "<<configuration->getName()<<
", must be registry",
58 configuration->getName() ==
"registry");
61 unsigned int index = 0;
63 std::vector < ConfigurationType > vectMenus = configuration->find(
"menu");
64 for( ConfigurationType menu : vectMenus)
66 SLM_ASSERT(
"<menu> tag must have sid attribute", menu->hasAttribute(
"sid"));
68 if(menu->hasAttribute(
"sid"))
71 if(menu->hasAttribute(
"start"))
73 std::string startValue = menu->getAttributeValue(
"start");
74 SLM_ASSERT(
"Wrong value '"<< startValue <<
"' for 'start' attribute (require yes or no)",
75 startValue ==
"yes" || startValue ==
"no");
76 start = (startValue ==
"yes");
78 std::string sid = menu->getAttributeValue(
"sid");
79 m_menuSids[sid] = SIDMenuMapType::mapped_type(index, start);
89 ::fwGui::container::fwMenu::sptr menu;
90 for( SIDMenuMapType::value_type sid :
m_menuSids)
92 OSLM_ASSERT(
"Container index "<< sid.second.first <<
" is bigger than subViews size!",
93 sid.second.first < menus.size());
94 menu = menus.at( sid.second.first );
99 ::fwServices::IService::sptr service = ::fwServices::get( sid.first );
117 for( SIDMenuMapType::value_type sid :
m_menuSids)
119 if(sid.second.second)
122 ::fwServices::IService::sptr service = ::fwServices::get( sid.first );
FWSERVICES_API::fwServices::IService::sptr get(::fwData::Object::sptr obj, std::string serviceType)
Get the first service of type serviceType which is attached to obj.
static FWGUI_API void registerSIDMenu(std::string sid,::fwGui::container::fwMenu::sptr menu)
Registers fwMenu associate with service ID.
#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.
static FWGUI_API void actionServiceStopping(std::string actionSid)
Method called when the action service is stopping. Call parent service actionServiceStopping() method...
static FWGUI_API void unregisterSIDMenu(std::string sid)
Unregisters fwMenu associate with service ID.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...