2 * @file buttonGroup.cxx
3 * @brief This contains the ButtonGroup class implementation
4 * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
8 #include "buttonContainerPanel.h"
10 namespace creaButtonContainer
14 ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent,
15 ButtonGroupSettings* settings ) :
21 wxTAB_TRAVERSAL | wxVSCROLL | wxHSCROLL
22 | wxFULL_REPAINT_ON_RESIZE, _T("creaButtonContainer") )
24 ButtonGroupFactory factory;
25 this->SetGroupContainer(
26 factory.CreateButtonGroupContainer( this, settings ) );
28 this->m_ButtonCController = new BCController(this);
29 this->m_ButtonCController->AddEvents();
30 this->SetEventHandler( this->m_ButtonCController );
32 // -------------------------------------------------------------------
33 ButtonContainerPanel::~ButtonContainerPanel( )
36 // -------------------------------------------------------------------
38 ButtonContainerPanel::SetGroupContainer( ButtonGroupList groupContainer )
40 this->m_ButtonGroupList = groupContainer;
42 // -------------------------------------------------------------------
44 ButtonContainerPanel::PanelInit( )
46 this->m_Sizer = new Sizer( 0, 1, 0, 0 );
47 for( ButtonGroupList::iterator it = this->m_ButtonGroupList.begin( ); it
48 != this->m_ButtonGroupList.end( ); ++it )
50 GroupManager* manager = new GroupManager( this, *it );
51 this->m_GroupManagerList[ manager->GetButtonID( ) ] = manager;
52 this->m_Sizer->Add( manager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
53 std::cout << "creaButtonContainer: New ButtonGroup Sizer Added"
56 this->SetSizer( this->m_Sizer );
60 // -------------------------------------------------------------------
62 ButtonContainerPanel::FitSizer( )
64 this->m_Sizer->Fit( this );
65 this->m_Sizer->FitInside(this);
66 this->SetScrollRate(20,20);
67 this->m_Sizer->SetSizeHints(this);