1 /***************************************************************
2 * Name: ButtonGroupFactory
3 * Purpose: Implements ButtonGroupFactory
4 * Author: Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
6 * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
8 **************************************************************/
10 #include "buttonGroupFactory.h"
12 namespace creaButtonContainer
16 ButtonGroupFactory::ButtonGroupFactory( )
19 ButtonGroupFactory::~ButtonGroupFactory( )
23 ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent,
24 ButtonGroupModel* settings )
26 ButtonGroupContainer groupView;
27 ButtonGroupMap map = settings->GetButtonGroupContainer( );
28 for( ButtonGroupMap::iterator it = map.begin( ); it != map.end( ); ++it )
30 wxString groupNameAux( ( *it ).first.c_str( ), wxConvUTF8 );
31 wxStaticText* wxGroupName = new wxStaticText( parent, -1, groupNameAux,
32 wxDefaultPosition, wxDefaultSize, 0, _T("GroupText") );
33 ButtonGroup* group = new ButtonGroup( wxGroupName,
34 this->GetButtons( parent, ( *it ).second ) );
35 groupView.push_back( group );
40 ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel )
42 ButtonContainer buttonList;
43 for( ButtonList::iterator it = buttonModel.begin( ); it
44 != buttonModel.end( ); ++it )
47 buttonList[ id ] = new Button( parent, id, *it );
49 return ( buttonList );