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 BEGIN_EVENT_TABLE(ButtonContainerPanel,wxScrolledWindow)
15 //(*EventTable(ButtonContainerPanel)
19 // ----------------------------------------------------------------------------------
20 ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent,
21 ButtonGroupSettings* settings ) :
27 wxTAB_TRAVERSAL | wxVSCROLL | wxHSCROLL
28 | wxFULL_REPAINT_ON_RESIZE, _T("creaButtonContainer") )
30 ButtonGroupFactory factory;
31 this->SetGroupContainer(
32 factory.CreateButtonGroupContainer( this, settings ) );
34 this->m_ButtonCController = new BCController( this );
35 this->m_ButtonCController->AddEvents( );
36 this->SetEventHandler( this->m_ButtonCController );
38 // ----------------------------------------------------------------------------------
39 ButtonContainerPanel::~ButtonContainerPanel( )
42 // ----------------------------------------------------------------------------------
44 ButtonContainerPanel::SetGroupContainer( ButtonGroupList groupContainer )
46 this->m_ButtonGroupList = groupContainer;
48 // ----------------------------------------------------------------------------------
50 ButtonContainerPanel::PanelInit( )
54 this->m_Sizer = new Sizer( 0, 1, 0, 0 );
55 for( ButtonGroupList::iterator it = this->m_ButtonGroupList.begin( ); it
56 != this->m_ButtonGroupList.end( ); ++it )
58 GroupManager* manager = new GroupManager( this, *it );
59 this->m_GroupManagerList[ manager->GetButtonID( ) ] = manager;
60 this->m_Sizer->Add( manager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
61 std::cout << "creaButtonContainer: New ButtonGroup Sizer Added"
64 this->SetSizer( this->m_Sizer );
67 catch ( const std::exception& e )
69 std::cerr << "ButtonContainerPanel::PanelInit( ) " << "exception: "
70 << e.what( ) << std::endl;
73 // ----------------------------------------------------------------------------------
75 ButtonContainerPanel::FitSizer( )
77 this->m_Sizer->Fit( this );
78 this->m_Sizer->FitInside( this );
79 this->SetScrollRate( 20, 20 );
80 this->m_Sizer->SetSizeHints( this );
82 // ----------------------------------------------------------------------------------