1 /***************************************************************
2 * Name: ButtonManager.cxx
3 * Purpose: Implements ButtonManager.h
4 * Author: Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
6 * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
8 **************************************************************/
10 #include "buttonManager.h"
12 namespace creaButtonContainer
17 ButtonManager::ButtonManager( ) :
18 wxFlexGridSizer( 0, 1, 0, 0 )
21 // -------------------------------------------------------------------
22 ButtonManager::ButtonManager( ButtonGroup* buttonGroup ) :
23 wxFlexGridSizer( 0, 1, 0, 0 )
25 this->SetGroupName( buttonGroup->GetGroupName( ) );
26 this->SetButtonManager( buttonGroup->GetButtonContainer( ) );
28 // -------------------------------------------------------------------
29 ButtonManager::~ButtonManager( )
32 // -------------------------------------------------------------------
34 ButtonManager::SetGroupName( wxStaticText* groupName )
36 this->m_GroupName = groupName;
37 this->Add( this->m_GroupName, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
39 // -------------------------------------------------------------------
41 ButtonManager::SetButtonManager( ButtonContainer buttonContainer )
43 if ( this->m_GroupName != NULL )
45 this->m_GridSizer = new wxGridSizer( 0, 3, 0, 0 );
46 for( ButtonContainer::iterator it = buttonContainer.begin( ); it
47 != buttonContainer.end( ); ++it )
48 this->m_GridSizer->Add( (*it).second, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP,
50 this->Add( m_GridSizer, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
53 // -------------------------------------------------------------------
55 ButtonManager::ShowButtonManager( )
57 this->Show( this->m_GridSizer, true, false );
59 // -------------------------------------------------------------------
61 ButtonManager::HideButtonManager( )
63 this->Show( this->m_GridSizer, false, false );