2 * @file buttonGroup.cxx
3 * @brief Implements the ButtonGroup class.
4 * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
8 #include "buttonContainerPanel.h"
10 namespace creaButtonContainer
14 // ----------------------------------------------------------------------------------
15 ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent,
16 ButtonGroupSettings* settings ) :
22 wxTAB_TRAVERSAL | wxVSCROLL | wxHSCROLL
23 | wxFULL_REPAINT_ON_RESIZE, _T("creaButtonContainer") )
25 ButtonGroupFactory factory;
26 this->SetGroupContainer(
27 factory.CreateButtonGroupContainer( this, settings ) );
29 this->m_ButtonCController = new BCController( this );
30 this->m_ButtonCController->AddEvents( );
31 this->SetEventHandler( this->m_ButtonCController );
33 // ----------------------------------------------------------------------------------
34 ButtonContainerPanel::~ButtonContainerPanel( )
37 // ----------------------------------------------------------------------------------
39 ButtonContainerPanel::SetGroupContainer( ButtonGroupList groupContainer )
41 this->m_ButtonGroupList = groupContainer;
43 // ----------------------------------------------------------------------------------
45 ButtonContainerPanel::PanelInit( )
49 this->m_Sizer = new Sizer( 0, 1, 0, 0 );
50 for( ButtonGroupList::iterator it = this->m_ButtonGroupList.begin( ); it
51 != this->m_ButtonGroupList.end( ); ++it )
53 GroupManager* manager = new GroupManager( this, *it );
54 this->m_GroupManagerList[ manager->GetButtonID( ) ] = manager;
55 this->m_Sizer->Add( manager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
56 std::cout << "creaButtonContainer: New ButtonGroup Sizer Added"
59 this->SetSizer( this->m_Sizer );
62 catch ( const std::exception& e )
64 std::cerr << "ButtonContainerPanel::PanelInit( ) " << "exception: "
65 << e.what( ) << std::endl;
68 // ----------------------------------------------------------------------------------
70 ButtonContainerPanel::FitSizer( )
72 this->m_Sizer->Fit( this );
73 this->m_Sizer->FitInside( this );
74 this->SetScrollRate( 20, 20 );
75 this->m_Sizer->SetSizeHints( this );
77 // ----------------------------------------------------------------------------------