X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FcreaButtonContainer%2Fmodel%2FcontainerSettings.cxx;h=188d0890677b6fd9cc39eaa2b35c4e70489b3d1e;hb=c1b7d6e874f1bfcac251e852ae37229c12c61656;hp=f03c746b79b476a95c71cb4070f3cb1350d2a739;hpb=caeb4be1e91da63a8f9b3588967d67e81ce2c8a4;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.cxx index f03c746..188d089 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.cxx @@ -1,50 +1,49 @@ -/*************************************************************** - * Name: ButtonGroupSettings.cxx - * Purpose: It is the ButtonGroupSettings - * Author: Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr) - * Modified: 2011-05-09 - * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/) - * License: - **************************************************************/ +/*! + * @file containerSettings.cxx + * @brief Implements the ContainerSettings class. + * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr) + * @date 2011-05-19 + */ + #include "containerSettings.h" namespace creaButtonContainer { namespace model { - + // ---------------------------------------------------------------------------------- ContainerSettings::ContainerSettings( ) { } - + // ---------------------------------------------------------------------------------- ContainerSettings::~ContainerSettings( ) { } - + // ---------------------------------------------------------------------------------- ButtonGroupMap ContainerSettings::GetButtonGroupContainer( ) { - return m_ButtonGroupContainer; + return this->m_ButtonGroupContainer; } - + // ---------------------------------------------------------------------------------- KeyMapList ContainerSettings::GetGroupNameList( ) { - return m_GroupNameList; + return this->m_GroupNameList; } - + // ---------------------------------------------------------------------------------- void - ContainerSettings::SetButtonGroupContainer( - ButtonGroupMap m_ButtonGroupContainer ) + ContainerSettings::SetButtonGroupContainer( ButtonGroupMap bgContainer ) { - this->m_ButtonGroupContainer = m_ButtonGroupContainer; + this->m_ButtonGroupContainer = bgContainer; } - + // ---------------------------------------------------------------------------------- void - ContainerSettings::SetGroupNameList( KeyMapList m_GroupNameList ) + ContainerSettings::SetGroupNameList( KeyMapList gNameList ) { - this->m_GroupNameList = m_GroupNameList; + this->m_GroupNameList = gNameList; } + // ---------------------------------------------------------------------------------- void ContainerSettings::AddButton( const std::string & groupName, const std::string buttonName, const std::string iconpath, @@ -52,8 +51,30 @@ namespace creaButtonContainer { ButtonPair* pair = new ButtonPair( new ButtonInfo( buttonName, iconpath ), - new ActionButton( buttonDescription, event ) ); - this->m_ButtonGroupContainer[ groupName ].push_back( pair ); + new ButtonAction( buttonDescription, event ) ); + try + { + for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it + != this->m_GroupNameList.end( ); ++it ) + { + if ( ( *it ).compare( groupName ) == 0 ) + { + this->m_ButtonGroupContainer[ groupName ].push_back( pair ); + return; + }//fi + }//rof + this->m_GroupNameList.push_back( groupName ); + this->m_ButtonGroupContainer[ groupName ].push_back( pair ); + }//yrt + catch ( std::exception& e ) + { + std::cerr + << "ContainerSettings::AddButton( const std::string & groupName," + << "const std::string buttonName, const std::string iconpath," + << "const std::string buttonDescription, FunctionEventType event ) exception: " + << e.what( ) << std::endl; + }//hctac } - } -} + // ---------------------------------------------------------------------------------- + }//ecapseman +}//ecapseman