From 34457a13be488da0c5648ec32059199775051aad Mon Sep 17 00:00:00 2001 From: Diego Caceres Date: Sat, 28 May 2011 16:31:44 +0000 Subject: [PATCH] creaButtonContainer, creaPanelButtonContainer. Cleaned 98% ready to be used :) :) :) --- .../widgets/creaButtonContainer/view/button.h | 2 +- .../view/buttonContainerPanel.cxx | 9 +++++-- .../view/buttonContainerPanel.h | 3 ++- .../creaPanelButtonContainer.cxx | 25 +++++++++++-------- .../creaPanelButtonContainer.h | 5 ++-- 5 files changed, 28 insertions(+), 16 deletions(-) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h index 45aeb4f..67d2861 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h @@ -17,7 +17,6 @@ #include "functor.h" #include "system.h" - /*! @namespace * @brief Contains the creaButtonContainer library included in creaMaracasVisu. */ @@ -42,6 +41,7 @@ namespace creaButtonContainer * @brief Defines the TFunctor type. */ typedef creaButtonContainer::model::TFunctor TFunctor; + // ---------------------------------------------------------------------------------- //end of typedef definition public: // ---------------------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.cxx index 3265447..934d156 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.cxx @@ -2,7 +2,7 @@ * @file buttonGroup.cxx * @brief Implements the ButtonGroup class. * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr) - * @date 2011-05-24 + * @date 2011-05-28 */ #include "buttonContainerPanel.h" @@ -11,6 +11,11 @@ namespace creaButtonContainer { namespace view { + BEGIN_EVENT_TABLE(ButtonContainerPanel,wxScrolledWindow) + //(*EventTable(ButtonContainerPanel) + //*) + END_EVENT_TABLE() + // ---------------------------------------------------------------------------------- ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings ) : @@ -18,7 +23,7 @@ namespace creaButtonContainer parent, -1, wxDefaultPosition, - wxSize( 400, 400 ), + wxDefaultSize, wxTAB_TRAVERSAL | wxVSCROLL | wxHSCROLL | wxFULL_REPAINT_ON_RESIZE, _T("creaButtonContainer") ) { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.h index 579ac83..a49951f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.h @@ -2,7 +2,7 @@ * @file buttonContainerController.h * @brief This contains the ButtonContainerController class * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr) - * @date 2011-05-24 + * @date 2011-05-28 */ #ifndef BUTTONCONTAINERPANEL_H @@ -148,6 +148,7 @@ namespace creaButtonContainer ButtonGroupList m_ButtonGroupList; //! TConcreteFunctor; // ---------------------------------------------------------------------------------- PanelButtonContainer::PanelButtonContainer( wxWindow* parent, ButtonContainerSettings* bcSettings ) : - wxPanel( parent, -1, wxDefaultPosition, wxSize( 300, 700 ), + wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("creaPanelButtonContainer") ) { this->m_ButtonContainerSettings = bcSettings; @@ -32,18 +36,16 @@ namespace creaPanelButtonContainer //Using AuiManager to Manage the Panels this->m_AuiManager = new wxAuiManager( this, wxAUI_MGR_DEFAULT ); - // CartoSettingsPanel Management this->m_AuiManager->AddPane( this->m_ButtonPanel, - wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("Panel") ). CaptionVisible( ).CloseButton( - false ).Left( ).MinSize( wxSize( 300, 300 ) ) ); - + wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("Panel") ). CaptionVisible( + true ).CloseButton( false ).Bottom( ).Resizable( true ) ); //CartoButtonPanel Management this->m_AuiManager->AddPane( this->m_ButtonContainerPanel, wxAuiPaneInfo( ).Name( _T("creaButtonContainer") ).Caption( - _("creaButtonContainer") ). CaptionVisible( ).CloseButton( false ).Left( ) .MinSize( - wxSize( 300, 300 ) ) ); + _("creaButtonContainer") ). CaptionVisible( false ).CloseButton( + false ).Center( ).Resizable( true ) ); this->m_AuiManager->Update( ); } // ---------------------------------------------------------------------------------- @@ -61,6 +63,9 @@ namespace creaPanelButtonContainer //Finding the CartoSettingsPanel of the ButtonClicket this->m_ButtonPanel = this->m_ButtonContainerSettings->GetPanelButton( buttonName ); + //changing the parent of the panel! + if ( this->m_ButtonPanel->GetParent( ) != this ) + this->m_ButtonPanel->Reparent( this ); //CartoSettingsPanel Management this->m_AuiManager->GetPane( _T("ButtonPanel") ).window = this->m_ButtonPanel; @@ -72,8 +77,8 @@ namespace creaPanelButtonContainer std::cerr << "PanelButtonContainer::UpdatePanel( const std::string &buttonName )" << "exception: " << e.what( ) << std::endl; - std::cout<<"Maybe the panel of the button is NULL"<