2 * @file creaPanelButtonContainer.h
3 * @brief implements PanelButtonContainer class
4 * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
8 #include "creaPanelButtonContainer.h"
10 namespace creaPanelButtonContainer
12 // ----------------------------------------------------------------------------------
13 typedef creaButtonContainer::model::TConcreteFunctor< PanelButtonContainer >
15 // ----------------------------------------------------------------------------------
16 PanelButtonContainer::PanelButtonContainer( wxWindow* parent,
17 ButtonContainerSettings* bcSettings ) :
18 wxPanel( parent, -1, wxDefaultPosition, wxSize( 300, 700 ),
19 wxDEFAULT_FRAME_STYLE, _T("creaPanelButtonContainer") )
21 this->m_ButtonContainerSettings = bcSettings;
22 this->m_ButtonPanel = new wxPanel( this );
23 //Class that manages the cartobutton event!!!
24 TConcreteFunctor* functor = new TConcreteFunctor( this,
25 &PanelButtonContainer::GenericButtonEvent );
26 //end of the event definition
27 this->m_ButtonContainerPanel = new ButtonContainerPanel( this,
28 this->m_ButtonContainerSettings->GetButtonGroupSettings( functor ) );
29 //Using AuiManager to Manage the Panels
30 this->m_AuiManager = new wxAuiManager( this, wxAUI_MGR_DEFAULT );
31 // CartoSettingsPanel Management
32 this->m_AuiManager->AddPane(
34 wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("Panel") ). CaptionVisible( ).CloseButton(
35 false ).Left( ).MinSize( wxSize( 300, 300 ) ) );
36 //CartoButtonPanel Management
37 this->m_AuiManager->AddPane(
38 this->m_ButtonContainerPanel,
39 wxAuiPaneInfo( ).Name( _T("creaButtonContainer") ).Caption(
40 _("creaButtonContainer") ). CaptionVisible( ).CloseButton( false ).Left( ) .MinSize(
41 wxSize( 300, 300 ) ) );
42 this->m_AuiManager->Update( );
43 //this->createGimmick();
45 // ----------------------------------------------------------------------------------
46 PanelButtonContainer::~PanelButtonContainer( )
49 // ----------------------------------------------------------------------------------
51 PanelButtonContainer::UpdatePanel( const std::string &buttonName )
53 //Hiding the last CartoSettingsPanel
54 this->m_ButtonPanel->Show( false );
55 //Finding the CartoSettingsPanel of the ButtonClicket
56 this->m_ButtonPanel = this->m_ButtonContainerSettings->GetPanelButton(
58 //CartoSettingsPanel Management
59 this->m_AuiManager->GetPane( _T("ButtonPanel") ).window
60 = this->m_ButtonPanel;
61 //Updating the manager
62 this->m_AuiManager->Update( );
64 // ----------------------------------------------------------------------------------
66 PanelButtonContainer::GenericButtonEvent( const std::string &buttonName )
68 this->UpdatePanel( buttonName );
70 // ----------------------------------------------------------------------------------