]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonManager.cxx
creaButtonContainer: Documentation updates :) :). If you turns on the documentation...
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / view / buttonManager.cxx
1 /*!
2  * @file buttonManager.cxx
3  * @brief This contains the ButtonManager class implementation
4  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
5  * @date  2011-05-19
6  */
7
8 #include "buttonManager.h"
9
10 namespace creaButtonContainer
11 {
12         namespace view
13         {
14
15                 ButtonManager::ButtonManager( ) :
16                         wxFlexGridSizer( 0, 1, 0, 0 )
17                 {
18                 }
19                 // -------------------------------------------------------------------
20                 ButtonManager::ButtonManager( ButtonGroup* buttonGroup ) :
21                         wxFlexGridSizer( 0, 1, 0, 0 )
22                 {
23                         this->SetGroupName( buttonGroup->GetGroupName( ) );
24                         this->SetButtonManager( buttonGroup->GetButtonContainer( ) );
25                 }
26                 // -------------------------------------------------------------------
27                 ButtonManager::~ButtonManager( )
28                 {
29                 }
30                 // -------------------------------------------------------------------
31                 void
32                 ButtonManager::SetGroupName( wxStaticText* groupName )
33                 {
34                         this->m_GroupName = groupName;
35                         this->Add( this->m_GroupName, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
36                 }
37                 // -------------------------------------------------------------------
38                 void
39                 ButtonManager::SetButtonManager( ButtonContainer buttonContainer )
40                 {
41                         if ( this->m_GroupName != NULL )
42                         {
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,
47                                             5 );
48                                 this->Add( m_GridSizer, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
49                         }
50                 }
51                 // -------------------------------------------------------------------
52                 void
53                 ButtonManager::ShowButtonManager( )
54                 {
55                         this->Show( this->m_GridSizer, true, false );
56                 }
57                 // -------------------------------------------------------------------
58                 void
59                 ButtonManager::HideButtonManager( )
60                 {
61                         this->Show( this->m_GridSizer, false, false );
62                 }
63         }//ecapseman
64 }//ecapseman