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
15 ButtonManager::ButtonManager( ) :
16 wxFlexGridSizer( 0, 1, 0, 0 )
19 // -------------------------------------------------------------------
20 ButtonManager::ButtonManager( ButtonGroup* buttonGroup ) :
21 wxFlexGridSizer( 0, 1, 0, 0 )
23 this->SetGroupName( buttonGroup->GetGroupName( ) );
24 this->SetButtonManager( buttonGroup->GetButtonContainer( ) );
26 // -------------------------------------------------------------------
27 ButtonManager::~ButtonManager( )
30 // -------------------------------------------------------------------
32 ButtonManager::SetGroupName( wxStaticText* groupName )
34 this->m_GroupName = groupName;
35 this->Add( this->m_GroupName, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
37 // -------------------------------------------------------------------
39 ButtonManager::SetButtonManager( ButtonContainer buttonContainer )
41 if ( this->m_GroupName != NULL )
43 this->m_GridSizer = new wxGridSizer( 0, 3, 0, 0 );
44 for( ButtonContainer::iterator it = buttonContainer.begin( ); it
45 != buttonContainer.end( ); ++it )
46 this->m_GridSizer->Add( (*it).second, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP,
48 this->Add( m_GridSizer, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
51 // -------------------------------------------------------------------
53 ButtonManager::ShowButtonManager( )
55 this->Show( this->m_GridSizer, true, false );
57 // -------------------------------------------------------------------
59 ButtonManager::HideButtonManager( )
61 this->Show( this->m_GridSizer, false, false );