X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FcreaButtonContainer%2Fmodel%2FlistGroupFactory.cxx;h=1d1adba9c068da3d0d81dd35755b5da007fed0c8;hb=4518d93a0a51221812cfb6d783f8e7f4fd77b498;hp=7322b06072a5e1510863e9974a49ce92c06f7319;hpb=c1742e6eca1299979dbacc1f609bc14c3494bc7a;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/listGroupFactory.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/listGroupFactory.cxx index 7322b06..1d1adba 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/listGroupFactory.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/listGroupFactory.cxx @@ -23,12 +23,6 @@ # knowledge of the CeCILL-B license and that you accept its terms. # ------------------------------------------------------------------------ */ -/*! - * @file buttonGroupFactory.cxx - * @brief Implements the ButtonGroupFactory class. - * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr) - * @date 2011-06-02 - */ #include "listGroupFactory.h" @@ -46,25 +40,25 @@ namespace creaButtonContainer } // ---------------------------------------------------------------------------------- - ListGroupFactory::ListGroupContainer ListGroupFactory::CreateListGroupContainer(wxWindow* parent,ListModel* settings ) + ListGroupFactory::ButtonGroupContainer ListGroupFactory::CreateButtonGroupContainer( wxWindow* parent, ButtonGroupModel* settings ) { - ListGroupContainer groupView; + ButtonGroupContainer groupView; try { - ListGroupMap map = settings->GetListGroupContainer( ); - for( ListGroupMap::iterator it = map.begin( ); it != map.end( ); ++it ) + std::cout<< std::endl << " MLER listGroupFactory.cxx / CreateButtonGroupContainer(): " << std::endl; + ButtonGroupMap map = settings->GetButtonGroupContainer( ); + for( ButtonGroupMap::iterator it = map.begin( ); it != map.end( ); ++it ) { - wxString groupNameAux( ( *it ).first.c_str( ), wxConvUTF8 );//nombre grupo + wxString groupNameAux( ( *it ).first.c_str( ), wxConvUTF8 ); wxStaticText* wxGroupName = new wxStaticText( parent, -1, groupNameAux, wxDefaultPosition, wxDefaultSize, 0, _T("GroupText") ); - ListGroup* group = new ListGroup( wxGroupName, this->GetList( parent, ( *it ).second ) ); - //ListGroup* group; + ButtonGroup* group = new ButtonGroup( wxGroupName, this->GetButtons( parent, ( *it ).second ) ); groupView.push_back( group ); }//rof }//yrt catch ( const std::exception& e ) { std::cerr - << "ListGroupFactory::CreateListGroupContainer( wxWindow* parent, ListModel* settings )" + << "ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent, ButtonGroupModel* settings )" << " exception: " << e.what( ) << std::endl; }//chtac return ( groupView ); @@ -72,17 +66,18 @@ namespace creaButtonContainer // ---------------------------------------------------------------------------------- - ListGroupFactory::ListContainer ListGroupFactory::GetList( wxWindow* parent, tlist lst ) + ListGroupFactory::ButtonContainer ListGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel ) { - ListContainer cList; - + ButtonContainer buttonList; try { - /*List list = new List(parent,items); - - cList.push_back(list); - //return ( buttonList ); // JPR*/ - }//yrt + for( ButtonList::iterator it = buttonModel.begin( ); it + != buttonModel.end( ); ++it ) + { + long id = wxNewId( ); + buttonList[ id ] = new Button( parent, id, *it ); + } + } catch ( const std::exception& e ) { std::cerr @@ -90,8 +85,9 @@ namespace creaButtonContainer << "exception: " << e.what( ) << std::endl; }//chtac - return ( cList ); // JPR + return ( buttonList ); // JPR } // ---------------------------------------------------------------------------------- }//ecapseman }//ecapseman +