]> Creatis software - creaMaracasVisu.git/commitdiff
#2502 creaMaracasVisu Feature New Normal - alternation between containers: button...
authormonica <monica@localhost.localdomain>
Wed, 14 Jan 2015 10:26:53 +0000 (11:26 +0100)
committermonica <monica@localhost.localdomain>
Wed, 14 Jan 2015 10:26:53 +0000 (11:26 +0100)
25 files changed:
bbtk/src/bbcreaMaracasVisuPanelButtonContainer.cxx
bbtk/src/bbcreaMaracasVisuPanelButtonContainer.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/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/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 76119b7be6306ea4847016d207645f292fa44e9a..abbdd39f219392c8c0b1fe61f4d3e67b552ffb05 100644 (file)
@@ -43,14 +43,14 @@ PanelButtonContainer::Process( )
        ButtonContainerSettings* settings = new ButtonContainerSettings( );
        printf("EED PanelButtonContainer::Process %d\n", bbGetInputIn( ).size() );
 
-       if(bbGetInputType()== "1")
-       {
-          settings->AddItems(bbGetInputIn());
+       //if(bbGetInputType()== "1")
+       //{
+         // settings->AddItems(bbGetInputIn());
           
-       }
-       else {
+       //}
+       //else {
          settings->AddButtons(bbGetInputIn( ));
-       }       
+       //}
 
        
        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 759faa3af8f63be74b8623453e4d2a95ea9dfd3e..484ffca00baecdd9a93042a98d7edf85945536c3 100644 (file)
@@ -51,6 +51,7 @@ namespace creaButtonContainer
                        ButtonGroupContainer groupView;
                        try
                        {
+                               std::cout<< std::endl << " MLER buttonGroupFactory.cxx / CreateButtonGroupContainer(): " << std::endl;
                                ButtonGroupMap map = settings->GetButtonGroupContainer( );
                                for( ButtonGroupMap::iterator it = map.begin( ); it != map.end( ); ++it )
                                {
index 6779dd399e7f0545cb93954256e472a8b68dd715..836e5e0487bb596b20673e57c6c2a956673ca4d2 100644 (file)
@@ -73,21 +73,7 @@ namespace creaButtonContainer
                
                // ----------------------------------------------------------------------------------
 
-               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,
@@ -173,100 +159,6 @@ namespace creaButtonContainer
                        }//hctac
                }
 
-               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
index d00db70c51f3c8fbaa1f71d68443852f7490b6bc..7aa3dc5663a3e89c03b7458936152f61072a7d58 100644 (file)
@@ -115,12 +115,6 @@ namespace creaButtonContainer
                                void
                                SetGroupNameList( KeyMapList gNameList );
                                
-                               ListGroupMap
-                               GetListGroupContainer( );
-
-                               void
-                               SetListGroupContainer( ListGroupMap lstContainer );
-
 
                                // ----------------------------------------------------------------------------------
                                /*!
@@ -159,14 +153,14 @@ namespace creaButtonContainer
                                AddButtons( BCStructVectorType infoList );
 
                                // ----------------------------------------------------------------------------------
-                               void
+                       /*      void
                                AddItem(const StringType & groupName);
 
                                void
                                AddItem( BCSettingsStruct* info );
 
                                void
-                               AddItems( BCStructVectorType infoList );
+                               AddItems( BCStructVectorType infoList );*/
 
                                // ----------------------------------------------------------------------------------
                                // ----------------------------------------------------------------------------------
@@ -174,7 +168,7 @@ namespace creaButtonContainer
                                ButtonGroupMap m_ButtonGroupContainer; //! <The container with the group of buttons.
                                KeyMapList m_GroupNameList; //! <The container with the name of the groups of buttons.
 
-                               ListGroupMap m_ListGroupContainer; // contenedor del grupo de listas
+                               //ListGroupMap m_ListGroupContainer; // contenedor del grupo de listas
                };
        }
 }
index 7322b06072a5e1510863e9974a49ce92c06f7319..1d1adba9c068da3d0d81dd35755b5da007fed0c8 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
- */
 
 #include "listGroupFactory.h"
 
@@ -46,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 );
@@ -72,17 +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
@@ -90,8 +85,9 @@ namespace creaButtonContainer
                                    << "exception: " << e.what( ) << std::endl;
                        }//chtac
 
-                       return ( cList );        // JPR
+                       return ( buttonList );   // JPR
                }
        // ----------------------------------------------------------------------------------
        }//ecapseman
 }//ecapseman
+
index 7e137bd8c217b28dce66091a535063607ce492ef..a90a26a503a235b4c9e1d9caf11828ee9f103f86 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
 #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 8317474a63878af153e5a3f4695a3f716934598f..475bb212ebf796bb3986ea845d6bd5f24a16f5af 100644 (file)
@@ -39,8 +39,8 @@
 #include <exception>
 #include <string>
 #include "functor.h"
-#include <listWx.h>
-#include <wx/listctrl.h>
+//#include "listWx.h"
+//#include <wx/listctrl.h>
 
 
 /*!    @namespace <creaButtonContainer>
@@ -59,7 +59,7 @@
 }*/
 namespace creaButtonContainer
 {
-       using namespace view;
+       //using namespace view;
        // ----------------------------------------------------------------------------------
        /*!     @typedef std::string* StringType;
         *      @brief Defines the StringType type.
@@ -120,8 +120,8 @@ namespace creaButtonContainer
        //typedef std::map< StringType, ItemsList > ListGroupMap; // ex: grupo A,items lista A (la lista de ese grupo)
 
 
-       typedef std::list< ListWx > ListLst; // lista contenedor
-       typedef std::map< StringType, ListLst > ListGroupMap; // ex: grupo A,lista A,lista B
+       //typedef std::list< ListWx > ListLst; // lista contenedor
+       //typedef std::map< StringType, ListLst > ListGroupMap; // ex: grupo A,lista A,lista B
 
 // ----------------------------------------------------------------------------------
 }
index 39a30e3ce9c11664443fd6f0eb73b173428c6e1b..ae64e063bd886ce166ae512fcd1527255bbda29e 100644 (file)
@@ -46,9 +46,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 );
                }
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..340258234a441ee5099ef1dbd6efdc74f77e702d 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;
 
                        ButtonGroupFactory factory;
-                       this->SetGroupContainer( factory.CreateButtonGroupContainer( this, settings ) );
+                       ListGroupFactory listFactory;
+
+                       //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 ) );
+                                                               //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,27 @@ namespace creaButtonContainer
                }
                
                // ----------------------------------------------------------------------------------
-               void ButtonContainerPanel::SetGroupContainer( ButtonGroupList groupContainer )
+               void ButtonContainerPanel::SetButtonGroupContainer(ButtonGroupList groupContainer )
                {
                        this->m_ButtonGroupList = groupContainer;
                }
+               // ----------------------------------------------------------------------------------
+               void ButtonContainerPanel::SetListGroupContainer(ListGroupList groupContainer )
+               {
+                       this->m_ListGroupList = groupContainer;
+               }
                
                // ----------------------------------------------------------------------------------
-               void ButtonContainerPanel::PanelInit( std::string type )
+               void ButtonContainerPanel::PanelInit( int type )
                {
                        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 )
                                        {
@@ -87,13 +110,13 @@ namespace creaButtonContainer
                                }
                                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( );
index 988fbc2496905652ac77e80f90dd1af937eb8b63..8fdc3b6bec91dc18a3a9a833b4e20dc02808e202 100644 (file)
@@ -133,11 +133,13 @@ namespace creaButtonContainer
                                typedef creaButtonContainer::controller::ButtonContainerController
                                    BCController;
 
+                               typedef creaButtonContainer::model::ListGroupFactory ListGroupFactory;
+
                                typedef creaButtonContainer::view::ListGroup ListGroup;
 
                                typedef std::list< ListGroup* > ListGroupList;
 
-                               typedef creaButtonContainer::model::ListGroupFactory ListGroupFactory;
+                               //typedef creaButtonContainer::model::ListGroupFactory ListGroupFactory;
 
                                // ----------------------------------------------------------------------------------
                                //end of typedef definition
@@ -147,7 +149,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 +162,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.
index 74ea51947b568a07fd2aa2b07406286a053e58ae..dc793d537a0c123391a4fc10a781f502e4a1de68 100644 (file)
@@ -49,6 +49,7 @@ namespace creaButtonContainer
                {
                        try
                        {
+                               std::cout << " MLER buttonManager.cxx / GroupManager(ButtonGroup* buttonGroup) " << std::endl;
                                this->SetGroupName( buttonGroup->GetGroupName( ) );
                                this->SetButtonManager( buttonGroup->GetButtonContainer( ) );
                        }//yrt
@@ -57,7 +58,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( )
                {
@@ -93,6 +109,33 @@ 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( )
                {
index 9b7aca409e019cfc9338eedc9ac945144070cf9f..88eeb5f69c64951c5e0922b42b1c2fccf8f1b08a 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..1cec6714d28672bef858f22a6f67155840cf733f 100644 (file)
@@ -41,6 +41,7 @@ namespace creaButtonContainer
                        wxFlexGridSizer( 1, 0, 0, 0 )
                {
 //EED 20/01/2012  flag 02                      
+                       std::cout << " MLER groupManager.cxx / GroupManager(ButtonGroup* buttonGroup) " << std::endl;
                        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( )
                {
index f78efa752f049c206b543453fe8c70ce273bd0a5..1d84118fc89f1027f441a11ef0c5ea0e12958fe0 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 cb193d6d1005968f9d6e7887ad8bd53e168f5b21..92295a1cac8cb79c6d249461aad8a7d2af79c146 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
- */
-
 #include "listGroup.h"
 
 namespace creaButtonContainer
@@ -37,10 +30,10 @@ 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;
                }
 
                // ----------------------------------------------------------------------------------
@@ -49,10 +42,10 @@ namespace creaButtonContainer
                }
 
                // ----------------------------------------------------------------------------------
-               ListGroup::ListContainer
-               ListGroup::GetListContainer( )
+               ListGroup::ButtonContainer
+               ListGroup::GetButtonContainer( )
                {
-                       return ( this->m_List );
+                       return ( this->m_Buttons );
                }
 
                // ----------------------------------------------------------------------------------
@@ -63,8 +56,41 @@ 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
index 209d09c6b5b84b88429563e81d8547ea1f80d07e..c34701055375d52dbf197fae2dd53c669f621e7a 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
 
 
 #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
index 5e670e74cb4b1f1dffc804d6fa46c8cfd7089353..f64ab47bcc5d3a4a62628a410149eeacad316b36 100644 (file)
 #  knowledge of the CeCILL-B license and that you accept its terms.
 # ------------------------------------------------------------------------ */
 
+
 #include "listWx.h"
 
 namespace creaButtonContainer
 {
        namespace view
        {
-               ListWx::ListWx(wxWindow* parent, ItemsList items)
+               // ----------------------------------------------------------------------------------
+               ListWx::ListWx( wxWindow* parent, long id, ButtonPair* pair )
                {
-                       wxListCtrl* lstCtrl = new wxListCtrl (parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxLC_REPORT);
-
-                       this->m_items                   = items;
-                       lstCtrl->InsertItem(0,(*items.front()).GetText());
+                       this->m_ButtonPair                      = pair;
+                       StringType wXbuttonName         = this->m_ButtonPair->first->first;
+                       BitmapType wXicon               = this->m_ButtonPair->first->second;
+                       StringType wXdescription        = this->m_ButtonPair->second->first;
+                       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,
+                           buttonName );*/
+                       this->Create( parent, id,
+                                                   wxDefaultPosition, wxDefaultSize,wxLC_LIST, wxDefaultValidator,
+                                                   buttonName );
+                       this->SetToolTip( description );
                }
 
-               //-------------------------------------------------------
-
-               tList::~tList( )
+               // ----------------------------------------------------------------------------------
+               ListWx::~ListWx( )
                {
                }
 
-               //-------------------------------------------------------
-
-               ItemsList getItems() const
+               // ----------------------------------------------------------------------------------
+               StringType
+               ListWx::GetButtonName( )
                {
-                       return m_items;
+                       return ( this->m_ButtonPair->first->first );
                }
 
-               void setItems(ItemsList items)
+               // ----------------------------------------------------------------------------------
+               BitmapType
+               ListWx::GetIcon( )
                {
-                       m_items = items;
+                       return ( this->m_ButtonPair->first->second );
                }
 
+               // ----------------------------------------------------------------------------------
+               /*StringType
+               Button::GetIconPath( )
+               {
+                       return ( this->m_ButtonPair->first->second );
+               }*/
 
+               // ----------------------------------------------------------------------------------
+               StringType
+               ListWx::GetDescription( )
+               {
+                       return ( this->m_ButtonPair->second->first );
+               }
 
-       }
-
-}
+               // ----------------------------------------------------------------------------------
+               void
+               ListWx::Execute( )
+               {
+                       try
+                       {
+                               TFunctor* vTable[ ] =
+                               { this->m_ButtonPair->second->second };
+                               vTable[ 0 ]->Call( this->m_ButtonPair->first->first );
+                       }//yrt
+                       catch ( const std::exception& e )
+                       {
+                               std::cerr << "Button::Execute( ) exception: " << e.what( ) << std::endl;
+                       }//hctac
+               }
+       // ----------------------------------------------------------------------------------
+       }//ecapseman
+}//ecapseman
index 472875c7812408504629e53012977dfcde202e2f..905dbec35612b45dc4f1678b313b84e8815156ad 100644 (file)
 # ------------------------------------------------------------------------ */
 
 
-#ifndef LISTWX_H_
-#define LISTWX_H_
+#ifndef LISTWX_H
+#define LISTWX_H
 
-#include <wx/window.h>
+//#include <wx/bmpbuttn.h>
+#include <wx/image.h>
 #include <wx/string.h>
+#include <wx/bitmap.h>
 #include <wx/listctrl.h>
 
-#include <list>
-
 #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;
 
-                       public :
+                       public:
 
-                               ListWx();
-                               ListWx( wxWindow* parent, ItemsList items );
+                               ListWx( wxWindow* parent, long id, ButtonPair* pair );
+                               // ----------------------------------------------------------------------------------
 
                                virtual
-                               ~ListWx();
+                               ~ListWx( );
+                               // ----------------------------------------------------------------------------------
 
-                               ItemsList const
-                               getItems ();
+                               long
+                               GetID( );
+                               // ----------------------------------------------------------------------------------
 
-                               void
-                               setItems(Item i);
+                               StringType
+                               GetButtonName( );
 
-                       private :
+                               // ----------------------------------------------------------------------------------
 
-                               ItemsList m_items;
+                               BitmapType
+                               GetIcon( );
+
+                               // ----------------------------------------------------------------------------------
+
+                               StringType
+                               GetDescription( );
+                               // ----------------------------------------------------------------------------------
+
+                               void
+                               Execute( );
+                               // ----------------------------------------------------------------------------------
+                       private:
+                               ButtonPair* m_ButtonPair; //! <The pair with the button information.
 
                };
-       }
-}
+       }//ecapseman
+}//ecapseman
 
-#endif /* LISTWX_H_ */
+#endif // LISTWX_H
index 2ca8d8dab6bc79dd51f47306f28d5b0c77238e20..e6c991b182b48972a1536be652a43b746b68b073 100644 (file)
@@ -99,15 +99,19 @@ namespace creaPanelButtonContainer
                        std::cout<< std::endl<<"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 ) ];
+                               ButtonList list = this->m_ButtonGroupContainer[ ( *it ) ]; //MLER : Hacer cambio de contenedor
 
                                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
@@ -142,7 +146,7 @@ namespace creaPanelButtonContainer
        {
                try
                {
-                       std::cout<< std::endl<<"MLER ButtonContainerSettings // AddButton"<<std::endl;
+                       std::cout<< std::endl<<"MLER ButtonContainerSettings / AddButton(groupname...)"<<std::endl;
 
                        //builds the button information
                        //I don't know the try catch doesn't work!!
@@ -152,10 +156,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 )
                        {
@@ -237,63 +244,6 @@ namespace creaPanelButtonContainer
                }//hctac
        }
 
-       void
-               ButtonContainerSettings::AddItem(BCPSettingsStruct* info)
-               {
-                       if(info->panel == NULL)
-                       {
-                               std::cerr
-                               << "ButtonContainerSettings::AddItem"
-                               << "exception: NULL Pointer in panel" << std::endl;
-                               exit(1);
-                       }
-
-                       wxListItem item;
-                       wxString myString((info->buttonName).c_str(),wxConvUTF8);
-                       item.SetText(myString);
-
-                       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
-                       }
-
-       void
-               ButtonContainerSettings::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
-               }
-
 
 // ----------------------------------------------------------------------------------
 }//ecapseman
index cdb3207783c62ad3a1a171201293cfa65abd2231..329ced9f1b7f5c3d6b9d868027e7e09d04c136e3 100644 (file)
@@ -126,10 +126,6 @@ namespace creaPanelButtonContainer
                         *      @brief This class contains the settings of the button container.
                         */
 
-                       typedef wxListItem Item;
-                       typedef std::list < tList* > ItemsList;
-                       typedef std::map< StringType, ListLst > ListGroupMap;
-
 
                public:
                        // ----------------------------------------------------------------------------------
@@ -236,18 +232,12 @@ namespace creaPanelButtonContainer
                        void
                        AddButtons( BCStructVectorType infoList );
 
-                       void
-                       AddItem (BCPSettingsStruct* info);
-
-                       void
-                       AddItems( BCStructVectorType infoList );
 
                        // ----------------------------------------------------------------------------------
                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.
 
-                       ListGroupMap m_ListGroupContainer;
-       };
+                       };
 }//ecapseman
 #endif /* BUTTONCONTAINERSETTINGS_H_ */
index 70a5a6973533dc796852dbf26fcdd1e3614f325c..ea943d82b1ddf19c0d1c152b99e4ba0b401c2ab8 100644 (file)
@@ -41,7 +41,7 @@ namespace creaPanelButtonContainer
        // ----------------------------------------------------------------------------------
        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;
index deb21348fde8ac24fe1d83c087ff5addf715ed9a..f20232ba4ae9cdcd8f879af1ac374fc243df0a39 100644 (file)
@@ -76,7 +76,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.
index 48681549b176dcd8cb0b1a53d688041b785f8400..722f4e75abaa8f95607fc17049cbe47a69e24d0b 100755 (executable)
@@ -36,7 +36,7 @@
 #include <string>
 #include <wx/panel.h>
 #include <wx/bitmap.h>
-#include "tlist.h"
+
 
 /*!    @namespace <creaPanelButtonContainer>
  *     @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.