]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.cxx
creaButtonContainer: Documentation updates :) :). If you turns on the documentation...
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / view / buttonContainerPanel.cxx
1 /*!
2  * @file buttonGroup.cxx
3  * @brief This contains the ButtonGroup class implementation
4  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
5  * @date  2011-05-19
6  */
7
8 #include "buttonContainerPanel.h"
9
10 namespace creaButtonContainer
11 {
12         namespace view
13         {
14                 ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent,
15                     ButtonGroupSettings* settings ) :
16                             wxScrolledWindow(
17                                 parent,
18                                 -1,
19                                 wxDefaultPosition,
20                                 wxSize( 400, 400 ),
21                                 wxTAB_TRAVERSAL | wxVSCROLL | wxHSCROLL
22                                     | wxFULL_REPAINT_ON_RESIZE, _T("creaButtonContainer") )
23                 {
24                         ButtonGroupFactory factory;
25                         this->SetGroupContainer(
26                             factory.CreateButtonGroupContainer( this, settings ) );
27                         this->PanelInit( );
28                         this->m_ButtonCController = new BCController(this);
29                         this->m_ButtonCController->AddEvents();
30                         this->SetEventHandler( this->m_ButtonCController );
31                 }
32                 // -------------------------------------------------------------------
33                 ButtonContainerPanel::~ButtonContainerPanel( )
34                 {
35                 }
36                 // -------------------------------------------------------------------
37                 void
38                 ButtonContainerPanel::SetGroupContainer( ButtonGroupList groupContainer )
39                 {
40                         this->m_ButtonGroupList = groupContainer;
41                 }
42                 // -------------------------------------------------------------------
43                 void
44                 ButtonContainerPanel::PanelInit( )
45                 {
46                         this->m_Sizer = new Sizer( 0, 1, 0, 0 );
47                         for( ButtonGroupList::iterator it = this->m_ButtonGroupList.begin( ); it
48                             != this->m_ButtonGroupList.end( ); ++it )
49                         {
50                                 GroupManager* manager = new GroupManager( this, *it );
51                                 this->m_GroupManagerList[ manager->GetButtonID( ) ] = manager;
52                                 this->m_Sizer->Add( manager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
53                                 std::cout << "creaButtonContainer: New ButtonGroup Sizer Added"
54                                     << std::endl;
55                         }
56                         this->SetSizer( this->m_Sizer );
57                         this->FitSizer( );
58                 }
59
60                 // -------------------------------------------------------------------
61                 void
62                 ButtonContainerPanel::FitSizer( )
63                 {
64                         this->m_Sizer->Fit( this );
65                         this->m_Sizer->FitInside(this);
66                         this->SetScrollRate(20,20);
67                         this->m_Sizer->SetSizeHints(this);
68                 }
69
70         }//ecapseman
71 }//ecapseman