/*!
* @file containerSettings.cxx
- * @brief This contains the ContainerSettings class implementation
+ * @brief Implements the ContainerSettings class.
* @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date 2011-05-19
+ * @date 2011-06-02
*/
#include "containerSettings.h"
ButtonGroupMap
ContainerSettings::GetButtonGroupContainer( )
{
- return this->m_ButtonGroupContainer;
+ return ( this->m_ButtonGroupContainer );
}
// ----------------------------------------------------------------------------------
KeyMapList
ContainerSettings::GetGroupNameList( )
{
- return this->m_GroupNameList;
+ return ( this->m_GroupNameList );
}
// ----------------------------------------------------------------------------------
void
}
// ----------------------------------------------------------------------------------
void
- ContainerSettings::AddButton( const std::string & groupName,
- const std::string buttonName, const std::string iconpath,
- const std::string buttonDescription, FunctionEventType event )
+ ContainerSettings::AddButton( const StringType & groupName,
+ const StringType &buttonName, const StringType &iconpath,
+ const StringType &buttonDescription, FunctionEventType event )
{
ButtonPair* pair = new ButtonPair(
new ButtonInfo( buttonName, iconpath ),
this->m_GroupNameList.push_back( groupName );
this->m_ButtonGroupContainer[ groupName ].push_back( pair );
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr
<< "ContainerSettings::AddButton( const std::string & groupName,"
<< e.what( ) << std::endl;
}//hctac
}
+ // ----------------------------------------------------------------------------------
+ void
+ ContainerSettings::AddButton( BCSettingsStruct* info )
+ {
+ ButtonPair* pair = new ButtonPair(
+ new ButtonInfo( info->buttonName, info->iconpath ),
+ new ButtonAction( info->buttonDescription, info->eventFunction ) );
+ try
+ {
+ for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
+ != this->m_GroupNameList.end( ); ++it )
+ {
+ if ( ( *it ).compare( info->groupName ) == 0 )
+ {
+ this->m_ButtonGroupContainer[ info->groupName ].push_back( pair );
+ return;
+ }//fi
+ }//rof
+ this->m_GroupNameList.push_back( info->groupName );
+ this->m_ButtonGroupContainer[ info->groupName ].push_back( pair );
+ }//yrt
+ catch ( const std::exception& e )
+ {
+ std::cerr
+ << "void ContainerSettings::AddButton( BCSettingsStruct* info ) "
+ << "exception: " << e.what( ) << std::endl;
+ }//hctac
+ }
+ // ----------------------------------------------------------------------------------
+ void
+ ContainerSettings::AddButtons( BCStructVectorType infoList )
+ {
+ try
+ {
+ for( BCStructVectorType::iterator it = infoList.begin( ); it
+ != infoList.end( ); ++it )
+ {
+ this->AddButton( *it );
+ }//rof
+ }//yrt
+ catch ( const std::exception& e )
+ {
+ std::cerr
+ << "ContainerSettings::AddButtons( BCStructVectorType infoList ) "
+ << "exception: " << e.what( ) << std::endl;
+ }//hctac
+ }
// ----------------------------------------------------------------------------------
}//ecapseman
}//ecapseman