1 /************************************************************************************//*!
2 * Name: @file buttonGroupFactory.cxx
3 * Purpose: @brief This contains the ButtonGroupFactory class implementation
4 * Author: @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
8 ***************************************************************************************/
10 //! @include "buttonGroupFactory.h"
11 #include "buttonGroupFactory.h"
13 //! @namespace<creaButtonContainer>
14 namespace creaButtonContainer
19 // ----------------------------------------------------------------------------------
20 ButtonGroupFactory::ButtonGroupFactory( )
23 // ----------------------------------------------------------------------------------
24 ButtonGroupFactory::~ButtonGroupFactory( )
27 // ----------------------------------------------------------------------------------
28 ButtonGroupFactory::ButtonGroupContainer
29 ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent,
30 ButtonGroupModel* settings )
32 ButtonGroupContainer groupView;
35 ButtonGroupMap map = settings->GetButtonGroupContainer( );
36 for( ButtonGroupMap::iterator it = map.begin( ); it != map.end( ); ++it )
38 wxString groupNameAux( ( *it ).first.c_str( ), wxConvUTF8 );
39 wxStaticText* wxGroupName = new wxStaticText( parent, -1,
40 groupNameAux, wxDefaultPosition, wxDefaultSize, 0,
42 ButtonGroup* group = new ButtonGroup( wxGroupName,
43 this->GetButtons( parent, ( *it ).second ) );
44 groupView.push_back( group );
47 catch ( std::exception& e )
50 << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
51 << e.what( ) << std::endl;
55 // ----------------------------------------------------------------------------------
56 ButtonGroupFactory::ButtonContainer
57 ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel )
59 ButtonContainer buttonList;
62 for( ButtonList::iterator it = buttonModel.begin( ); it
63 != buttonModel.end( ); ++it )
66 buttonList[ id ] = new Button( parent, id, *it );
68 return ( buttonList );
70 catch ( std::exception& e )
73 << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
74 << e.what( ) << std::endl;
77 // ----------------------------------------------------------------------------------