2 * @file buttonManager.cxx
3 * @brief Implements the ButtonManager class.
4 * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
8 #include "buttonManager.h"
10 namespace creaButtonContainer
14 // ----------------------------------------------------------------------------------
15 ButtonManager::ButtonManager( ) :
16 wxFlexGridSizer( 0, 1, 0, 0 )
20 //EED 20/01/2012 Flag03
21 // ----------------------------------------------------------------------------------
22 ButtonManager::ButtonManager( ButtonGroup* buttonGroup ) :
23 wxFlexGridSizer( 0, 1, 0, 0 )
27 this->SetGroupName( buttonGroup->GetGroupName( ) );
28 this->SetButtonManager( buttonGroup->GetButtonContainer( ) );
30 catch ( const std::exception& e )
32 std::cerr << "Button::Execute( ) exception: " << e.what( ) << std::endl;
36 // ----------------------------------------------------------------------------------
37 ButtonManager::~ButtonManager( )
41 // ----------------------------------------------------------------------------------
42 void ButtonManager::SetGroupName( wxStaticText* groupName )
44 this->m_GroupName = groupName;
45 this->Add( this->m_GroupName, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
48 // ----------------------------------------------------------------------------------
49 void ButtonManager::SetButtonManager( ButtonContainer buttonContainer )
53 if ( this->m_GroupName != NULL )
55 this->m_GridSizer = new wxGridSizer( 0, 3, 0, 0 );
56 for( ButtonContainer::iterator it = buttonContainer.begin( ); it!= buttonContainer.end( ); ++it )
58 this->m_GridSizer->Add( ( *it ).second, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
60 this->Add( m_GridSizer, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
63 catch ( const std::exception& e )
66 << "ButtonManager::SetButtonManager( ButtonContainer buttonContainer )"
67 << "exception: " << e.what( ) << std::endl;
70 // ----------------------------------------------------------------------------------
72 ButtonManager::ShowButtonManager( )
74 this->Show( this->m_GridSizer, true, false );
76 // ----------------------------------------------------------------------------------
78 ButtonManager::HideButtonManager( )
80 this->Show( this->m_GridSizer, false, false );
82 // ----------------------------------------------------------------------------------