1 /***************************************************************
2 * Name: ButtonContainerPanel.cxx
3 * Purpose: Implements ButtonContainerPanel.h
4 * Author: Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
6 * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
8 **************************************************************/
9 #include "buttonContainerPanel.h"
11 namespace creaButtonContainer
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( )
47 this->m_Sizer = new Sizer( 0, 1, 0, 0 );
48 for( ButtonGroupList::iterator it = this->m_ButtonGroupList.begin( ); it
49 != this->m_ButtonGroupList.end( ); ++it )
51 GroupManager* manager = new GroupManager( this, *it );
52 this->m_GroupManagerList[ manager->GetButtonID( ) ] = manager;
53 this->m_Sizer->Add( manager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
54 std::cout << "creaButtonContainer: New ButtonGroup Sizer Added"
57 this->SetSizer( this->m_Sizer );
61 // -------------------------------------------------------------------
63 ButtonContainerPanel::FitSizer( )
65 this->m_Sizer->Fit( this );
66 this->m_Sizer->SetSizeHints( this );