2 * @file buttonGroup.cxx
3 * @brief Implements the ButtonGroup class.
4 * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
8 #include "buttonGroup.h"
10 namespace creaButtonContainer
14 // ----------------------------------------------------------------------------------
15 ButtonGroup::ButtonGroup( wxStaticText* groupName,
16 ButtonContainer cartoButtons )
18 this->m_GroupName = groupName;
19 this->m_Buttons = cartoButtons;
21 // ----------------------------------------------------------------------------------
22 ButtonGroup::~ButtonGroup( )
25 // ----------------------------------------------------------------------------------
26 ButtonGroup::ButtonContainer
27 ButtonGroup::GetButtonContainer( )
29 return ( this->m_Buttons );
31 // ----------------------------------------------------------------------------------
33 ButtonGroup::GetGroupName( )
35 return ( this->m_GroupName );
37 // ----------------------------------------------------------------------------------
38 ButtonGroup::IdButtonContainer
39 ButtonGroup::GetButtonIdContainer( )
41 IdButtonContainer idContainer;
44 for( ButtonContainer::iterator it = this->m_Buttons.begin( ); it
45 != this->m_Buttons.end( ); ++it )
47 idContainer.push_back( ( *it ).first );
50 catch ( std::exception& e )
52 std::cerr << "ButtonGroup::GetButtonIdContainer( )" << "exception: "
53 << e.what( ) << std::endl;
55 return ( idContainer );
57 // ----------------------------------------------------------------------------------
59 ButtonGroup::GetButton( long id )
63 //return ( this->m_Buttons[ id ] ); // JPR
65 catch ( std::exception& e )
67 std::cerr << "ButtonGroup::GetButton( long id )" << "exception: "
68 << e.what( ) << std::endl;
70 return ( this->m_Buttons[ id ] );// JPR
72 // ----------------------------------------------------------------------------------