1 /***************************************************************
3 * Purpose: Code for Application Frame
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 "creaPanelButtonContainer.h"
12 namespace creaPanelButtonContainer
14 //--------------------------------------------------------------------------------
15 typedef creaButtonContainer::model::TConcreteFunctor< PanelButtonContainer >
18 PanelButtonContainer::PanelButtonContainer( wxWindow* parent,
19 ButtonContainerSettings* bcSettings ) :
20 wxPanel( parent, -1, wxDefaultPosition, wxSize( 300, 700 ),
21 wxDEFAULT_FRAME_STYLE, _T("creaPanelButtonContainer") )
23 this->m_ButtonContainerSettings = bcSettings;
24 this->m_ButtonPanel = new wxPanel( this );
25 //Class that manages the cartobutton event!!!
26 TConcreteFunctor* functor = new TConcreteFunctor( this,
27 &PanelButtonContainer::GenericButtonEvent );
28 //end of the event definition
29 this->m_ButtonContainerPanel = new ButtonContainerPanel( this,
30 this->m_ButtonContainerSettings->GetButtonGroupSettings( functor ) );
31 //Using AuiManager to Manage the Panels
32 this->m_AuiManager = new wxAuiManager( this, wxAUI_MGR_DEFAULT );
33 // CartoSettingsPanel Management
34 this->m_AuiManager->AddPane(
36 wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption(
37 _("Panel") ). CaptionVisible( ).CloseButton( false ).Left( ).MinSize(wxSize(300,300)) );
38 //CartoButtonPanel Management
39 this->m_AuiManager->AddPane(
40 this->m_ButtonContainerPanel,
41 wxAuiPaneInfo( ).Name( _T("creaButtonContainer") ).Caption(
42 _("creaButtonContainer") ). CaptionVisible( ).CloseButton( false ).Left( ) .MinSize(wxSize(300,300) ) );
43 this->m_AuiManager->Update( );
44 //this->createGimmick();
47 PanelButtonContainer::~PanelButtonContainer( )
52 PanelButtonContainer::UpdatePanel( const std::string &buttonName )
54 //Hiding the last CartoSettingsPanel
55 this->m_ButtonPanel->Show( false );
56 //Finding the CartoSettingsPanel of the ButtonClicket
57 this->m_ButtonPanel = this->m_ButtonContainerSettings->GetPanelButton(
59 //CartoSettingsPanel Management
60 this->m_AuiManager->GetPane( _T("ButtonPanel") ).window
61 = this->m_ButtonPanel;
62 //Updating the manager
63 this->m_AuiManager->Update( );
67 PanelButtonContainer::GenericButtonEvent( const std::string &buttonName )
69 this->UpdatePanel( buttonName );