]> Creatis software - creaMaracasVisu.git/commitdiff
#2509 creaMaracasVisu Feature New Normal - creaPanelButtonContainer ListPanel with...
authormonica <monica@localhost.localdomain>
Thu, 22 Jan 2015 01:00:00 +0000 (02:00 +0100)
committermonica <monica@localhost.localdomain>
Thu, 22 Jan 2015 01:00:00 +0000 (02:00 +0100)
17 files changed:
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/controller/buttonContainerController.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/controller/buttonContainerController.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/functor.txx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/system.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonGroup.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonManager.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/groupManager.cxx
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/buttonContainerSettings.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.h

index f6369523738b99348273e11bcad529202937e78d..1ac95c829787b4a7e465ac6be72c27160088efad 100644 (file)
@@ -39,6 +39,7 @@ namespace creaButtonContainer
                // ----------------------------------------------------------------------------------
                ButtonContainerController::ButtonContainerController( BCPanel* panel )
                {
+                       std::cout<< "MLER | ButtonContainerController::ButtonContainerController( BCPanel* panel )" << std::endl;
                        this->m_BCPanel = panel;
                }
                // ----------------------------------------------------------------------------------
@@ -51,6 +52,7 @@ namespace creaButtonContainer
                {
                        try
                        {
+                               std::cout<< "MLER | ButtonContainerController:: AddEvents( )" << std::endl;
                                //Adding ButtonManagerEvents
                                for( GroupManagerList::iterator it =
                                    this->m_BCPanel->m_GroupManagerList.begin( ); it
@@ -86,6 +88,8 @@ namespace creaButtonContainer
                ButtonContainerController::ButtonExpEvent( wxCommandEvent& event )
                {
                        long id = event.GetId( );
+                       std::cout<< "MLER | ButtonContainerController:: ButtonExpEvent( wxCommandEvent& event )" << std::endl;
+
                        try
                        {
                                //changing the button label when its clicked and then hide the buttons of the group.
@@ -116,6 +120,7 @@ namespace creaButtonContainer
                void
                ButtonContainerController::ButtonEvent( wxCommandEvent& event )
                {
+                       std::cout<< "MLER | ButtonContainerController:: ButtonEvent( wxCommandEvent& event )" << std::endl;
                        try
                        {
                                for( ButtonGroupList::iterator it =
@@ -136,6 +141,8 @@ namespace creaButtonContainer
                        }//hctac
                }
        // ----------------------------------------------------------------------------------
+
+
        }//ecapsename
 }//ecapsename
 
index a54d4f4324c87e340acedb448f70c35c46ac487a..3cfc6efd08e707c1aa51bf44df251039d554410c 100644 (file)
@@ -153,6 +153,7 @@ namespace creaButtonContainer
                                void
                                ButtonEvent( wxCommandEvent& event );
                                // ----------------------------------------------------------------------------------
+
                        private:
                                BCPanel* m_BCPanel; //! <ButtonContainerPanel View pointer.
                };
index 484ffca00baecdd9a93042a98d7edf85945536c3..eb29cf04d43dceca677fc6ae88a0ddf1068ea05a 100644 (file)
@@ -39,6 +39,7 @@ namespace creaButtonContainer
                // ----------------------------------------------------------------------------------
                ButtonGroupFactory::ButtonGroupFactory( )
                {
+                       std::cout<< "MLER | ButtonGroupFactory::ButtonGroupFactory( )" << std::endl;
                }
                // ----------------------------------------------------------------------------------
                ButtonGroupFactory::~ButtonGroupFactory( )
@@ -51,7 +52,7 @@ namespace creaButtonContainer
                        ButtonGroupContainer groupView;
                        try
                        {
-                               std::cout<< std::endl << " MLER buttonGroupFactory.cxx / CreateButtonGroupContainer(): " << std::endl;
+                               std::cout<< "MLER | ButtonGroupFactory::CreateButtonGroupContainer()" << std::endl;
                                ButtonGroupMap map = settings->GetButtonGroupContainer( );
                                for( ButtonGroupMap::iterator it = map.begin( ); it != map.end( ); ++it )
                                {
@@ -75,6 +76,8 @@ namespace creaButtonContainer
                ButtonGroupFactory::ButtonContainer ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel )
                {
                        ButtonContainer buttonList;
+
+                       std::cout<< "MLER | ButtonGroupFactory::GetButtons()" << std::endl;
                        try
                        {
                                for( ButtonList::iterator it = buttonModel.begin( ); it
index 836e5e0487bb596b20673e57c6c2a956673ca4d2..7b640cd6d32cf8fd3e36535574a2d80fdaf0451e 100644 (file)
@@ -39,6 +39,7 @@ namespace creaButtonContainer
                // ----------------------------------------------------------------------------------
                ContainerSettings::ContainerSettings( )
                {
+
                }
                // ----------------------------------------------------------------------------------
                ContainerSettings::~ContainerSettings( )
@@ -49,12 +50,14 @@ namespace creaButtonContainer
                ButtonGroupMap
                ContainerSettings::GetButtonGroupContainer( )
                {
+                       std::cout<< "MLER | ContainerSettings::GetButtonGroupContainer( )" << std::endl;
                        return ( this->m_ButtonGroupContainer );
                }
                // ----------------------------------------------------------------------------------
                KeyMapList
                ContainerSettings::GetGroupNameList( )
                {
+                       std::cout<< "MLER | ContainerSettings::GetGroupNameList( )" << std::endl;
                        return ( this->m_GroupNameList );
                }
                
@@ -62,12 +65,14 @@ namespace creaButtonContainer
                void
                ContainerSettings::SetButtonGroupContainer(ButtonGroupMap bgContainer)
                {
+                       std::cout<< "MLER | ContainerSettings:: SetButtonGroupContainer(ButtonGroupMap bgContainer)" << std::endl;
                        this->m_ButtonGroupContainer = bgContainer;
                }
                // ----------------------------------------------------------------------------------
                void
                ContainerSettings::SetGroupNameList( KeyMapList gNameList )
                {
+                       std::cout<< "MLER | ContainerSettings::SetGroupNameList" << std::endl;
                        this->m_GroupNameList = gNameList;
                }
                
@@ -79,9 +84,7 @@ namespace creaButtonContainer
                    const StringType &buttonName, const wxBitmap &icon,
                    const StringType &buttonDescription, FunctionEventType event )
                {
-                       std::cout<< std::endl<<"MLER CLASS : ContainerSettings" << std::endl;
-                       std::cout<< std::endl<<"MLER ContainerSettings // AddButton "<<std::endl;
-
+                       std::cout<< "MLER | ContainerSettings::AddButton( const StringType & groupName," << std::endl;
 
                        ButtonPair* pair = new ButtonPair(
                            new ButtonInfo( buttonName, icon ),
@@ -115,6 +118,7 @@ namespace creaButtonContainer
                void
                ContainerSettings::AddButton( BCSettingsStruct* info )
                {
+                       std::cout<< "MLER | ContainerSettings::AddButton( BCSettingsStruct* info )" << std::endl;
                        ButtonPair* pair = new ButtonPair(
                            new ButtonInfo( info->buttonName, info->icon ),
                            new ButtonAction( info->buttonDescription, info->eventFunction ) );
@@ -143,6 +147,7 @@ namespace creaButtonContainer
                void
                ContainerSettings::AddButtons( BCStructVectorType infoList )
                {
+                       std::cout<< "MLER | ContainerSettings::AddButtons( BCStructVectorType infoList )" << std::endl;
                        try
                        {
                                for( BCStructVectorType::iterator it = infoList.begin( ); it
index 33d0ae7b65c2a85990bc445deac457a8a9cd8a00..805b5674664d1a967d2eddb160eb2202e62b88d5 100644 (file)
@@ -49,7 +49,7 @@ namespace creaButtonContainer
          template< typename TClass >
          void
          TConcreteFunctor< TClass >::operator()( const ButtonIDType &buttonName )
-         {
+         {std::cout << "MLER - TConcreteFunctor< TClass >::operator():" << buttonName << std::endl;
            try
            {
                  ( *pt2Object.*fpt )( buttonName );
@@ -66,6 +66,7 @@ namespace creaButtonContainer
          void
          TConcreteFunctor< TClass >::Call( const ButtonIDType &buttonName )
          {
+               std::cout << "MLER - TConcreteFunctor< TClass >::Call " << buttonName << std::endl;
            try
            {
                  ( *pt2Object.*fpt )( buttonName );
index 475bb212ebf796bb3986ea845d6bd5f24a16f5af..747372613949f1e913f1ee7ca049c7657fe9f39a 100644 (file)
 #include <exception>
 #include <string>
 #include "functor.h"
-//#include "listWx.h"
-//#include <wx/listctrl.h>
 
 
-/*!    @namespace <creaButtonContainer>
- *     @brief Contains the creaButtonContainer library included in creaMaracasVisu.
- */
-
-/*namespace creaButtonContainer
-{
-       namespace view
-       {
-               typedef std::list< ListWx* > ListLst;
-               typedef std::map< StringType, ListLst > ListGroupMap; // ex: grupo A,lista A,lista B
-       }
-
-
-}*/
 namespace creaButtonContainer
 {
        //using namespace view;
@@ -113,16 +97,6 @@ namespace creaButtonContainer
        typedef std::map< StringType, ButtonList > ButtonGroupMap;
 
 
-
-       //typedef wxListItem* Item; //lista objeto
-       //typedef std::list< Item > ItemsList; //lista de los objetos lista
-       //typedef std::list <ItemsList> Lista;
-       //typedef std::map< StringType, ItemsList > ListGroupMap; // ex: grupo A,items lista A (la lista de ese grupo)
-
-
-       //typedef std::list< ListWx > ListLst; // lista contenedor
-       //typedef std::map< StringType, ListLst > ListGroupMap; // ex: grupo A,lista A,lista B
-
 // ----------------------------------------------------------------------------------
 }
 #endif /* SYSTEM_H_ */
index ae64e063bd886ce166ae512fcd1527255bbda29e..7c81882f3386babdcd6510b4c0b71080a56cf903 100644 (file)
@@ -39,6 +39,8 @@ namespace creaButtonContainer
                // ----------------------------------------------------------------------------------
                Button::Button( wxWindow* parent, long id, ButtonPair* pair )           
                {
+                       std::cout<< "MLER | Button::Button()" << std::endl;
+
                        this->m_ButtonPair                      = pair;
                        StringType wXbuttonName         = this->m_ButtonPair->first->first;
                        BitmapType wXicon               = this->m_ButtonPair->first->second;
@@ -61,6 +63,7 @@ namespace creaButtonContainer
                StringType
                Button::GetButtonName( )
                {
+                       std::cout<< "MLER | Button::GetButtonName( )" << std::endl;
                        return ( this->m_ButtonPair->first->first );
                }
 
@@ -68,6 +71,7 @@ namespace creaButtonContainer
                BitmapType
                Button::GetIcon( )
                {
+                       std::cout<< "MLER | Button::GetIcon( )" << std::endl;
                        return ( this->m_ButtonPair->first->second );
                }               
 
@@ -82,6 +86,7 @@ namespace creaButtonContainer
                StringType
                Button::GetDescription( )
                {
+                       std::cout<< "MLER | Button::GetDescription( )" << std::endl;
                        return ( this->m_ButtonPair->second->first );
                }
                
@@ -89,11 +94,14 @@ namespace creaButtonContainer
                void
                Button::Execute( )
                {
+                       std::cout<< "MLER | Button::Execute( )" << std::endl;
                        try
                        {
                                TFunctor* vTable[ ] =
                                { this->m_ButtonPair->second->second };
+
                                vTable[ 0 ]->Call( this->m_ButtonPair->first->first );
+                               std::cout<< "Call Button: " << this->m_ButtonPair->first->first  <<std::endl;
                        }//yrt
                        catch ( const std::exception& e )
                        {
index fb273461149a021192d3b7a739a1fc53efd5e25b..0f182f50565d9dff4b6a8f0a9766f212c75bbb27 100644 (file)
@@ -46,7 +46,7 @@ namespace creaButtonContainer
                : wxScrolledWindow(parent,-1, wxDefaultPosition,wxDefaultSize, wxTAB_TRAVERSAL | wxVSCROLL | wxHSCROLL | wxFULL_REPAINT_ON_RESIZE, _T("creaButtonContainer") )
                {
 
-                       std::cout<< std::endl << " MLER buttonContainerPanel.cxx / ButtonContainerPanel() " << std::endl;
+                       std::cout<< "MLER | ButtonContainerPanel::ButtonContainerPanel( )" << std::endl;
 
                        ButtonGroupFactory factory;
                        //ListGroupFactory listFactory;
@@ -81,6 +81,7 @@ namespace creaButtonContainer
                // ----------------------------------------------------------------------------------
                void ButtonContainerPanel::SetButtonGroupContainer(ButtonGroupList groupContainer )
                {
+                       std::cout<< "MLER | ButtonContainerPanel::SetButtonGroupContainer()" << std::endl;
                        this->m_ButtonGroupList = groupContainer;
                }
                // ----------------------------------------------------------------------------------
@@ -92,6 +93,7 @@ namespace creaButtonContainer
                // ----------------------------------------------------------------------------------
                void ButtonContainerPanel::PanelInit( int type )
                {
+                       std::cout<< "MLER | ButtonContainerPanel::PanelInit( int type )" << std::endl;
                        try
                        {
                                
@@ -132,6 +134,7 @@ namespace creaButtonContainer
                // ----------------------------------------------------------------------------------
                void ButtonContainerPanel::FitSizer( )
                {
+                       std::cout<< "MLER | ButtonContainerPanel::FitSizer( )" << std::endl;
                        this->m_Sizer->Fit( this );
                        this->m_Sizer->FitInside( this );
                        this->SetScrollRate( 20, 20 );
index bf26736f3a860fa79df4fd2f4d6ed02e40eb0cb1..c9fb31ec465e6bced67a25cb62e5a6681b600ffc 100644 (file)
@@ -39,6 +39,7 @@ namespace creaButtonContainer
                // ----------------------------------------------------------------------------------
                ButtonGroup::ButtonGroup( wxStaticText* groupName, ButtonContainer cartoButtons )
                {
+                       std::cout<< "MLER | ButtonGroup::ButtonGroup()" << std::endl;
                        this->m_GroupName = groupName;
                        this->m_Buttons = cartoButtons;
                }
@@ -52,6 +53,7 @@ namespace creaButtonContainer
                ButtonGroup::ButtonContainer
                ButtonGroup::GetButtonContainer( )
                {
+                       std::cout<< "MLER | ButtonGroup::GetButtonContainer( )" << std::endl;
                        return ( this->m_Buttons );
                }
                
@@ -66,6 +68,7 @@ namespace creaButtonContainer
                ButtonGroup::IdButtonContainer
                ButtonGroup::GetButtonIdContainer( )
                {
+                       std::cout<< "MLER | ButtonGroup::GetButtonIdContainer( )" << std::endl;
                        IdButtonContainer idContainer;
                        try
                        {
@@ -87,6 +90,7 @@ namespace creaButtonContainer
                Button*
                ButtonGroup::GetButton( long id )
                {
+                       std::cout<< "MLER | ButtonGroup::GetButton( long id )" << std::endl;
                        try
                        {
                                //return ( this->m_Buttons[ id ] ); // JPR
index 62220ff9054d2f852f842eebcd0531110ad370d0..4454d0c8c2ac36b3a2550a55e9bdacd33d8e3a25 100644 (file)
@@ -40,6 +40,7 @@ namespace creaButtonContainer
                ButtonManager::ButtonManager( ) :
                        wxFlexGridSizer( 0, 1, 0, 0 )
                {
+                       std::cout<< "MLER | ButtonManager::ButtonManager( )" << std::endl;
                }
                
 //EED 20/01/2012  Flag03               
@@ -49,7 +50,7 @@ namespace creaButtonContainer
                {
                        try
                        {
-                               std::cout << " MLER buttonManager.cxx / GroupManager(ButtonGroup* buttonGroup) " << std::endl;
+                               std::cout<< "MLER | ButtonManager::ButtonManager( ButtonGroup* buttonGroup )" << std::endl;
                                this->SetGroupName( buttonGroup->GetGroupName( ) );
                                this->SetButtonManager( buttonGroup->GetButtonContainer( ) );
                        }//yrt
@@ -82,6 +83,7 @@ namespace creaButtonContainer
                // ----------------------------------------------------------------------------------
                void ButtonManager::SetGroupName( wxStaticText* groupName )
                {
+                       std::cout<< "MLER | ButtonManager::SetGroupName( wxStaticText* groupName )" << std::endl;
                        this->m_GroupName = groupName;
                        this->Add( this->m_GroupName, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
                }
@@ -89,6 +91,7 @@ namespace creaButtonContainer
                // ----------------------------------------------------------------------------------
                void ButtonManager::SetButtonManager( ButtonContainer buttonContainer )
                {
+                       std::cout<< "MLER | ButtonManager::SetButtonManager( ButtonContainer buttonContainer )" << std::endl;
                        try
                        {
                                if ( this->m_GroupName != NULL )
@@ -139,12 +142,14 @@ namespace creaButtonContainer
                void
                ButtonManager::ShowButtonManager( )
                {
+                       std::cout<< "MLER | ButtonManager::ShowButtonManager( )" << std::endl;
                        this->Show( this->m_GridSizer, true, false );
                }
                // ----------------------------------------------------------------------------------
                void
                ButtonManager::HideButtonManager( )
                {
+                       std::cout<< "MLER | ButtonManager::HideButtonManager( )" << std::endl;
                        this->Show( this->m_GridSizer, false, false );
                }
        // ----------------------------------------------------------------------------------
index 99747233decfeded124452141cab2191c14b49e9..eac787a8939a090c663b23bd275036dd9078c580 100644 (file)
@@ -41,7 +41,7 @@ namespace creaButtonContainer
                        wxFlexGridSizer( 1, 0, 0, 0 )
                {
 //EED 20/01/2012  flag 02                      
-                       std::cout << " MLER groupManager.cxx / GroupManager(ButtonGroup* buttonGroup) " << std::endl;
+                       std::cout<< "MLER | GroupManager::GroupManager( )" << std::endl;
                        this->m_IDExpButton = wxNewId( );
                        this->m_ExpansionButton = new ExpansionButton( parent, this->m_IDExpButton, _("-"), wxDefaultPosition, wxSize( 20, 20 ), 0, wxDefaultValidator, _T("EXPBUTTON") );
                        this->Add( m_ExpansionButton, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
@@ -69,6 +69,7 @@ namespace creaButtonContainer
                long
                GroupManager::GetButtonID( )
                {
+                       std::cout<< "MLER | GroupManager::GetButtonID( )" << std::endl;
                        return ( this->m_IDExpButton );
                }
                
@@ -76,6 +77,7 @@ namespace creaButtonContainer
                GroupManager::ExpansionButton*
                GroupManager::GetButton( )
                {
+                       std::cout<< "MLER | GroupManager::GetButton( )" << std::endl;
                        return ( this->m_ExpansionButton );
                }
                
@@ -111,6 +113,7 @@ namespace creaButtonContainer
                void
                GroupManager::HideSubPanel( bool hide )
                {
+                       std::cout<< "MLER | GroupManager::HideSubPanel( bool hide )" << std::endl;
                        if ( hide == true )
                        {
                                this->m_ButtonManager->HideButtonManager( );
index 868e331da4a37f8e2c5ed888493d8fc2b34a47b6..9fd986bbfa1604cec070aca5faa724175adb3ab7 100644 (file)
@@ -31,16 +31,24 @@ namespace creaButtonContainer
        namespace view
        {
                // ----------------------------------------------------------------------------------
-               ListWx::ListWx( wxWindow* parent, wxWindowID id, ItemsMap iMap , TFunctor* functor ): wxListCtrl(parent,id)
+               ListWx::ListWx( wxWindow* parent, wxWindowID id,ItemsMap iMap , TFunctor* functor ): wxListCtrl(parent,id)
                {
+
+                       std::cout<< "MLER | ListWx::ListWx()" << std::endl;
                        this->m_itemsMap = iMap;
+
                        this->functor = functor;
+                       int i = 0;
                        for (ItemsMap::iterator it=this->m_itemsMap.begin(); it!=this->m_itemsMap.end(); ++it)
                        {
+
                                std::string key = it->first;
-                               long index = this->InsertItem(0,  wxString::From8BitData(key.c_str()));
-                               //this->Connect( index, wxEVT_LIST_ITEM_SELECTED,
-                                       //                                          (wxObjectEventFunction) &ListWx::ButtonEvent );
+                               long index = this->InsertItem(i, wxString(key.c_str(), wxConvUTF8));
+
+                               std::cout << "index" << index << std::endl;
+                               this->Connect( -1, wxEVT_COMMAND_LIST_ITEM_SELECTED,
+                                                wxListEventHandler(ListWx::ListEvent) );
+                               i++;
                        }
                }
 
@@ -50,12 +58,19 @@ namespace creaButtonContainer
                }
 
                void
-               ListWx::ButtonEvent( wxCommandEvent& event )
+               ListWx::ListEvent( wxListEvent& event )
                {
                        try
                        {
-                               //MLDR - Aqui necesita el nombre de la funcion para poderla ejecutar
-                               this->functor->Call("PanelButtonContainer::GenericButtonEvent");
+                               std::cout<< "MLER | ListWx::ListEvent( wxListEvent& event )" << std::endl;
+
+                               wxString itemNom = event.GetItem().GetText();
+
+                               std::string itemNomC = std::string(itemNom.mb_str());
+
+                               this->functor->Call(itemNomC);
+                               std::cout<<"mmmmmmmmmmmmmmmmmmmmmmm"<<std::endl;
+
                        }//yrt
                        catch ( const std::exception& e )
                        {
index 970799c44088320653534ee6c3639bae1899ed0e..7f3054929d6a33d90cfa422ee88330a56844c9b4 100644 (file)
 #include <wx/string.h>
 #include <wx/bitmap.h>
 #include <wx/listctrl.h>
+#include <wx/wx.h>
+
+
 #include <map>
-#include <cstring>
+#include <string>
 #include "functor.h"
+#include <wx/event.h>
 
 #include "system.h"
 
@@ -51,9 +55,10 @@ namespace creaButtonContainer
 
                                typedef creaButtonContainer::model::TFunctor TFunctor;
                                typedef std::map<std::string, wxPanel*> ItemsMap;
+
                        public:
 
-                               ListWx( wxWindow* parent, wxWindowID id, ItemsMap iMap , TFunctor* functor );
+                               ListWx( wxWindow* parent, wxWindowID id,ItemsMap iMap , TFunctor* functor );
                                // ----------------------------------------------------------------------------------
 
                                virtual
@@ -64,7 +69,7 @@ namespace creaButtonContainer
                                GetID( );
 
                                void
-                               ButtonEvent( wxCommandEvent& event );
+                               ListEvent( wxListEvent& event );
                                // ----------------------------------------------------------------------------------
                        private:
                                ItemsMap m_itemsMap; //! <The pair with the button information.
index a0d1ff43e919da508fda06fae53fae68b48600dc..cc82378b606649f6426f3264b20b7f52e1651da6 100644 (file)
@@ -37,6 +37,7 @@ namespace creaPanelButtonContainer
        // ----------------------------------------------------------------------------------
        ButtonContainerSettings::ButtonContainerSettings( )
        {
+
        }
        // ----------------------------------------------------------------------------------
        ButtonContainerSettings::~ButtonContainerSettings( )
@@ -47,12 +48,14 @@ namespace creaPanelButtonContainer
        ButtonContainerSettings::ButtonGroupMap
        ButtonContainerSettings::GetButtonGroupContainer( )
        {
+               std::cout<< "MLER | ButtonContainerSettings:: GetButtonGroupContainer( ) " << std::endl;
                return m_ButtonGroupContainer;
        }
        // ----------------------------------------------------------------------------------
        ButtonContainerSettings::KeyMapList
        ButtonContainerSettings::GetGroupNameList( )
        {
+               std::cout<< "MLER | ButtonContainerSettings:: GetGroupNameList( ) " << std::endl;
                return m_GroupNameList;
        }
        // ----------------------------------------------------------------------------------
@@ -62,13 +65,13 @@ namespace creaPanelButtonContainer
        {
                try
                {
-                       std::cout<<"MLER ButtonContainerSettings // GetPanelButton "<<std::endl;
+                       std::cout<< "MLER | ButtonContainerSettings:: GetPanelButton " << std::endl;
 
                        for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
                            != this->m_GroupNameList.end( ); ++it )
                        {
 
-                               std::cout<< std::endl<<"MLER ButtonContainerSettings // GetPanelButton :: it "<< *it<<std::endl;
+                               //std::cout<< std::endl<<"MLER ButtonContainerSettings // GetPanelButton :: it "<< *it<<std::endl;
 
                                ButtonList list = this->m_ButtonGroupContainer[ ( *it ) ];
                                for( ButtonList::iterator it1 = list.begin( ); it1 != list.end( ); ++it1 )
@@ -88,6 +91,35 @@ namespace creaPanelButtonContainer
                }//hctac
                return ( NULL );
        }
+       // ----------------------------------------------------------------------------------
+       ButtonContainerSettings::PanelButton
+       ButtonContainerSettings::GetPanelList( const StringType &buttonName )
+       {
+               std::cout<< "MLER | ButtonContainerSettings:: GetPanelList " << std::endl;
+
+
+               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 )
+                                       return ( (*it).second );
+                       }
+
+
+               }catch ( std::exception& e )
+               {
+                       std::cerr
+                           << "ButtonContainerSettings::GetPanelButton( const StringType &buttonName ) "
+                           << "exception: " << e.what( ) << std::endl;
+               }//hctac
+               return (NULL);
+
+       }
+
+
        // ----------------------------------------------------------------------------------
        ButtonContainerSettings::ButtonGroupSettings*
        ButtonContainerSettings::GetButtonGroupSettings( TFunctor* functor )
@@ -95,17 +127,14 @@ namespace creaPanelButtonContainer
                ButtonGroupSettings* settings = NULL;
                try
                {
-                       std::cout<< std::endl<<"MLER CLASS : ButtonContainerSettings" << std::endl;
-                       std::cout<< std::endl<<"MLER ButtonContainerSettings // GetButtonGroupSettings "<<std::endl;
+                       std::cout<< "MLER | ButtonContainerSettings:: GetButtonGroupSettings() " << std::endl;
 
                        settings = new ButtonGroupSettings( );
 
                        for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
                            != this->m_GroupNameList.end( ); ++it )
                        {
-                               ButtonList list = this->m_ButtonGroupContainer[ ( *it ) ]; //MLER : Hacer cambio de contenedor
-
-                               std::cout<<"MLER ButtonContainerSettings // GetButtonGroupSettings :: it "<< *it<<std::endl;
+                               ButtonList list = this->m_ButtonGroupContainer[ ( *it ) ];
 
                                for( ButtonList::iterator it1 = list.begin( ); it1 != list.end( ); ++it1 )
                                {
@@ -129,12 +158,14 @@ namespace creaPanelButtonContainer
        ButtonContainerSettings::SetButtonGroupContainer(
            ButtonGroupMap m_ButtonGroupContainer )
        {
+               std::cout<< "MLER | ButtonContainerSettings:: SetButtonGroupContainer() " << std::endl;
                this->m_ButtonGroupContainer = m_ButtonGroupContainer;
        }
        // ----------------------------------------------------------------------------------
        void
        ButtonContainerSettings::SetGroupNameList( KeyMapList m_GroupNameList )
        {
+               std::cout<< "MLER | ButtonContainerSettings:: SetGroupNameList() " << std::endl;
                this->m_GroupNameList = m_GroupNameList;
        }
        
@@ -146,7 +177,7 @@ namespace creaPanelButtonContainer
        {
                try
                {
-                       std::cout<< std::endl<<"MLER ButtonContainerSettings / AddButton(groupname...)"<<std::endl;
+                       std::cout<< "MLER | ButtonContainerSettings:: AddButton( const StringType & groupName ..) " << std::endl;
 
                        //builds the button information
                        //I don't know the try catch doesn't work!!
@@ -191,6 +222,8 @@ namespace creaPanelButtonContainer
        {
                try
                {
+                       std::cout<< "MLER | ButtonContainerSettings:: AddButton( BCPSettingsStruct* info )" << std::endl;
+
                        //builds the button information
                        //I don't know the try catch doesn't work!!
                        if ( info->panel == NULL )
@@ -228,6 +261,7 @@ namespace creaPanelButtonContainer
        void
        ButtonContainerSettings::AddButtons( BCStructVectorType infoList, int type )
        {
+               std::cout<< "MLER | ButtonContainerSettings:: AddButtons( BCStructVectorType infoList, int type )" << std::endl;
                try
                {
                        for( BCStructVectorType::iterator it = infoList.begin( ); it
@@ -252,6 +286,7 @@ namespace creaPanelButtonContainer
        {
                try
                {
+                       std::cout<< "MLER | ButtonContainerSettings:: AddItems(BCPSettingsStruct* info)" << std::endl;
                        //builds the button information
                        //I don't know the try catch doesn't work!!
                        if ( info->panel == NULL )
@@ -260,7 +295,9 @@ namespace creaPanelButtonContainer
                                    << "exception: NULL Pointer in panel " << std::endl;
                                exit( 1 );
                        }
+
                        info->panel->Show( false );
+
                        std::string mapKey = info->groupName + ":" + info->buttonName;
                        m_itemsMap[mapKey] = info->panel;
 
@@ -277,6 +314,7 @@ namespace creaPanelButtonContainer
        ButtonContainerSettings::ItemsMap
        ButtonContainerSettings::GetItemsMap()
        {
+               std::cout<< "MLER | ButtonContainerSettings:: GetItemsMap()" << std::endl;
                return m_itemsMap;
        }
 
index e88f08dbe73cd6fbdcac8332db9645c54dbc0156..bb00f7dff81a165f03ff055861531a7f3b23adad 100644 (file)
@@ -238,6 +238,9 @@ namespace creaPanelButtonContainer
                        ItemsMap
                        GetItemsMap();
 
+                       PanelButton
+                       GetPanelList( const StringType &buttonName );
+
 
                        // ----------------------------------------------------------------------------------
                private:
index d377773c6c77f6d61bb9dfaae82ee6218b21ac89..7139fd1deca8434f54bf58ec5e217d4f8b3efdf7 100644 (file)
@@ -36,6 +36,8 @@
 namespace creaPanelButtonContainer
 {
        BEGIN_EVENT_TABLE(PanelButtonContainer,wxPanel)
+               //EVT_LIST_ITEM_SELECTED(-1, ListWx::ListEvent)
+
        //(*EventTable(ButtonContainerPanel)
        //*)
        END_EVENT_TABLE()
@@ -45,7 +47,7 @@ namespace creaPanelButtonContainer
        PanelButtonContainer::PanelButtonContainer( wxWindow* parent,  ButtonContainerSettings* bcSettings, int type )
                : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("creaPanelButtonContainer") )
        {
-               std::cout<< std::endl << " MLER creaPanelButtonContainer.cxx / PanelButtonContainer() " << std::endl;
+               std::cout<< "MLER | creaPanelButtonContainer:: PanelButtonContainer() " << std::endl;
 
                this->m_ButtonContainerSettings = bcSettings;
                this->m_ButtonPanel = new wxPanel( this );
@@ -56,25 +58,36 @@ namespace creaPanelButtonContainer
 //             TConcreteFunctor* functor = new TConcreteFunctor( this->m_ButtonPanel, &PanelButtonContainer::GenericButtonEvent );
                //end of the event definition
 
+               TConcreteFunctor* lFunctor = new TConcreteFunctor( this, &PanelButtonContainer::GenericListEvent );
+               //MLER
 
-               wxPanel* listPanel = new wxPanel(this);
+               this->m_ListPanel = new wxPanel(this);
 
                if(type == 0)
+               {
+                       std::cout << "tipo 0; new ButtonContainerPanel"<<std::endl;
                        this->m_ButtonContainerPanel = new ButtonContainerPanel( this, this->m_ButtonContainerSettings->GetButtonGroupSettings( functor ),type );
+               }
                else if( type == 1)
-                       this->mylist = new ListWx(listPanel, -1, this->m_ButtonContainerSettings->GetItemsMap(), functor);
-               //MLER
+               {
+                       std::cout << "tipo 1; new LIstWx"<<std::endl;
+                       this->mylist = new ListWx(this->m_ListPanel, -1,this->m_ButtonContainerSettings->GetItemsMap(), lFunctor);
+               }//MLER
 
 
                //Using AuiManager to Manage the Panels
                this->m_AuiManager = new wxAuiManager( this, wxAUI_MGR_DEFAULT );
 
-               this->m_AuiManager->AddPane(this->m_ButtonPanel, wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("Panel") ). CaptionVisible(true ).CloseButton( false ).Bottom( ).Resizable( true ) );
+               if(type == 0)
+                       this->m_AuiManager->AddPane(this->m_ButtonContainerPanel, wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("Panel") ). CaptionVisible(true ).CloseButton( false ).Bottom( ).Resizable( true ) );
+               else if(type == 1)
+                       this->m_AuiManager->AddPane(this->m_ListPanel, wxAuiPaneInfo( ).Name( _T("ListPanel") ).Caption( _("Panel") ). CaptionVisible(true ).CloseButton( false ).Bottom( ).Resizable( true ) );
+
                //CartoButtonPanel Management
                if(type == 0)
-                       this->m_AuiManager->AddPane( this->m_ButtonContainerPanel,wxAuiPaneInfo( ).Name( _T("creaButtonContainer") ).Caption(_("creaButtonContainer") ). CaptionVisible( false ).CloseButton(false ).Center( ).Resizable( true ) );
-               else
-                       this->m_AuiManager->AddPane( listPanel,wxAuiPaneInfo( ).Name( _T("creaButtonContainer") ).Caption(_("creaButtonContainer") ). CaptionVisible( false ).CloseButton(false ).Center( ).Resizable( true ) );
+                       this->m_AuiManager->AddPane( this->m_ButtonContainerPanel,wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption(_("ListPanel") ). CaptionVisible( false ).CloseButton(false ).Center( ).Resizable( true ) );
+               else if(type ==1)
+                       {this->m_AuiManager->AddPane( this->m_ListPanel,wxAuiPaneInfo( ).Name( _T("ListPanel") ).Caption(_("ListPanel") ). CaptionVisible( false ).CloseButton(false ).Center( ).Resizable( true ) );}
                this->m_AuiManager->Update( );
        }
        // ----------------------------------------------------------------------------------
@@ -87,16 +100,19 @@ namespace creaPanelButtonContainer
        {
                try
                {
+                       std::cout<< "MLER | creaPanelButtonContainer:: UpdatePanel() " << std::endl;
+
                        //Hiding the last CartoSettingsPanel
                        this->m_ButtonPanel->Show( false );
                        //Finding the CartoSettingsPanel of the ButtonClicket
                        this->m_ButtonPanel = this->m_ButtonContainerSettings->GetPanelButton(buttonName );
+                       std::cout<< buttonName << "---testEvento 2 "<<std::endl;
                        //changing the parent of the panel!
                        if ( this->m_ButtonPanel->GetParent( ) != this )
                        {
                                this->m_ButtonPanel->Reparent( this );
                        }//fi
-                       //CartoSettingsPanel Management
+                       //Panel Management
                        this->m_AuiManager->GetPane( _T("ButtonPanel") ).window = this->m_ButtonPanel;
                        //Updating the manager
                        this->m_AuiManager->Update( );
@@ -114,9 +130,52 @@ namespace creaPanelButtonContainer
        void
        PanelButtonContainer::GenericButtonEvent( const std::string &buttonName )
        {
+               std::cout<< "MLER | creaPanelButtonContainer:: GenericButtonEvent() " << std::endl;
+               std::cout<< buttonName << "---testEvento 1 "<<std::endl;
                this->UpdatePanel( buttonName );
        }
 // ----------------------------------------------------------------------------------
+
+       void
+       PanelButtonContainer::UpdateListPanel( const std::string &buttonName )
+       {
+               try{
+
+                       std::cout<< "MLER | creaPanelButtonContainer:: UpdateListPanel() " << std::endl;
+                       std::cout<< buttonName << " --- test 2 "<<std::endl;
+
+                       this->m_ListPanel->Show( false );
+
+                       this->m_ListPanel = this->m_ButtonContainerSettings->GetPanelList(buttonName );
+
+                       if ( this->m_ListPanel->GetParent( ) != this )
+                       {
+                               this->m_ListPanel->Reparent( this );
+                       }//fi
+                                               //Panel Management
+                       this->m_AuiManager->GetPane( _T("ListPanel") ).window = this->m_ListPanel;
+                                               //Updating the manager
+                       this->m_AuiManager->Update( );
+
+               }catch( const std::exception& e )
+               {
+                       std::cerr
+                           << "PanelButtonContainer::UpdatePanel( const std::string &buttonName )"
+                           << "exception: " << e.what( ) << std::endl;
+                       std::cout << "Maybe the panel of the list is NULL" << std::endl;
+                       exit( 1 );
+               }//hctac
+       }
+
+       void
+       PanelButtonContainer::GenericListEvent( const std::string &buttonName )
+       {
+               std::cout<< "MLER | creaPanelButtonContainer:: GenericListEvent() " << std::endl;
+               std::cout<< buttonName << " --- test 3 "<<std::endl;
+               this->UpdateListPanel( buttonName );
+       }
+
+
 }//ecapseman
 
 
index acbe800b098aca3c7b1cb205f3bb7ebe1f21ecea..93ea3da0bf8b8f7c3398da6b7af586ab0cf9a65c 100644 (file)
@@ -36,6 +36,7 @@
 #include <wx/panel.h>
 #include <wx/aui/aui.h>
 #include <string>
+#include <wx/gdicmn.h>
 
 #include "containerSettings.h"
 #include "buttonContainerPanel.h"
@@ -101,6 +102,15 @@ namespace creaPanelButtonContainer
                         */
                        void
                        GenericButtonEvent( const std::string &buttonName );
+
+                       // ----------------------------------------------------------------------------------
+                       void
+                       UpdateListPanel( const std::string &buttonName );
+
+                       void
+                       GenericListEvent( const std::string &buttonName );
+                       //MLER
+
                        // ----------------------------------------------------------------------------------
                private:
                        //Settings
@@ -109,7 +119,7 @@ namespace creaPanelButtonContainer
                        ButtonContainerPanel* m_ButtonContainerPanel; //!<This is the panel with de buttons (creaButtonContainer)
                        wxAuiManager* m_AuiManager; //!<The AUI Manager for the panels.
                        wxPanel* m_ButtonPanel; //!<This is the panel used to contain the panels of the buttons. (it changes with the buttonAction)
-
+                       wxPanel* m_ListPanel;
 
                        ListWx* mylist; //MLER