]> Creatis software - creaMaracasVisu.git/commitdiff
#2516 creaMaracasVisu Feature New Normal - creaPanelButtonContainer ListPanel with...
authorespinosa <espinosa@creatis.insa-lyon.fr>
Fri, 30 Jan 2015 03:13:10 +0000 (04:13 +0100)
committerespinosa <espinosa@creatis.insa-lyon.fr>
Fri, 30 Jan 2015 03:13:10 +0000 (04:13 +0100)
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/listWx.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/listWx.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.h

index 0f182f50565d9dff4b6a8f0a9766f212c75bbb27..741088099a831e4e11e493757c1ff34853527c1e 100644 (file)
@@ -42,32 +42,19 @@ namespace creaButtonContainer
                END_EVENT_TABLE()
 
                // ----------------------------------------------------------------------------------
-               ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings, int type )
+               ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings )
                : wxScrolledWindow(parent,-1, wxDefaultPosition,wxDefaultSize, wxTAB_TRAVERSAL | wxVSCROLL | wxHSCROLL | wxFULL_REPAINT_ON_RESIZE, _T("creaButtonContainer") )
                {
 
                        std::cout<< "MLER | ButtonContainerPanel::ButtonContainerPanel( )" << std::endl;
 
                        ButtonGroupFactory factory;
-                       //ListGroupFactory listFactory;
 
-                       //MLER this->SetButtonGroupContainer( factory.CreateButtonGroupContainer( this, settings ) );
 
-                       std::cout<< std::endl << " MLER buttonContainerPanel.cxx / ButtonContainerPanel() :: type " << type<<std::endl;
-                       switch (type)
-                       {
-                       case 0:
-                               this->SetButtonGroupContainer( factory.CreateButtonGroupContainer( this, settings ) );
-                       break;
-                       //case 1:
-                               //this->SetListGroupContainer(listFactory.CreateButtonGroupContainer( this, settings ) );
-                                                               // MLER Verificar ButtonGroupList contra ListGroupList
-                       //break;
-                       default:
-                               this->SetButtonGroupContainer(factory.CreateButtonGroupContainer( this, settings ) );
-                       }
+                       this->SetButtonGroupContainer( factory.CreateButtonGroupContainer( this, settings ) );
+
 
-                       this->PanelInit(type );
+                       this->PanelInit( );
                        this->m_ButtonCController = new BCController( this );
                        this->m_ButtonCController->AddEvents( );
                        this->SetEventHandler( this->m_ButtonCController );
@@ -91,34 +78,21 @@ namespace creaButtonContainer
                }*/
                
                // ----------------------------------------------------------------------------------
-               void ButtonContainerPanel::PanelInit( int type )
+               void ButtonContainerPanel::PanelInit( )
                {
-                       std::cout<< "MLER | ButtonContainerPanel::PanelInit( int type )" << std::endl;
+                       std::cout<< "MLER | ButtonContainerPanel::PanelInit(  )" << std::endl;
                        try
                        {
                                
 // EED 20/01/2012  flag 01
                                this->m_Sizer = new Sizer( 0, 1, 0, 0 );
-                               std::cout << " MLER buttonContainerPanel.cxx / Panel Init() :: type " << type << std::endl;
 
-                               if(type == 0)
-                               {
                                        for( ButtonGroupList::iterator it = this->m_ButtonGroupList.begin( ); it != this->m_ButtonGroupList.end( ); ++it )
                                        {
                                                GroupManager* manager = new GroupManager( this, *it );
                                                this->m_GroupManagerList[ manager->GetButtonID( ) ] = manager;
                                                this->m_Sizer->Add( manager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
                                        }
-                               }
-                               /*else
-                               {
-                                       for(ListGroupList::iterator it1 = this->m_ListGroupList.begin(); it1 != this->m_ListGroupList.end(); ++it1)
-                                       {
-                                               GroupManager* manager = new GroupManager( this, *it1);
-                                               this->m_GroupManagerList[ manager->GetButtonID( ) ] = manager;
-                                               this->m_Sizer->Add( manager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
-                                       }
-                               }//MLER*/
 
                                this->SetSizer( this->m_Sizer );
                                this->Layout( );
index 5e145418c67106d564e33a79487b905346fbffe0..f16da5ee6dd99544ed46874a6503c866f823c2c8 100644 (file)
@@ -151,7 +151,7 @@ namespace creaButtonContainer
                                 * @param parent wxWindow pointer to parent.
                                 * @param settings ButtonGroupSettings Pointer to button container settings.
                                 */
-                               ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings, int type );
+                               ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings);
                                // ----------------------------------------------------------------------------------
                                /*! @fn ~ButtonContainerPanel( );
                                 * @brief This is the destructor.
@@ -171,7 +171,7 @@ namespace creaButtonContainer
                                 *      @exception std::bad_alloc
                                 */
                                void
-                               PanelInit( int type);
+                               PanelInit( );
                                // ----------------------------------------------------------------------------------
 
                                //void
index 1ec058def25b119870de2f4ff80268cd75381b22..c7cfc56aa189a9aa2b9c5160372542351099224b 100644 (file)
@@ -31,7 +31,7 @@ namespace creaButtonContainer
 {
        namespace view
        {
-               // ----------------------------------------------------------------------------------
+
                ListWx::ListWx( wxWindow* parent, wxWindowID id,ItemsMap iMap , TFunctor* functor ):
                                wxPanel(parent,id)
                {
@@ -51,30 +51,86 @@ namespace creaButtonContainer
                        std::cout << "is ListBox"<< listBox->GetId()<< std::endl;
                //      this->Connect( -1,wxEVT_COMMAND_CHOICE_SELECTED,
                        //              (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))(&ListWx::ListEvent) );
-                       this->Connect(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED,
-                                     wxCommandEventHandler(ListWx::ListEvent));
+                       //this->Connect(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED,
+                               //      wxCommandEventHandler(ListWx::ListEvent));
 
-                       for (ItemsMap::iterator it=this->m_itemsMap.begin(); it!=this->m_itemsMap.end(); ++it)
-                       {
+                       this->Connect(wxEVT_COMMAND_LISTBOX_SELECTED,
+                                                wxCommandEventHandler(ListWx::ListEvent));
 
-                               std::string key = it->first;
+                       //FillList(0);
 
-                               listBox->Append( wxString(key.c_str(), wxConvUTF8));
 
-                       }
                        sizer->Add(listBox,1,wxGROW);
 
 
                }
 
                // ----------------------------------------------------------------------------------
+
+               ListWx::ListWx( wxWindow* parent, wxWindowID id, ItemsMap iMap,TFunctor* functor,
+                               std::string c) : wxPanel(parent,id)
+               {
+                       std::cout<< "MLER | ListWx::ListWx" << std::endl;
+
+                       this->m_itemsMap = iMap;
+                       this->functor = functor;
+
+                       wxFlexGridSizer* sizer = new wxFlexGridSizer(1);
+
+                       sizer->Add( new  wxStaticText(this,-1, _("Lista Configurable")));
+                       sizer->AddGrowableCol(0);
+                       this->SetSizer(sizer);
+
+                       listBox = new wxListBox(this,-1);
+
+                       std::cout << "is ListBox"<< listBox->GetId()<< std::endl;
+
+                       button = new wxButton(this, 1, _("Configurar"),
+                                       wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, wxString(c.c_str(), wxConvUTF8));
+
+                       sizer->Add(listBox,1,wxGROW);
+                       sizer->Add(button,2,wxGROW);
+
+               //      m_listConfigPanel = new ListConfigPanel(this,1,_("Configuracion"),m_itemsMap);
+                       m_listConfig = new ListConfig(m_itemsMap);
+
+                       //wxEVT_COMMAND_LISTBOX_SELECTED
+                       this->Connect(wxEVT_COMMAND_LISTBOX_SELECTED,
+                                               wxCommandEventHandler(ListWx::ListEvent));
+
+                       //FillList();
+
+               }
+
+               // ----------------------------------------------------------------------------------
+
                ListWx::~ListWx( )
                {
                }
+               // ----------------------------------------------------------------------------------
+
+               void
+               ListWx::FillList()
+               {
+                       this->listBox->Clear();
+                       std::cout<<"clear"<<std::endl;
+                       for (ItemsMap::iterator it=this->m_itemsMap.begin(); it!=this->m_itemsMap.end(); ++it)
+                       {
+                               std::string key = it->first;
+                               int v = listBox->FindString(wxString(key.c_str(), wxConvUTF8));
+                               if(v == -1)
+                                       listBox->Append( wxString(key.c_str(), wxConvUTF8));
+                       }
+                       listBox->Update();
+                       this->Update();
+               }
+               // ----------------------------------------------------------------------------------
 
                void
                ListWx::ListEvent( wxCommandEvent& event )
                {
+                       if(!this->IsFunctorEnabled())
+                               return;
                        try
                        {
                                std::cout<< "MLER | ListWx::ListEvent( wxListEvent& event )" << std::endl;
@@ -94,6 +150,7 @@ namespace creaButtonContainer
                                this->functor->Call(itemNomC);
                                std::cout<<"mmmmmmmmmmmmmmmmmmmmmmm"<<std::endl;
 
+
                        }//yrt
                        catch ( const std::exception& e )
                        {
@@ -102,7 +159,68 @@ namespace creaButtonContainer
                                    << e.what( ) << std::endl;
                        }//hctac
                }
-       // ----------------------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
+
+
+
+               ListWx::ItemsMap
+               ListWx::GetItemsMap()
+               {
+                       return m_itemsMap;
+               }
+
+               void ListWx::SetFunctorEnabled(const bool& enabled)
+               {
+                       m_functorEnabled = enabled;
+               }
+
+               bool ListWx::IsFunctorEnabled() const
+               {
+                       return m_functorEnabled;
+               }
+
+               ListWx::TFunctor*
+               ListWx::GetWxListFunctor()
+               {
+                       return this->functor;
+               }
+
+               void ListWx::AddItemToMap(std::string key, wxPanel* panel)
+               {
+                       this->m_itemsMap[key] = panel;
+               }
+
+               wxListBox*
+               ListWx::GetListBox() const
+               {
+                       return this->listBox;
+               }
+
+
+               void ListWx::DeleteItemFromMap(std::string key)
+               {
+                       std::cout<< "MLER | ListConfig::DelFinalItems(std::string name)" << std::endl;
+                       ItemsMap::iterator it1;
+
+                       //if(m_finalItems.empty())
+                       std::cout<<"name item -----test A"<< key <<std::endl;
+                       if(!this->m_itemsMap.empty())
+                       {
+                               for(ItemsMap::iterator it= this->m_itemsMap.begin(); it!=this->m_itemsMap.end();++it)
+                               {
+                                       if((it->first).compare(key) == 0  )
+                                       {
+                                               std::cout << "Item a borrar: "<< key << std::endl;
+                                               it1 = m_itemsMap.find(key);
+                                               m_itemsMap.erase(it1);
+
+                                       }
+                               }
+                       }
+                                       std::cout<< "si borre tengo --- test 2 "<< m_itemsMap.size() << std::endl;
+               }
+
+
        }//ecapseman
 }//ecapseman
 
index 7f0478ae9b28607aaa490e62860004435b41b192..346552982ff271e6ceea3dc6ef2abb329f06a990 100644 (file)
@@ -1,28 +1,27 @@
 /*# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-#                        pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-#  This software is governed by the CeCILL-B license under French law and
-#  abiding by the rules of distribution of free software. You can  use,
-#  modify and/ or redistribute the software under the terms of the CeCILL-B
-#  license as circulated by CEA, CNRS and INRIA at the following URL
-#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-#  or in the file LICENSE.txt.
-#
-#  As a counterpart to the access to the source code and  rights to copy,
-#  modify and redistribute granted by the license, users are provided only
-#  with a limited warranty  and the software's author,  the holder of the
-#  economic rights,  and the successive licensors  have only  limited
-#  liability.
-#
-#  The fact that you are presently reading this means that you have had
-#  knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la Sant�)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
 
 #ifndef LISTWX_H
 #define LISTWX_H
 #include <wx/listbox.h>
 #include <wx/wx.h>
 
-
 #include <map>
 #include <string>
 #include "functor.h"
 #include <wx/event.h>
 
 #include "system.h"
+#include "listConfig.h"
+//#include "listConfigPanel.h"
+
+namespace creaButtonContainer {
+
+namespace view {
+
+class ListWx: public wxPanel {
+public:
+
+       typedef creaButtonContainer::model::TFunctor TFunctor;
+       typedef std::map<std::string, wxPanel*> ItemsMap;
+       typedef creaButtonContainer::model::ListConfig ListConfig;
+
+public:
+
+       ListWx(wxWindow* parent, wxWindowID id, ItemsMap iMap, TFunctor* functor);
+       ListWx(wxWindow* parent, wxWindowID id, ItemsMap iMap, TFunctor* functor,
+                       std::string c);
+       // ----------------------------------------------------------------------------------
+
+       virtual
+       ~ListWx();
+       // ----------------------------------------------------------------------------------
 
-namespace creaButtonContainer
-{
+       long
+       GetID();
 
-       namespace view
-       {
+       void
+       FillList();
 
-               class ListWx : public wxPanel
-               {
-                       public:
+       void
+       ListEvent(wxCommandEvent& event);
 
-                               typedef creaButtonContainer::model::TFunctor TFunctor;
-                               typedef std::map<std::string, wxPanel*> ItemsMap;
+       ItemsMap
+       GetItemsMap();
 
-                       public:
+       TFunctor*
+       GetWxListFunctor();
 
-                               ListWx( wxWindow* parent, wxWindowID id,ItemsMap iMap , TFunctor* functor );
-                               // ----------------------------------------------------------------------------------
+       void SetFunctorEnabled(const bool& enabled);
 
-                               virtual
-                               ~ListWx( );
-                               // ----------------------------------------------------------------------------------
+       void AddItemToMap(std::string key, wxPanel* panel);
 
-                               long
-                               GetID( );
+       void DeleteItemFromMap(std::string key);
 
-                               void
-                               ListEvent( wxCommandEvent& event );
-                               // ----------------------------------------------------------------------------------
-                       private:
-                               ItemsMap m_itemsMap; //! <The pair with the button information.
-                               TFunctor* functor;
-                               //wxPanel* panel;
-                               wxListBox* listBox;
-                               wxFlexGridSizer* sizer;
+       bool IsFunctorEnabled() const;
 
+       wxListBox*
+       GetListBox() const;
 
-               };
-       }//ecapseman
-}//ecapseman
+       // ----------------------------------------------------------------------------------
+private:
+       ItemsMap m_itemsMap; //!
+       TFunctor* functor;
+       wxListBox* listBox;
+       wxFlexGridSizer* sizer;
+       wxButton* button;
+       bool m_functorEnabled;
+       ListConfig* m_listConfig;
+};
+} //ecapseman
+} //ecapseman
 
 #endif // LISTWX_H
index 7f96dcf9223f4146ccacd144a96ea061302c526e..66ba48e856ef1793cc52a7847dd5f49546d48cfa 100644 (file)
@@ -99,13 +99,14 @@ namespace creaPanelButtonContainer
 
 
                try {
-                       if(m_itemsMap.empty())
-                               std::cout<< "no tengo nada "<< std::endl;
 
                        for( ItemsMap::iterator it= this->m_itemsMap.begin(); it!=this->m_itemsMap.end(); ++it )
                        {
                                if( (*it).first.compare(buttonName) == 0 )
+                               {
+                                       std::cout<<"debe retornar" << std::endl;
                                        return ( (*it).second );
+                               }
                        }
 
 
@@ -269,8 +270,9 @@ namespace creaPanelButtonContainer
                        {
                                if( type == 0 )
                                        this->AddButton( *it );
-                               else if( type == 1 )
+                               else if( type == 1 || type == 2)
                                        this->AddItems(*it);
+
                        }//rof
                }//yrt
                catch ( std::exception& e )
@@ -291,7 +293,7 @@ namespace creaPanelButtonContainer
                        //I don't know the try catch doesn't work!!
                        if ( info->panel == NULL )
                        {
-                               std::cerr << "ButtonContainerSettings::AddButton"
+                               std::cerr << "ButtonContainerSettings::AddItems"
                                    << "exception: NULL Pointer in panel " << std::endl;
                                exit( 1 );
                        }
@@ -315,6 +317,7 @@ namespace creaPanelButtonContainer
        ButtonContainerSettings::GetItemsMap()
        {
                std::cout<< "MLER | ButtonContainerSettings:: GetItemsMap()" << std::endl;
+
                return m_itemsMap;
        }
 
index d7212643309df2ef6e71cfefff67d49e74eab739..c69fe01141febae79773729e7ff1a541762d339c 100644 (file)
@@ -69,7 +69,7 @@ namespace creaPanelButtonContainer
                {
                        this->m_ButtonPanel = new wxPanel( this );
                        std::cout << "tipo 0; new ButtonContainerPanel"<<std::endl;
-                       this->m_ButtonContainerPanel = new ButtonContainerPanel( this, this->m_ButtonContainerSettings->GetButtonGroupSettings( functor ),type );
+                       this->m_ButtonContainerPanel = new ButtonContainerPanel( this, this->m_ButtonContainerSettings->GetButtonGroupSettings( functor ) );
 
                        this->m_AuiManager->AddPane( this->m_ButtonContainerPanel,wxAuiPaneInfo( ).Name( _T("ButtonContainerPanel") ).Caption(_("ButtonContainerPanel") ). CaptionVisible( true ).CloseButton(false ).Center( ).Resizable( true ) );
                        this->m_AuiManager->AddPane(this->m_ButtonPanel, wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("ButtonPanel") ). CaptionVisible(true ).CloseButton( false ).Bottom( ).Resizable( true ) );
@@ -82,13 +82,70 @@ namespace creaPanelButtonContainer
 
                        this->m_AuiManager->AddPane( this->mylist,wxAuiPaneInfo( ).Name( _T("ListContainerPanel") ).Caption(_("ListContainerPanel") ). CaptionVisible( true ).CloseButton(false ).Center( ).Resizable( true ) );
                        this->m_AuiManager->AddPane(this->m_ListPanel, wxAuiPaneInfo( ).Name( _T("ListPanel") ).Caption( _("ListPanel") ). CaptionVisible(true ).CloseButton( false ).Bottom( ).Resizable( true ) );
-               }//MLER
+               }
+               else if( type == 2)
+               {
+                       /*this->m_ListPanel = new wxPanel(this);
+                       std::cout << "tipo 2; new LIstWx"<<std::endl;
+                       this->mylist = new ListWx(this, -1,this->m_ButtonContainerSettings->GetItemsMap(), lFunctor);
+                       this->mylist->Show(false);
+                       ItemsMap empty;
+                       this->myConfiglist = new ListWx(this,-1, empty,lFunctor);
+                       //wxButton
+                       wxPanel* panelButton = new wxPanel(this);
+                       wxBoxSizer* buttonSizer = new wxBoxSizer(wxHORIZONTAL);
+                       button = new wxButton(panelButton, -1, _("Configurar"),
+                                               wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Configurar"));
+                       buttonSizer->Add(button,0,wxEXPAND);
+                       panelButton->SetSizer(buttonSizer);
+
+                       this->m_AuiManager->AddPane( panelButton,wxAuiPaneInfo( ).Name( _T("ListConfigContainerPanel") ).Caption(_("ListConfigContainerPanel") ). CaptionVisible( true ).CloseButton(false ).Center( ).Resizable( true ) );
+
+                       this->m_AuiManager->AddPane( this->myConfiglist,wxAuiPaneInfo( ).Name( _T("ListContainerPanel") ).Caption(_("ListContainerPanel") ). CaptionVisible( true ).CloseButton(false ).Center( ).Resizable( true ) );
+
+                       this->m_AuiManager->AddPane(this->m_ListPanel, wxAuiPaneInfo( ).Name( _T("ListPanel") ).Caption( _("ListPanel") ). CaptionVisible(true ).CloseButton( false ).Bottom( ).Resizable( true ) );
+       */
+
+                       this->m_ListPanel = new wxPanel(this);
+
+                       panelUp = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ListConfigContainerPanel"));
+                       wxBoxSizer* mainSizer = new wxBoxSizer(wxHORIZONTAL);
+
+               //=======
+                       wxBoxSizer* listSizer = new wxBoxSizer(wxVERTICAL);
+
+                       this->mylist = new ListWx(panelUp,-1,this->m_ButtonContainerSettings->GetItemsMap(),lFunctor);
+                       this->mylist->Show(false);
+                       ItemsMap empty;
+                       this->myConfiglist = new ListWx(panelUp,-1, empty,lFunctor);
+                       listSizer->Add(this->myConfiglist,0,wxEXPAND);
+                       listSizer->Add(this->mylist,0,wxEXPAND);
+                       mainSizer->Add(listSizer,0,wxEXPAND|wxALL,7);
 
+               //=======
+                       wxBoxSizer* buttonSizer = new wxBoxSizer(wxVERTICAL);
 
-               //CartoButtonPanel Management
+                       button = new wxButton(panelUp, -1, _("Configurar"),
+                                                                       wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Configurar"));
 
+                       buttonSizer->Add(button,0,wxEXPAND);
+                       mainSizer->Add(buttonSizer,0,wxEXPAND|wxALL,14);
+               //=======
+
+                       panelUp->SetSizer(mainSizer);
+
+                       this->m_AuiManager->AddPane( panelUp,wxAuiPaneInfo( ).Name( _T("ListConfigContainerPanel") ).Caption(_("ListConfigContainerPanel") ). CaptionVisible( true ).CloseButton(false ).Center( ).Resizable( true ) );
+                       this->m_AuiManager->AddPane(this->m_ListPanel, wxAuiPaneInfo( ).Name( _T("ListConfigPanel") ).Caption( _("ListConfigPanel") ). CaptionVisible(true ).CloseButton( false ).Bottom( ).Resizable( true ) );
+               }
+
+               //MLER
 
                this->m_AuiManager->Update( );
+               //m_listConfigPanel = new ListConfigPanel(this,1,_("Configuracion"),mylist);
+
+               this->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
+                                                               wxCommandEventHandler(PanelButtonContainer::ButtonEvent));
+
        }
        // ----------------------------------------------------------------------------------
        PanelButtonContainer::~PanelButtonContainer( )
@@ -175,6 +232,26 @@ namespace creaPanelButtonContainer
                this->UpdateListPanel( buttonName );
        }
 
+       void
+       PanelButtonContainer::ButtonEvent ( wxCommandEvent& event )
+       {
+
+               m_listConfigPanel = new ListConfigPanel(this,-1,_("Configuracion"), mylist, myConfiglist);
+
+               std::cout<< "BUtton Event"<<std::endl;
+
+               if ( m_listConfigPanel->ShowModal() == 1 )
+               {
+                       this->myConfiglist->Reparent(panelUp);
+                       this->myConfiglist->Show(true);
+                       this->myConfiglist->SetFunctorEnabled(true);
+                       this->panelUp->Update();
+                       this->m_AuiManager->Update( );
+               }
+       }
+
+
+
 
 }//ecapseman
 
index 93ea3da0bf8b8f7c3398da6b7af586ab0cf9a65c..6677627a476651116ce2beba90309a53b73600a9 100644 (file)
@@ -43,6 +43,7 @@
 #include "buttonContainerSettings.h"
 #include "functor.h"
 #include "listWx.h"
+#include "listConfigPanel.h"
 
 /*!    @namespace <creaPanelButtonContainer>
  *     @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.
@@ -69,6 +70,10 @@ namespace creaPanelButtonContainer
                        typedef creaButtonContainer::view::ButtonContainerPanel
                            ButtonContainerPanel;
                        typedef creaButtonContainer::view::ListWx ListWx;
+                       typedef creaPanelButtonContainer::ListConfigPanel
+                                       ListConfigPanel;
+                       typedef std::map<std::string, wxPanel*> ItemsMap;
+
                        // ----------------------------------------------------------------------------------
                        //end of typedef definition.
                public:
@@ -109,8 +114,15 @@ namespace creaPanelButtonContainer
 
                        void
                        GenericListEvent( const std::string &buttonName );
+
                        //MLER
 
+                       void
+                       ButtonEvent ( wxCommandEvent& event );
+
+                       void
+                       ListEvent( wxCommandEvent& event );
+
                        // ----------------------------------------------------------------------------------
                private:
                        //Settings
@@ -122,6 +134,11 @@ namespace creaPanelButtonContainer
                        wxPanel* m_ListPanel;
 
                        ListWx* mylist; //MLER
+                       ListWx* myConfiglist; //MLER
+                       wxButton* button;
+                       ListConfigPanel* m_listConfigPanel;
+                       wxPanel* panelUp;
+
 
                DECLARE_EVENT_TABLE() //!<Event Table declaration.
        };