]> Creatis software - creaMaracasVisu.git/commitdiff
#2507 creaMaracasVisu Feature New Normal - creaPanelButtonContainer ListPanel
authordavila <eduardo.davila@creatis.insa-lyon.fr>
Mon, 26 Jan 2015 13:33:21 +0000 (14:33 +0100)
committerdavila <eduardo.davila@creatis.insa-lyon.fr>
Mon, 26 Jan 2015 13:33:21 +0000 (14:33 +0100)
30 files changed:
bbtk/src/bbcreaMaracasVisuPanelButtonContainer.cxx
bbtk/src/bbcreaMaracasVisuPanelButtonContainer.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageView.cxx
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/containerSettings.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/functor.txx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/listGroupFactory.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/listGroupFactory.h
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/button.h
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/buttonGroup.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonManager.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonManager.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/groupManager.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/groupManager.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/listGroup.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/listGroup.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/buttonContainerSettings.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/creaPanelButtonContainer.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/structBCPSettings.h

index 3f30cba3e6e3675a08b280fbbdbf51dce3b10a07..882d3d0d675cb402b6ec07afe81de64fedac567f 100644 (file)
@@ -43,13 +43,8 @@ PanelButtonContainer::Process( )
        ButtonContainerSettings* settings = new ButtonContainerSettings( );
        printf("EED PanelButtonContainer::Process %d\n", bbGetInputIn( ).size() );
 
-       if(bbGetInputType()== "1")
-       {
-//EED-MLER        settings->AddItems( bbGetInputIn() );
-       }
-       else {
-         settings->AddButtons( bbGetInputIn() );
-       }       
+
+         settings->AddButtons(bbGetInputIn( ), bbGetInputType());
 
        
        PBContainer* panel = new PBContainer( myPanel, settings, bbGetInputType() );
index 3d59055cbced2f1869df7b2e78f592f15c88f58d..89c5e3d3b5b31e598894aedd9a1da92d7e2dcb0a 100644 (file)
@@ -51,7 +51,7 @@ class bbcreaMaracasVisu_EXPORT PanelButtonContainer
 //===== 
   BBTK_DECLARE_INPUT(Title,std::string);
   BBTK_DECLARE_INPUT(In,BCStructVectorType);
-  BBTK_DECLARE_INPUT(Type,std::string);
+  BBTK_DECLARE_INPUT(Type,int);
   BBTK_PROCESS(Process);
   void Process();
   BBTK_CREATE_WIDGET(CreateWidget);
@@ -71,7 +71,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(PanelButtonContainer,bbtk::WxBlackBox);
 
   BBTK_INPUT(PanelButtonContainer,Title,"Title prepended to the text",std::string,"");
   BBTK_INPUT(PanelButtonContainer,In,"ButtonContainerSettings List",BCStructVectorType,"");
-  BBTK_INPUT(PanelButtonContainer,Type,"Type container",std::string,"");
+  BBTK_INPUT(PanelButtonContainer,Type,"Type container",int,"");
 
 BBTK_END_DESCRIBE_BLACK_BOX(PanelButtonContainer);
 //===== 
index cbba163e24222ba889e5b5523b03627f940770a2..515784ac9bafcd641b0e7ec0a7272af50b657dda 100644 (file)
@@ -345,7 +345,7 @@ void ColorLayerImageView::ConfigLookupTable()  // virtual
       delta = GetGreyLevelBoundaries(1) - GetGreyLevelBoundaries(0);
       for (int ii = 1; ii <= delta ; ii++)
        {
-         thresholdTable->SetTableValue( GetGreyLevelBoundaries(0) + ii, GetBaseColors(0) * ii/delta,
+         thresholdTable->SetTableValue( (GetGreyLevelBoundaries(0) + ii), GetBaseColors(0) * ii/delta,
                                         GetBaseColors(1) * ii/delta, GetBaseColors(2) * ii/delta, 1);
        }
            
@@ -359,7 +359,7 @@ void ColorLayerImageView::ConfigLookupTable()  // virtual
              for (int ii = 1; ii <= delta; ii++)
                {
                  // Color computation : previous_color + (current_color - previous_color)/delta * ii
-                 thresholdTable->SetTableValue(GetGreyLevelBoundaries(i) + ii,
+                 thresholdTable->SetTableValue((GetGreyLevelBoundaries(i) + ii),
                                                GetBaseColors((i-1)*3) + (GetBaseColors(i*3) - GetBaseColors((i-1)*3)) / delta * ii , 
                                                GetBaseColors((i-1)*3 + 1) + (GetBaseColors(i*3 + 1) - GetBaseColors((i-1)*3 + 1)) / delta * ii ,
                                                GetBaseColors((i-1)*3 + 2) + (GetBaseColors(i*3 + 2) - GetBaseColors((i-1)*3 + 2)) / delta * ii ,
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 759faa3af8f63be74b8623453e4d2a95ea9dfd3e..eb29cf04d43dceca677fc6ae88a0ddf1068ea05a 100644 (file)
@@ -39,6 +39,7 @@ namespace creaButtonContainer
                // ----------------------------------------------------------------------------------
                ButtonGroupFactory::ButtonGroupFactory( )
                {
+                       std::cout<< "MLER | ButtonGroupFactory::ButtonGroupFactory( )" << std::endl;
                }
                // ----------------------------------------------------------------------------------
                ButtonGroupFactory::~ButtonGroupFactory( )
@@ -51,6 +52,7 @@ namespace creaButtonContainer
                        ButtonGroupContainer groupView;
                        try
                        {
+                               std::cout<< "MLER | ButtonGroupFactory::CreateButtonGroupContainer()" << std::endl;
                                ButtonGroupMap map = settings->GetButtonGroupContainer( );
                                for( ButtonGroupMap::iterator it = map.begin( ); it != map.end( ); ++it )
                                {
@@ -74,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 18f769916826774a5ad0967ed790ec76294c1a1f..45d2932a4cc9f2c5ee8a15f9aa69504c07cc7fcd 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,43 +65,27 @@ 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;
                }
                
                // ----------------------------------------------------------------------------------
-//EED-MLER
-/*
-
-               ListGroupMap
-               ContainerSettings::GetListGroupContainer( )
-               {
-                       return ( this->m_ListGroupContainer );
-               }
 
-               void
-               ContainerSettings::SetListGroupContainer( ListGroupMap lstContainer )
-               {
-                       this->m_ListGroupContainer = lstContainer;
-               }
-*/
 
-               // ----------------------------------------------------------------------------------
 
-               // ----------------------------------------------------------------------------------
                void
                ContainerSettings::AddButton( const StringType & groupName,
                    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 ),
@@ -132,6 +119,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 ) );
@@ -160,6 +148,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
@@ -176,105 +165,6 @@ namespace creaButtonContainer
                        }//hctac
                }
 
-//EED-MLER
-/*
-               void
-               ContainerSettings::AddItems(BCStructVectorType infoList)
-               {
-                       try
-                       {
-                               for( BCStructVectorType::iterator it = infoList.begin( ); it
-                                   != infoList.end( ); ++it )
-                               {
-                                       this->AddItem(*it);
-                               }//rof
-                       }//yrt
-                       catch ( const std::exception& e )
-                       {
-                               std::cerr
-                           << "ContainerSettings::AddButtons( BCStructVectorType infoList ) "
-                           << "exception: " << e.what( ) << std::endl;
-                       }//hctac
-               }
-
-
-               //-----------------------------------------------------------------------------------
-                       void
-                               ContainerSettings::AddItem(const StringType & groupName)
-                               {
-
-                               //Es importante hacer un test, recibiendo como parametro la info de un item.
-
-
-                                       wxListItem* item;
-                                       item->SetId(1);
-                                       item->SetText(wxT("monica"));
-
-                                       creaButtonContainer::view::ListWx l;
-                                       l.setItems(item);
-
-
-                                       try
-                                       {
-                                               for( KeyMapList::iterator it = this->m_GroupNameList.begin( );
-                                                        it!= this->m_GroupNameList.end( ); ++it )
-                                               {
-                                                       if(( *it ).compare( groupName ) == 0 )
-                                                       {
-                                                               this->m_ListGroupContainer[ groupName ].push_back(l);
-                                                               return;
-                                                       }
-                                               }
-                                               this->m_GroupNameList.push_back( groupName );
-                                               this->m_ListGroupContainer[ groupName ].push_back( l );
-                                       }
-                                       catch ( const std::exception& e )
-                                       {
-                                               std::cerr
-                                               << "ContainerSettings::AddButton( const std::string & groupName,"
-                                               << "const std::string buttonName, const std::string iconpath,"
-                                               << "const std::string buttonDescription, FunctionEventType event ) exception: "
-                                               << e.what( ) << std::endl;
-                                       }//hctac
-                               }
-
-
-                               void
-                               ContainerSettings::AddItem( BCSettingsStruct* info )
-                               {
-                                       wxListItem* item;
-
-                                       wxString myString((info->buttonName).c_str(),wxConvUTF8);
-                                       item->SetText(myString);
-
-                                       creaButtonContainer::view::ListWx l;
-                                       l.setItems(item);
-
-                                       try
-                                       {
-                                               for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
-                                                       != this->m_GroupNameList.end( ); ++it )
-                                               {
-                                                       if ( ( *it ).compare( info->groupName ) == 0 )
-                                                       {
-                                                               this->m_ListGroupContainer[ info->groupName ].push_back( l );
-                                                               return;
-                                                       }//fi
-                                               }//rof
-                                               this->m_GroupNameList.push_back( info->groupName );
-                                               this->m_ListGroupContainer[ info->groupName ].push_back( l );
-                                       }
-                                       catch (const std::exception& e)
-                                       {
-                                               std::cerr
-                                               << "void ContainerSettings::AddItem( BCSettingsStruct* info ) "
-                                               << "exception: " << e.what( ) << std::endl;
-                                       }
-
-                               }
-
-*/
-
        // ----------------------------------------------------------------------------------
        }//ecapseman
 }//ecapseman
index 54f9ce9c9de7a4e051afb4e646e9d14d26dca4d0..23029770c283b5f5a3b1a7c2be2c256df5a914e2 100644 (file)
@@ -117,15 +117,6 @@ namespace creaButtonContainer
                                void
                                SetGroupNameList( KeyMapList gNameList );
                                
-//EED-MLER
-/*
-
-                               ListGroupMap
-                               GetListGroupContainer( );
-
-                               void
-                               SetListGroupContainer( ListGroupMap lstContainer );
-*/
 
                                // ----------------------------------------------------------------------------------
                                /*!
@@ -163,25 +154,16 @@ namespace creaButtonContainer
                                void
                                AddButtons( BCStructVectorType infoList );
 
-//EED-MLER
-/*
                                // ----------------------------------------------------------------------------------
-                               void
-                               AddItem(const StringType & groupName);
+                               AddItems( BCStructVectorType infoList );*/
 
-                               void
-                               AddItem( BCSettingsStruct* info );
-
-                               void
-                               AddItems( BCStructVectorType infoList );
-*/
                                // ----------------------------------------------------------------------------------
                                // ----------------------------------------------------------------------------------
                        private:
                                ButtonGroupMap m_ButtonGroupContainer; //! <The container with the group of buttons.
                                KeyMapList m_GroupNameList; //! <The container with the name of the groups of buttons.
 
-//EED-MLER                             ListGroupMap m_ListGroupContainer; // contenedor del grupo de listas
+                               //ListGroupMap m_ListGroupContainer; // contenedor del grupo de listas
                };
        }
 }
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 d6ce52652d65ac0291c4a10306ed6a9bc8298a8d..91df61b8e6fca5cdee8c5d297ee05f7bc5b93e3b 100644 (file)
 #  knowledge of the CeCILL-B license and that you accept its terms.
 # ------------------------------------------------------------------------ */
 
-/*!
- * @file buttonGroupFactory.cxx
- * @brief Implements the ButtonGroupFactory class.
- * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-06-02
- */
 
-//EED-MLER
-/*
-
-#include "listGroupFactory.h"
+/*#include "listGroupFactory.h"
 
 namespace creaButtonContainer
 {
@@ -49,25 +40,25 @@ namespace creaButtonContainer
                }
 
                // ----------------------------------------------------------------------------------
-               ListGroupFactory::ListGroupContainer ListGroupFactory::CreateListGroupContainer(wxWindow* parent,ListModel* settings )
+               ListGroupFactory::ButtonGroupContainer ListGroupFactory::CreateButtonGroupContainer( wxWindow* parent,  ButtonGroupModel* settings )
                {
-                       ListGroupContainer groupView;
+                       ButtonGroupContainer groupView;
                        try
                        {
-                               ListGroupMap map = settings->GetListGroupContainer( );
-                               for( ListGroupMap::iterator it = map.begin( ); it != map.end( ); ++it )
+                               std::cout<< std::endl << " MLER listGroupFactory.cxx / CreateButtonGroupContainer(): " << std::endl;
+                               ButtonGroupMap map = settings->GetButtonGroupContainer( );
+                               for( ButtonGroupMap::iterator it = map.begin( ); it != map.end( ); ++it )
                                {
-                                       wxString groupNameAux( ( *it ).first.c_str( ), wxConvUTF8 );//nombre grupo
+                                       wxString groupNameAux( ( *it ).first.c_str( ), wxConvUTF8 );
                                        wxStaticText* wxGroupName = new wxStaticText( parent, -1, groupNameAux, wxDefaultPosition, wxDefaultSize, 0, _T("GroupText") );
-                                       ListGroup* group = new ListGroup( wxGroupName, this->GetList( parent, ( *it ).second ) );
-                                       //ListGroup* group;
+                                       ButtonGroup* group = new ButtonGroup( wxGroupName, this->GetButtons( parent, ( *it ).second ) );
                                        groupView.push_back( group );
                                }//rof
                        }//yrt
                        catch ( const std::exception& e )
                        {
                                std::cerr
-                                   << "ListGroupFactory::CreateListGroupContainer( wxWindow* parent,   ListModel* settings )"
+                                   << "ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent,   ButtonGroupModel* settings )"
                                    << " exception: " << e.what( ) << std::endl;
                        }//chtac
                        return ( groupView );
@@ -75,19 +66,18 @@ namespace creaButtonContainer
 
 
                // ----------------------------------------------------------------------------------
-               ListGroupFactory::ListContainer ListGroupFactory::GetList( wxWindow* parent, tlist lst )
+               ListGroupFactory::ButtonContainer ListGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel )
                {
-                       ListContainer cList;
-
+                       ButtonContainer buttonList;
                        try
                        {
-
-                               //List list = new List(parent,items);
-                               //cList.push_back(list);
-                               //return ( buttonList ); // JPR
-
-
-                       }//yrt
+                               for( ButtonList::iterator it = buttonModel.begin( ); it
+                                   != buttonModel.end( ); ++it )
+                               {
+                                       long id = wxNewId( );
+                                       buttonList[ id ] = new Button( parent, id, *it );
+                               }
+                       }
                        catch ( const std::exception& e )
                        {
                                std::cerr
@@ -95,11 +85,10 @@ namespace creaButtonContainer
                                    << "exception: " << e.what( ) << std::endl;
                        }//chtac
 
-                       return ( cList );        // JPR
+                       return ( buttonList );   // JPR
                }
        // ----------------------------------------------------------------------------------
        }//ecapseman
-}//ecapseman
+}//ecapseman*/
 
 
-*/
index 6ec599271264754d55aa60473bdcfd5393c5aa7a..aece2e4cb94a2bd482d865dd84be37bef439579b 100644 (file)
 #  knowledge of the CeCILL-B license and that you accept its terms.
 # ------------------------------------------------------------------------ */
 
-/*!
- * @file buttonGroupFactory.h
- * @brief Contains ButtonGroupFactory class
- * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-06-02
- */
-
-#ifndef LISTGROUPFACTORY_H
+/*#ifndef LISTGROUPFACTORY_H
 #define LISTGROUPFACTORY_H
 
 #include <wx/window.h>
 
-#include <wx/listctrl.h>
-#include "listWx.h"
-
 #include "system.h"
+#include "button.h"
 #include "listGroup.h"
 #include "containerSettings.h"
 
-/*!    @namespace <creaButtonContainer>
- *     @brief Contains the creaButtonContainer library included in creaMaracasVisu.
- */
+
 namespace creaButtonContainer
 {
-       /*! @namespace <creaButtonContainer::model>
-        *      @brief Contains the implementation of the model in creaButtonContainer library.
-        *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
-        */
+
        namespace model
        {
-               /*! @class ButtonGroupFactory buttonGroupFactory.h "buttonGroupFactory.h"
-                *      @brief This class contains the ButtonGroup factory.
-                *  @details This class creates a container of group of buttons.
-                *  @see <a href="http://en.wikipedia.org/wiki/Factory_method_pattern">Factory Pattern</a>
-                */
+
                class ListGroupFactory
                {
                        public:
 
-                               typedef creaButtonContainer::view::ListWx List;
+                               typedef creaButtonContainer::view::ListWx Button;
+                               // ----------------------------------------------------------------------------------
 
-                               typedef creaButtonContainer::view::ListGroup ListGroup;
+                               typedef creaButtonContainer::view::ListGroup ButtonGroup;
                                // ----------------------------------------------------------------------------------
-                               /*!     @typedef creaButtonContainer::model::ContainerSettings ButtonGroupModel;
-                                *      @brief Defines the ButtonGroupModel type.
-                                */
-                               typedef creaButtonContainer::model::ContainerSettings ListModel;
+
+                               typedef creaButtonContainer::model::ContainerSettings ButtonGroupModel;
                                // ----------------------------------------------------------------------------------
-                               /*!     @typedef std::list< ButtonGroup* > ButtonGroupContainer;
-                                *      @brief Defines the ButtonGroupContainer type.
-                                */
-                               typedef std::list< ListGroup* > ListGroupContainer;
+
+                               typedef std::list< ButtonGroup* > ButtonGroupContainer;
                                // ----------------------------------------------------------------------------------
-                               /*!     @typedef std::map< long, Button* > ButtonContainer;
-                                *      @brief Defines the ButtonContainer type.
-                                */
-                               typedef std::list<ListWx> ListContainer;
 
+                               typedef std::map< long, Button* > ButtonContainer;
                                // ----------------------------------------------------------------------------------
                                //end of typedef definition
                        public:
-                               /*!     @fn ListGroupFactory::ListGroupFactory( );
-                                *      @brief This is the default constructor.
-                                */
+
                                ListGroupFactory( );
                                // -------------------------------------------------------------------------------
-                               /*!     @fn virtual ButtonGroupFactory::~ButtonGroupFactory( );
-                                *      @brief This is the destructor.
-                                */
+
                                virtual
                                ~ListGroupFactory( );
 
-                               /*! @fn ButtonGroupContainer ListGroupFactory::CreateListContainer( wxWindow* parent, ButtonGroupModel* settings );
-                                * @brief This method creates the ButtonGroupContainer.
-                                * @param parent the wxWindow* parent to be attached.
-                                * @param settings The Container settings.
-                                * @exception std::bad_alloc
-                                * @return ButtonGroupContainer The wx button group container.
-                                */
-                               ListGroupContainer
-                               CreateListGroupContainer( wxWindow* parent,
-                                   ListModel* settings );
+                               ButtonGroupContainer
+                               CreateButtonGroupContainer( wxWindow* parent,
+                                   ButtonGroupModel* settings );
                        private:
 
 
-                               /*! @fn ButtonContainer ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel );
-                                * @brief  This method creates a wx button container for a group.
-                                * @param parent the wxWindow* parent to be attached.
-                                * @param buttonModel The button list with its own information.
-                                * @exception std::bad_alloc
-                                * @return ButtonContainer The wx button container.
-                                */
-                               ListGroupContainer
-                               GetList( wxWindow* parent, ListWx lst );
+                               ButtonContainer
+                               GetButtons( wxWindow* parent, ButtonList buttonModel );
                };
        }//ecapseman
 }//ecapseman
 
-#endif // CARTOBUTTONFACTORY_H
+#endif // LISTGROUPFACTORY_H*/
index 69c3d2d8d7f6b5ec616003b065b4088694fce614..987a5653342625a0f7c5b19c7b605bcb42367643 100644 (file)
 #include <exception>
 #include <string>
 #include "functor.h"
-//EED-MLER #include <listWx.h>
-//EED-MLER #include <wx/listctrl.h>
 
 
-/*!    @namespace <creaButtonContainer>
- *     @brief Contains the creaButtonContainer library included in creaMaracasVisu.
- */
-
-/*namespace creaButtonContainer
+namespace creaButtonContainer
 {
-       namespace view
-       {
-               typedef std::list< ListWx* > ListLst;
-               typedef std::map< StringType, ListLst > ListGroupMap; // ex: grupo A,lista A,lista B
-       }
 
+       //using namespace view;
 
-}*/
-namespace creaButtonContainer
-{
-//EED-MLER     using namespace view;
        // ----------------------------------------------------------------------------------
        /*!     @typedef std::string* StringType;
         *      @brief Defines the StringType type.
@@ -113,17 +99,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)
-
-
-//EED-MLER     typedef std::list< ListWx > ListLst;
-//EED-MLER     typedef std::map< StringType, ListLst > ListGroupMap; // ex: grupo A,lista A,lista B
-
-
 // ----------------------------------------------------------------------------------
 }
 #endif /* SYSTEM_H_ */
index 39a30e3ce9c11664443fd6f0eb73b173428c6e1b..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;
@@ -46,9 +48,8 @@ namespace creaButtonContainer
                        wxString buttonName( wXbuttonName.c_str( ), wxConvUTF8 );
                        wxString description( wXdescription.c_str( ), wxConvUTF8 );
                        //creating the button.
-                       this->Create( parent, id,
-                           wXicon,
-                           wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator,
+                       this->Create( parent, id,wXicon,
+                           wxDefaultPosition, wxDefaultSize,wxBU_AUTODRAW, wxDefaultValidator,
                            buttonName );
                        this->SetToolTip( description );
                }
@@ -62,6 +63,7 @@ namespace creaButtonContainer
                StringType
                Button::GetButtonName( )
                {
+                       std::cout<< "MLER | Button::GetButtonName( )" << std::endl;
                        return ( this->m_ButtonPair->first->first );
                }
 
@@ -69,6 +71,7 @@ namespace creaButtonContainer
                BitmapType
                Button::GetIcon( )
                {
+                       std::cout<< "MLER | Button::GetIcon( )" << std::endl;
                        return ( this->m_ButtonPair->first->second );
                }               
 
@@ -83,6 +86,7 @@ namespace creaButtonContainer
                StringType
                Button::GetDescription( )
                {
+                       std::cout<< "MLER | Button::GetDescription( )" << std::endl;
                        return ( this->m_ButtonPair->second->first );
                }
                
@@ -90,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 b7a8fb6093a95b6d3ab7427ee33cd32d7a063367..f323c4de5bd2b6a8053fec71145563a8d7d69cfb 100644 (file)
@@ -33,6 +33,7 @@
 #ifndef BUTTON_H
 #define BUTTON_H
 
+//#include <wx/listctrl.h>
 #include <wx/bmpbuttn.h>
 #include <wx/image.h>
 #include <wx/string.h>
index aaeae8cbabd7c93a56404c2738faf148c7416b09..0f182f50565d9dff4b6a8f0a9766f212c75bbb27 100644 (file)
@@ -42,14 +42,31 @@ namespace creaButtonContainer
                END_EVENT_TABLE()
 
                // ----------------------------------------------------------------------------------
-               ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings, std::string type )
+               ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings, int type )
                : 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;
-                       this->SetGroupContainer( factory.CreateButtonGroupContainer( this, settings ) );
+                       //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->PanelInit(type );
                        this->m_ButtonCController = new BCController( this );
                        this->m_ButtonCController->AddEvents( );
@@ -62,21 +79,29 @@ namespace creaButtonContainer
                }
                
                // ----------------------------------------------------------------------------------
-               void ButtonContainerPanel::SetGroupContainer( ButtonGroupList groupContainer )
+               void ButtonContainerPanel::SetButtonGroupContainer(ButtonGroupList groupContainer )
                {
+                       std::cout<< "MLER | ButtonContainerPanel::SetButtonGroupContainer()" << std::endl;
                        this->m_ButtonGroupList = groupContainer;
                }
+               // ----------------------------------------------------------------------------------
+               /*void ButtonContainerPanel::SetListGroupContainer(ListGroupList groupContainer )
+               {
+                       this->m_ListGroupList = groupContainer;
+               }*/
                
                // ----------------------------------------------------------------------------------
-               void ButtonContainerPanel::PanelInit( std::string type )
+               void ButtonContainerPanel::PanelInit( int type )
                {
+                       std::cout<< "MLER | ButtonContainerPanel::PanelInit( int type )" << 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 == "1")
+                               if(type == 0)
                                {
                                        for( ButtonGroupList::iterator it = this->m_ButtonGroupList.begin( ); it != this->m_ButtonGroupList.end( ); ++it )
                                        {
@@ -85,15 +110,15 @@ namespace creaButtonContainer
                                                this->m_Sizer->Add( manager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
                                        }
                                }
-                               else
+                               /*else
                                {
-                                       for( ButtonGroupList::iterator it = this->m_ButtonGroupList.begin( ); it != this->m_ButtonGroupList.end( ); ++it )
+                                       for(ListGroupList::iterator it1 = this->m_ListGroupList.begin(); it1 != this->m_ListGroupList.end(); ++it1)
                                        {
-                                               GroupManager* manager = new GroupManager( this, *it );
+                                               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( );
@@ -109,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 4426590c5b873395cc08272ea9bd952b6400ad70..5e145418c67106d564e33a79487b905346fbffe0 100644 (file)
@@ -133,11 +133,15 @@ namespace creaButtonContainer
                                typedef creaButtonContainer::controller::ButtonContainerController
                                    BCController;
 
-//EED-MLER                             typedef creaButtonContainer::view::ListGroup ListGroup;
 
-//EED-MLER                             typedef std::list< ListGroup* > ListGroupList;
+                               //typedef creaButtonContainer::model::ListGroupFactory ListGroupFactory;
+
+                               //typedef creaButtonContainer::view::ListGroup ListGroup;
+
+                               //typedef std::list< ListGroup* > ListGroupList;
+
+                               //typedef creaButtonContainer::model::ListGroupFactory ListGroupFactory;
 
-//EED-MLER                             typedef creaButtonContainer::model::ListGroupFactory ListGroupFactory;
 
                                // ----------------------------------------------------------------------------------
                                //end of typedef definition
@@ -147,7 +151,7 @@ namespace creaButtonContainer
                                 * @param parent wxWindow pointer to parent.
                                 * @param settings ButtonGroupSettings Pointer to button container settings.
                                 */
-                               ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings, std::string type );
+                               ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings, int type );
                                // ----------------------------------------------------------------------------------
                                /*! @fn ~ButtonContainerPanel( );
                                 * @brief This is the destructor.
@@ -160,14 +164,18 @@ namespace creaButtonContainer
                                 * @param groupContainer
                                 */
                                void
-                               SetGroupContainer( ButtonGroupList groupContainer );
+                               SetButtonGroupContainer( ButtonGroupList groupContainer );
                                // ----------------------------------------------------------------------------------
                                /*! @fn PanelInit( );
                                 *      This method initializes the panel.
                                 *      @exception std::bad_alloc
                                 */
                                void
-                               PanelInit( std::string type);
+                               PanelInit( int type);
+                               // ----------------------------------------------------------------------------------
+
+                               //void
+                               //SetListGroupContainer(ListGroupList groupContainer );
                                // ----------------------------------------------------------------------------------
                                /*! @fn FitSizer( );
                                 * This method fits and organizes the sizer.
@@ -183,7 +191,9 @@ namespace creaButtonContainer
                                BCController*           m_ButtonCController; //!<Pontier to controller.
                                Sizer*                          m_Sizer; //!<Pointer to wxSizer
 
-//EED-MLER                             ListGroupList m_ListGroupList;
+
+                               //ListGroupList m_ListGroupList;
+
                        DECLARE_EVENT_TABLE() //!<Event Table declaration.
                };
        }//ecapseman
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 74ea51947b568a07fd2aa2b07406286a053e58ae..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,6 +50,7 @@ namespace creaButtonContainer
                {
                        try
                        {
+                               std::cout<< "MLER | ButtonManager::ButtonManager( ButtonGroup* buttonGroup )" << std::endl;
                                this->SetGroupName( buttonGroup->GetGroupName( ) );
                                this->SetButtonManager( buttonGroup->GetButtonContainer( ) );
                        }//yrt
@@ -57,7 +59,22 @@ namespace creaButtonContainer
                                std::cerr << "Button::Execute( ) exception: " << e.what( ) << std::endl;
                        }//hctac
                }
-               
+               // ----------------------------------------------------------------------------------
+               //MLER
+               /*ButtonManager::ButtonManager (ListGroup* buttonGroup):
+                               wxFlexGridSizer( 0, 1, 0, 0 )
+               {
+                       try
+                       {
+                               std::cout << " MLER buttonManager.cxx / ButtonManager(ListGroup* buttonGroup) " << std::endl;
+                               this->SetGroupName( buttonGroup->GetGroupName( ) );
+                               this->SetListManager(buttonGroup->GetButtonContainer( ) );
+                       }//yrt
+                       catch ( const std::exception& e )
+                       {
+                               std::cerr << "Button::Execute( ) exception: " << e.what( ) << std::endl;
+                       }//hctac
+               }*/
                // ----------------------------------------------------------------------------------
                ButtonManager::~ButtonManager( )
                {
@@ -66,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 );
                }
@@ -73,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 )
@@ -93,15 +112,44 @@ namespace creaButtonContainer
                        }//hctac
                }
                // ----------------------------------------------------------------------------------
+
+               /*void ButtonManager::SetListManager(ListContainer buttonContainer )
+               {
+                       try
+                       {
+                               if ( this->m_GroupName != NULL )
+                               {
+                                       this->m_GridSizer = new wxGridSizer( 0, 3, 0, 0 );
+                                       for( ListContainer::iterator it = buttonContainer.begin( ); it!= buttonContainer.end( ); ++it )
+                                       {
+                                               this->m_GridSizer->Add( ( *it ).second, -1,  wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
+                                       }
+                                       this->Add( m_GridSizer, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
+                               }//fi
+                       }//yrt
+                       catch ( const std::exception& e )
+                       {
+                               std::cerr
+                               << "ButtonManager::SetButtonManager( ButtonContainer buttonContainer )"
+                               << "exception: " << e.what( ) << std::endl;
+                       }//hctac
+               }*/
+               // ----------------------------------------------------------------------------------
+
+
+
+
                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 9b7aca409e019cfc9338eedc9ac945144070cf9f..7edb9bc655716d9e13513494d2d4910f5e3403ac 100644 (file)
@@ -43,6 +43,8 @@
 
 #include "button.h"
 #include "buttonGroup.h"
+#include "listWx.h"
+#include "listGroup.h"
 
 /*!    @namespace <creaButtonContainer>
  *     @brief Contains the creaButtonContainer library included in creaMaracasVisu.
@@ -80,6 +82,10 @@ namespace creaButtonContainer
                                 */
                                typedef std::map< long, Button* > ButtonContainer;
                                // ----------------------------------------------------------------------------------
+                               //MLER
+                               //typedef creaButtonContainer::view::ListGroup ListGroup;
+                               //typedef std::map<long, ListWx* > ListContainer;
+
                                //end of typedef definition.
                        public:
                                // ----------------------------------------------------------------------------------
@@ -95,6 +101,10 @@ namespace creaButtonContainer
                                 */
                                ButtonManager( ButtonGroup* buttonGroup );
                                // ----------------------------------------------------------------------------------
+                               //MLER
+                               //ButtonManager (ListGroup* buttonGroup);
+                               // ----------------------------------------------------------------------------------
+
                                /*! @fn ~ButtonManager( );
                                 * @brief This is the destructor.
                                 */
@@ -111,6 +121,7 @@ namespace creaButtonContainer
                                /*! @fn ShowButtonManager( );
                                 * @brief This method shows the ButtonManager
                                 */
+
                                void
                                ShowButtonManager( );
                                // ----------------------------------------------------------------------------------
@@ -130,6 +141,12 @@ namespace creaButtonContainer
                                void
                                SetButtonManager( ButtonContainer buttonContainer );
                                // ----------------------------------------------------------------------------------
+                               //MLER
+                               /*void
+                               SetListManager( ListContainer buttonContainer );*/
+                               // ----------------------------------------------------------------------------------
+
+
                        private:
                                wxStaticText* m_GroupName; //!<The name of the group.
                                wxGridSizer* m_GridSizer; //!<The sizer that contains the buttons.
index 4ff4ec435e135375c2f40be08a9f0f698524dae3..eac787a8939a090c663b23bd275036dd9078c580 100644 (file)
@@ -41,6 +41,7 @@ namespace creaButtonContainer
                        wxFlexGridSizer( 1, 0, 0, 0 )
                {
 //EED 20/01/2012  flag 02                      
+                       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 );
@@ -48,6 +49,17 @@ namespace creaButtonContainer
                        this->Add( this->m_ButtonManager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
                }
                
+               /*GroupManager::GroupManager(wxWindow* parent, ListGroup* buttonGroup ):
+                               wxFlexGridSizer( 1, 0, 0, 0 )
+               {
+                       std::cout << " MLER groupManager.cxx / GroupManager(ListGroup* buttonGroup) " << 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 );
+                       this->m_ButtonManager = new ButtonManager( buttonGroup );
+                       this->Add( this->m_ButtonManager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
+               }//MLER*/
+
                // ----------------------------------------------------------------------------------
                GroupManager::~GroupManager( )
                {
@@ -57,6 +69,7 @@ namespace creaButtonContainer
                long
                GroupManager::GetButtonID( )
                {
+                       std::cout<< "MLER | GroupManager::GetButtonID( )" << std::endl;
                        return ( this->m_IDExpButton );
                }
                
@@ -64,6 +77,7 @@ namespace creaButtonContainer
                GroupManager::ExpansionButton*
                GroupManager::GetButton( )
                {
+                       std::cout<< "MLER | GroupManager::GetButton( )" << std::endl;
                        return ( this->m_ExpansionButton );
                }
                
@@ -99,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 f78efa752f049c206b543453fe8c70ce273bd0a5..ab69ab4cbf29888a617d143672941f41f8fa2925 100644 (file)
@@ -43,6 +43,7 @@
 
 #include "buttonManager.h"
 #include "buttonGroup.h"
+#include "listGroup.h"
 
 /*!    @namespace <creaButtonContainer>
  *     @brief Contains the creaButtonContainer library included in creaMaracasVisu.
@@ -75,6 +76,9 @@ namespace creaButtonContainer
                                 */
                                typedef wxButton ExpansionButton;
                                // ----------------------------------------------------------------------------------
+                               //MLER
+                               //typedef creaButtonContainer::view::ListGroup ListGroup;
+
                                //end of typedef definition.
                        public:
                                // ----------------------------------------------------------------------------------
@@ -85,9 +89,12 @@ namespace creaButtonContainer
                                 */
                                GroupManager( wxWindow* parent, ButtonGroup* buttonGroup );
                                // ----------------------------------------------------------------------------------
+
+                               //MLER
+                               //GroupManager( wxWindow* parent, ListGroup* listGroup );
                                /*! @fn ~GroupManager( );
                                 *  @brief This is the destructor.
-                                */
+                               */
                                virtual
                                ~GroupManager( );
                                // ----------------------------------------------------------------------------------
@@ -144,6 +151,9 @@ namespace creaButtonContainer
                                long m_IDExpButton; //!<ID of "+""-" expansion button.
                                ExpansionButton* m_ExpansionButton; //!<The expansion button.
                                ButtonManager* m_ButtonManager; //!<The button manager.
+
+
+
                };
        }//ecapseman
 }//ecapseman
index 9d6fbe6e907c7ca6e41772298e50bc80c408b731..04686b098403493fce4faf03d6edf47b7f954744 100644 (file)
 #  knowledge of the CeCILL-B license and that you accept its terms.
 # ------------------------------------------------------------------------ */
 
-/*!
- * @file buttonGroup.cxx
- * @brief Implements the ListGroup class.
- * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-06-02
- */
-
-
-//EED-MLER
-/*
-#include "listGroup.h"
+/*#include "listGroup.h"
 
 namespace creaButtonContainer
 {
        namespace view
        {
                // ----------------------------------------------------------------------------------
-               ListGroup::ListGroup( wxStaticText* groupName, ListContainer list )
+               ListGroup::ListGroup( wxStaticText* groupName, ButtonContainer cartoButtons )
                {
                        this->m_GroupName = groupName;
-                       this->m_List = list;
+                       this->m_Buttons = cartoButtons;
                }
 
                // ----------------------------------------------------------------------------------
@@ -52,10 +42,10 @@ namespace creaButtonContainer
                }
 
                // ----------------------------------------------------------------------------------
-               ListGroup::ListContainer
-               ListGroup::GetListContainer( )
+               ListGroup::ButtonContainer
+               ListGroup::GetButtonContainer( )
                {
-                       return ( this->m_List );
+                       return ( this->m_Buttons );
                }
 
                // ----------------------------------------------------------------------------------
@@ -66,10 +56,43 @@ namespace creaButtonContainer
                }
 
                // ----------------------------------------------------------------------------------
+               ListGroup::IdButtonContainer
+               ListGroup::GetButtonIdContainer( )
+               {
+                       IdButtonContainer idContainer;
+                       try
+                       {
+                               for( ButtonContainer::iterator it = this->m_Buttons.begin( ); it
+                                   != this->m_Buttons.end( ); ++it )
+                               {
+                                       idContainer.push_back( ( *it ).first );
+                               }//rof
+                       }//yrt
+                       catch ( std::exception& e )
+                       {
+                               std::cerr << "ButtonGroup::GetButtonIdContainer( )" << "exception: "
+                                   << e.what( ) << std::endl;
+                       }//hctac
+                       return ( idContainer );
+               }
 
-
+               // ----------------------------------------------------------------------------------
+               ListGroup::Button*
+               ListGroup::GetButton( long id )
+               {
+                       try
+                       {
+                               //return ( this->m_Buttons[ id ] ); // JPR
+                       }//yrt
+                       catch ( std::exception& e )
+                       {
+                               std::cerr << "ButtonGroup::GetButton( long id )" << "exception: "
+                                   << e.what( ) << std::endl;
+                       }//hctac
+                       return ( this->m_Buttons[ id ] );// JPR
+               }
        // ----------------------------------------------------------------------------------
        }//ecapseman
-}//ecapseman
+}//ecapseman*/
+
 
-*/
index 209d09c6b5b84b88429563e81d8547ea1f80d07e..494fe33800dfb48c827e90f1bc7e9aca026c5551 100644 (file)
 #  knowledge of the CeCILL-B license and that you accept its terms.
 # ------------------------------------------------------------------------ */
 
-/*!
- * @file buttonGroup.h
- * @brief This contains the ButtonGroup class.
- * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-06-02
- */
-
 #ifndef LISTGROUP_H
 #define LISTGROUP_H
 
-//Library Definition
+/*//Library Definition
 #include <wx/stattext.h>
 
 #include <map>
 
 #include "listWx.h"
 
-/*!    @namespace <creaButtonContainer>
- *     @brief Contains the creaButtonContainer library included in creaMaracasVisu.
- */
 namespace creaButtonContainer
 {
-       /*! @namespace <creaButtonContainer::view>
-        *      @brief Contains the implementation of the view in creaButtonContainer library.
-        *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
-        */
+
        namespace view
        {
-               /*! @class ButtonGroup buttonGroup.h "buttonGroup.h"
-                *      @brief This class contains the group of buttons.
-                */
+
                class ListGroup
                {
                        public:
-                               //Typedef definition
-                               // ----------------------------------------------------------------------------------
-                               /*!     @typedef creaButtonContainer::view::Button Button;
-                                *      @brief Defines the Button type.
-                                */
-                               typedef creaButtonContainer::view::ListWx List;
-                               // ----------------------------------------------------------------------------------
-                               /*!     @typedef std::map< long, Button* > ButtonContainer;
-                                *      @brief Defines the ButtonContainer type.
-                                */
-                               typedef std::list< ListWx* > ListContainer;
-                               // ----------------------------------------------------------------------------------
 
+                               typedef creaButtonContainer::view::ListWx Button;
+
+                               typedef std::map< long, Button* > ButtonContainer;
 
+                               typedef std::list< long > IdButtonContainer;
                        public:
+
+                               ListGroup( wxStaticText* groupName, ButtonContainer buttons );
                                // ----------------------------------------------------------------------------------
-                               /*! @fn ButtonGroup( wxStaticText* groupName, ButtonContainer buttons );
-                                *      @brief This is the parameterized constructor.
-                                * @param groupName wxStatigText* with the name of the group.
-                                * @param buttons A container with buttons.
-                                */
-                               ListGroup( wxStaticText* groupName, ListContainer lists );
-                               // ----------------------------------------------------------------------------------
-                               /*! @fn ~ButtonGroup( );
-                                * @brief This is the destructor.
-                                */
+
                                virtual
                                ~ListGroup( );
+                               // ----------------------------------------------------------------------------------
 
+                               Button*
+                               GetButton( long id );
                                // ----------------------------------------------------------------------------------
-                               /*! @fn GetButtonContainer( );
-                                * @brief This method returns the button container.
-                                * @exception std::bad_alloc
-                                * @return ButtonContainer.
-                                */
-                               ListContainer
-                               GetListContainer( );
+
+                               ButtonContainer
+                               GetButtonContainer( );
                                // ----------------------------------------------------------------------------------
-                               /*! @fn GetButtonIdContainer( );
-                                * @brief This method returns a list of button IDs.
-                                * @exception std::bad_alloc
-                                * @return
-                                */
-                       //      IdListContainer
-                       //      GetListIdContainer( );
+
+                               IdButtonContainer
+                               GetButtonIdContainer( );
                                // ----------------------------------------------------------------------------------
-                               /*! @fn GetGroupName( );
-                                * @brief This method returns the name of the group.
-                                * @return
-                                */
+
                                wxStaticText*
                                GetGroupName( );
                                // ----------------------------------------------------------------------------------
                        private:
                                wxStaticText* m_GroupName; //!<A pointer with the wxStaticText of name of the group.
-                               ListContainer m_List; //!<A container with buttons.
+                               ButtonContainer m_Buttons; //!<A container with buttons.
                };
        }//ecapseman
-}//ecapseman
+}//ecapseman*/
 
 #endif // LISTGROUP_H
index 6eb86d8b0cf81036287fef25f1ba33ac648f8332..5de552c2ff816d48b423f769209fda1f4c9b92f2 100644 (file)
 
 
 
-//EED-MLER
-/*
 #include "listWx.h"
 
 namespace creaButtonContainer
 {
        namespace view
        {
-               ListWx::ListWx(wxWindow* parent, ItemsList items)
+               // ----------------------------------------------------------------------------------
+               ListWx::ListWx( wxWindow* parent, wxWindowID id,ItemsMap iMap , TFunctor* functor ): wxListCtrl(parent,id)
                {
-                       wxListCtrl* lstCtrl = new wxListCtrl (parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxLC_REPORT);
 
-                       this->m_items                   = items;
-                       lstCtrl->InsertItem(0,(*items.front()).GetText());
-               }
-
-               //-------------------------------------------------------
+                       std::cout<< "MLER | ListWx::ListWx()" << std::endl;
+                       this->m_itemsMap = iMap;
 
-               tList::~tList( )
-               {
-               }
+                       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(i, wxString(key.c_str(), wxConvUTF8));
 
-               ItemsList getItems() const
-               {
-                       return m_items;
+                               std::cout << "index" << index << std::endl;
+                               this->Connect( -1, wxEVT_COMMAND_LIST_ITEM_SELECTED,
+                                                wxListEventHandler(ListWx::ListEvent) );
+                               i++;
+                       }
                }
 
-               void setItems(ItemsList items)
+               // ----------------------------------------------------------------------------------
+               ListWx::~ListWx( )
                {
-                       m_items = items;
                }
 
+               void
+               ListWx::ListEvent( wxListEvent& event )
+               {
+                       try
+                       {
+                               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 )
+                       {
+                               std::cerr
+                                   << "ButtonContainerController::ButtonEvent( wxCommandEvent& event ) exception: "
+                                   << e.what( ) << std::endl;
+                       }//hctac
+               }
+       // ----------------------------------------------------------------------------------
+       }//ecapseman
+}//ecapseman
 
 
-*/
index 472875c7812408504629e53012977dfcde202e2f..7f3054929d6a33d90cfa422ee88330a56844c9b4 100644 (file)
 # ------------------------------------------------------------------------ */
 
 
-#ifndef LISTWX_H_
-#define LISTWX_H_
+#ifndef LISTWX_H
+#define LISTWX_H
 
-#include <wx/window.h>
+//#include <wx/bmpbuttn.h>
+#include <wx/panel.h>
+#include <wx/image.h>
 #include <wx/string.h>
+#include <wx/bitmap.h>
 #include <wx/listctrl.h>
+#include <wx/wx.h>
 
-#include <list>
+
+#include <map>
+#include <string>
+#include "functor.h"
+#include <wx/event.h>
 
 #include "system.h"
 
-/*!    @namespace <creaButtonContainer>
- *     @brief Contains the creaButtonContainer library included in creaMaracasVisu.
- */
 namespace creaButtonContainer
 {
-       /*! @namespace <creaButtonContainer::view>
-        *      @brief Contains the implementation of the view in creaButtonContainer library.
-        *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
-        */
+
        namespace view
        {
-               class ListWx : wxListCtrl
+
+               class ListWx : public wxListCtrl
                {
-                       public :
+                       public:
 
-                               typedef wxListItem* Item;
-                               typedef std::list< Item > ItemsList; //lista de los objetos lista
+                               typedef creaButtonContainer::model::TFunctor TFunctor;
+                               typedef std::map<std::string, wxPanel*> ItemsMap;
 
-                       public :
+                       public:
 
-                               ListWx();
-                               ListWx( wxWindow* parent, ItemsList items );
+                               ListWx( wxWindow* parent, wxWindowID id,ItemsMap iMap , TFunctor* functor );
+                               // ----------------------------------------------------------------------------------
 
                                virtual
-                               ~ListWx();
+                               ~ListWx( );
+                               // ----------------------------------------------------------------------------------
 
-                               ItemsList const
-                               getItems ();
+                               long
+                               GetID( );
 
                                void
-                               setItems(Item i);
-
-                       private :
-
-                               ItemsList m_items;
+                               ListEvent( wxListEvent& event );
+                               // ----------------------------------------------------------------------------------
+                       private:
+                               ItemsMap m_itemsMap; //! <The pair with the button information.
+                               TFunctor* functor;
 
                };
-       }
-}
+       }//ecapseman
+}//ecapseman
 
-#endif /* LISTWX_H_ */
+#endif // LISTWX_H
index 879be81aaddcb4dab32d4b01ff9cd0441abb9041..e93c87a03fcc78994b6dda0b3a478429507dd985 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,19 +127,20 @@ 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 ) ];
 
-                               std::cout<<"MLER ButtonContainerSettings // GetButtonGroupSettings :: it "<< *it<<std::endl;
-
                                for( ButtonList::iterator it1 = list.begin( ); it1 != list.end( ); ++it1 )
                                {
+                                       std::cout<<"MLER ButtonContainerSettings // GetButtonGroupSettings :: groupName "<< *it<<std::endl;
+                                       std::cout<<"MLER ButtonContainerSettings // GetButtonGroupSettings :: buttonName "<< ( *it1 )->first->first <<std::endl;
+
                                        settings->AddButton( ( *it ), ( *it1 )->first->first, ( *it1 )->first->second, ( *it1 )->second->first, functor );
                                }//rof
                        }//rof
@@ -125,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;
        }
        
@@ -142,7 +177,7 @@ namespace creaPanelButtonContainer
        {
                try
                {
-                       std::cout<< std::endl<<"MLER ButtonContainerSettings // AddButton"<<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!!
@@ -152,10 +187,13 @@ namespace creaPanelButtonContainer
                                    << "exception: NULL Pointer in panel " << std::endl;
                                exit( 1 );
                        }
+
                        panel->Show( false );
+
                        ButtonPair* pair = new ButtonPair(
                            new ButtonInfo( buttonName, icon ),
                            new ActionButton( buttonDescription, panel ) );
+
                        for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
                            != this->m_GroupNameList.end( ); ++it )
                        {
@@ -184,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 )
@@ -219,14 +259,18 @@ namespace creaPanelButtonContainer
        
        // ----------------------------------------------------------------------------------
        void
-       ButtonContainerSettings::AddButtons( BCStructVectorType infoList )
+       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
                            != infoList.end( ); ++it )
                        {
-                               this->AddButton( *it );
+                               if( type == 0 )
+                                       this->AddButton( *it );
+                               else if( type == 1 )
+                                       this->AddItems(*it);
                        }//rof
                }//yrt
                catch ( std::exception& e )
@@ -241,46 +285,29 @@ namespace creaPanelButtonContainer
 //EED-MLER
 /*
        void
-               ButtonContainerSettings::AddItem(BCPSettingsStruct* info)
+       ButtonContainerSettings::AddItems(BCPSettingsStruct* info)
+       {
+               try
                {
-                       if(info->panel == NULL)
+                       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 )
                        {
-                               std::cerr
-                               << "ButtonContainerSettings::AddItem"
-                               << "exception: NULL Pointer in panel" << std::endl;
-                               exit(1);
+                               std::cerr << "ButtonContainerSettings::AddButton"
+                                   << "exception: NULL Pointer in panel " << std::endl;
+                               exit( 1 );
                        }
 
-                       wxListItem item;
-                       wxString myString((info->buttonName).c_str(),wxConvUTF8);
-                       item.SetText(myString);
+                       info->panel->Show( false );
 
-                       try
-                               {
-                                       for(KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
-                                           != this->m_GroupNameList.end( ); ++it )
-                                       {
-                                               if((*it).compare(info->groupName) == 0)
-                                               {
-                                                       this->m_ListGroupContainer[info->groupName].push_back(item);
-                                                       return;
-                                               }
-                                       }//rof
-                                       this->m_GroupNameList.push_back(info->groupName);
-                                       this->m_ListGroupContainer[info->groupName].push_back(item);
-
-                               }//yrt
-                               catch ( const std::exception& e )
-                               {
-                                       std::cerr
-                                   << "ContainerSettings::AddButtons( BCStructVectorType infoList ) "
-                                   << "exception: " << e.what( ) << std::endl;
-                               }//hctac
-                       }
+                       std::string mapKey = info->groupName + ":" + info->buttonName;
+                       m_itemsMap[mapKey] = info->panel;
 
-       void
-               ButtonContainerSettings::AddItems(BCStructVectorType infoList)
+               }//yrt
+               catch ( const std::exception& e )
                {
+<<<<<<< HEAD
                        try
                        {
                                for( BCStructVectorType::iterator it = infoList.begin( ); it
@@ -297,6 +324,22 @@ namespace creaPanelButtonContainer
                        }//hctac
                }
 */
+=======
+                       std::cerr
+                       << "ButtonContainerSettings::AddButton( BCPSettingsStruct* info )"
+                       << "exception: " << e.what( ) << std::endl;
+                       exit( 1 );
+               }//hctac
+       }
+
+       ButtonContainerSettings::ItemsMap
+       ButtonContainerSettings::GetItemsMap()
+       {
+               std::cout<< "MLER | ButtonContainerSettings:: GetItemsMap()" << std::endl;
+               return m_itemsMap;
+       }
+
+>>>>>>> b8c5a565c70ac0def1f21518afa2d847a9582d79
 
 // ----------------------------------------------------------------------------------
 }//ecapseman
index 056e4e87e89a6e61ac25b3506f4333be9897d091..9f3e5245db7d7f17cdb1cfc1e433f710951ecfb9 100644 (file)
@@ -126,10 +126,8 @@ namespace creaPanelButtonContainer
                         *      @brief This class contains the settings of the button container.
                         */
 
-//EED-MLER                     typedef wxListItem Item;
-//EED-MLER                     typedef std::list < tList* > ItemsList;
-//EED-MLER                     typedef std::map< StringType, ListLst > ListGroupMap;
 
+                       typedef std::map< std::string, wxPanel* > ItemsMap;
 
                public:
                        // ----------------------------------------------------------------------------------
@@ -234,23 +232,17 @@ namespace creaPanelButtonContainer
                         * @exception std::bad_alloc
                         */
                        void
-                       AddButtons( BCStructVectorType infoList );
-
-//EED-MLER
-/*
-                       void
-                       AddItem (BCPSettingsStruct* info);
-
-                       void
-                       AddItems( BCStructVectorType infoList );
-*/
+                       AddButtons( BCStructVectorType infoList, int type );
 
                        // ----------------------------------------------------------------------------------
                private:
                        ButtonGroupMap m_ButtonGroupContainer; //!<This is the map with the groups of buttons.
                        KeyMapList m_GroupNameList; //!<This is a container with the name of the groups.
 
-//EED-MLER                     ListGroupMap m_ListGroupContainer;
-       };
+
+                       //MLER
+                       ItemsMap m_itemsMap; //This is the map with the name and the wPanel
+               };
+
 }//ecapseman
 #endif /* BUTTONCONTAINERSETTINGS_H_ */
index 70a5a6973533dc796852dbf26fcdd1e3614f325c..7139fd1deca8434f54bf58ec5e217d4f8b3efdf7 100644 (file)
 
 #include "creaPanelButtonContainer.h"
 
+
 namespace creaPanelButtonContainer
 {
        BEGIN_EVENT_TABLE(PanelButtonContainer,wxPanel)
+               //EVT_LIST_ITEM_SELECTED(-1, ListWx::ListEvent)
+
        //(*EventTable(ButtonContainerPanel)
        //*)
        END_EVENT_TABLE()
        // ----------------------------------------------------------------------------------
        typedef creaButtonContainer::model::TConcreteFunctor< PanelButtonContainer >   TConcreteFunctor;
        // ----------------------------------------------------------------------------------
-       PanelButtonContainer::PanelButtonContainer( wxWindow* parent,  ButtonContainerSettings* bcSettings, std::string type )
+       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 );
@@ -55,14 +58,36 @@ namespace creaPanelButtonContainer
 //             TConcreteFunctor* functor = new TConcreteFunctor( this->m_ButtonPanel, &PanelButtonContainer::GenericButtonEvent );
                //end of the event definition
 
-               this->m_ButtonContainerPanel = new ButtonContainerPanel( this, this->m_ButtonContainerSettings->GetButtonGroupSettings( functor ),type );
+               TConcreteFunctor* lFunctor = new TConcreteFunctor( this, &PanelButtonContainer::GenericListEvent );
+               //MLER
+
+               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)
+               {
+                       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
-               this->m_AuiManager->AddPane( this->m_ButtonContainerPanel,wxAuiPaneInfo( ).Name( _T("creaButtonContainer") ).Caption(_("creaButtonContainer") ). CaptionVisible( false ).CloseButton(false ).Center( ).Resizable( true ) );
+               if(type == 0)
+                       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( );
        }
        // ----------------------------------------------------------------------------------
@@ -75,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( );
@@ -102,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 deb21348fde8ac24fe1d83c087ff5addf715ed9a..93ea3da0bf8b8f7c3398da6b7af586ab0cf9a65c 100644 (file)
 #include <wx/panel.h>
 #include <wx/aui/aui.h>
 #include <string>
+#include <wx/gdicmn.h>
 
 #include "containerSettings.h"
 #include "buttonContainerPanel.h"
 #include "buttonContainerSettings.h"
 #include "functor.h"
+#include "listWx.h"
 
 /*!    @namespace <creaPanelButtonContainer>
  *     @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.
@@ -66,6 +68,7 @@ namespace creaPanelButtonContainer
                         */
                        typedef creaButtonContainer::view::ButtonContainerPanel
                            ButtonContainerPanel;
+                       typedef creaButtonContainer::view::ListWx ListWx;
                        // ----------------------------------------------------------------------------------
                        //end of typedef definition.
                public:
@@ -76,7 +79,7 @@ namespace creaPanelButtonContainer
                         *      @param bcSettings //The buttonContainerSettings
                         */
                        PanelButtonContainer( wxWindow* parent,
-                           ButtonContainerSettings* bcSettings, std::string type );
+                           ButtonContainerSettings* bcSettings, int type );
                        // ----------------------------------------------------------------------------------
                        /*! @fn virtual PanelButtonContainer( );
                         *      @brief This is the destructor.
@@ -99,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
@@ -107,6 +119,10 @@ 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
+
                DECLARE_EVENT_TABLE() //!<Event Table declaration.
        };
 }//ecapseman
index d1446b0f5a67737140bf0c88f496318d173b5d50..722f4e75abaa8f95607fc17049cbe47a69e24d0b 100755 (executable)
@@ -36,7 +36,7 @@
 #include <string>
 #include <wx/panel.h>
 #include <wx/bitmap.h>
-//EED-MLER #include "tlist.h"
+
 
 /*!    @namespace <creaPanelButtonContainer>
  *     @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.