]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h
#2647 creaMaracasVisu Feature New Normal - Merge creaButtonContainer BRANCH
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaPanelButtonContainer / buttonContainerSettings.h
index ccd01c5ca943e9d41eb31f18551eca187c6dc119..4bd2ce508fac2f0ecdb2d55054f65936dd3ae6af 100644 (file)
@@ -1,27 +1,27 @@
 /*# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-#                        pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-#  This software is governed by the CeCILL-B license under French law and
-#  abiding by the rules of distribution of free software. You can  use,
-#  modify and/ or redistribute the software under the terms of the CeCILL-B
-#  license as circulated by CEA, CNRS and INRIA at the following URL
-#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-#  or in the file LICENSE.txt.
-#
-#  As a counterpart to the access to the source code and  rights to copy,
-#  modify and redistribute granted by the license, users are provided only
-#  with a limited warranty  and the software's author,  the holder of the
-#  economic rights,  and the successive licensors  have only  limited
-#  liability.
-#
-#  The fact that you are presently reading this means that you have had
-#  knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la Sant�)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
 
 /*!
  * @file buttonContainerSettings.h
@@ -35,7 +35,7 @@
 
 #include <wx/panel.h>
 #include <wx/bitmap.h>
-#include <wx/listctrl.h>
+//#include <wx/listctrl.h>
 
 #include <list>
 #include <map>
@@ -46,7 +46,6 @@
 #include "containerSettings.h"
 #include "functor.h"
 
-
 /*!    @namespace <creaPanelButtonContainer>
  *     @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.
  */
@@ -82,79 +81,87 @@ namespace creaPanelButtonContainer
                        // ----------------------------------------------------------------------------------
                        /*!     @typedef std::pair< std::string, PanelButton > ActionButton;
                         *      @brief Defines the ActionButton type.
-                        *      First is the button description, Second FunctionEventType
+                        *      First is the button name, Second FunctionEventType
                         */
-                       typedef std::pair< std::string, PanelButton > ActionButton;
-                       
+                       typedef std::pair<std::string, PanelButton> ActionButton;
+
                        // ----------------------------------------------------------------------------------
                        /*!     @typedef std::pair< std::string, wxBitmap > ButtonInfo;
                         *      @brief Defines the ButtonInfo type.
                         *      First is the ButtonName, Second is the ImageIcon
                         */
-                       typedef std::pair< std::string, wxBitmap > ButtonInfo;
-                       
+                       typedef std::pair<std::string, wxBitmap> ButtonInfo;
+
                        // ----------------------------------------------------------------------------------
                        /*!     @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
                         *      @brief Defines the ButtonPair type.
                         */
-                       typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
+                       typedef std::pair<ButtonInfo*, ActionButton*> ButtonPair;
                        // ----------------------------------------------------------------------------------
                        /*!     @typedef std::list< std::string > KeyMapList;
                         *      @brief Defines the KeyMapList type.
                         */
-                       typedef std::list< std::string > KeyMapList;
-               
+                       typedef std::list<std::string> KeyMapList;
+
                        // ----------------------------------------------------------------------------------
                        /*!     @typedef std::list< ButtonPair* > ButtonList;
                         *      @brief Defines the ButtonList type.
                         */
-                       typedef std::list< ButtonPair* > ButtonList;                    
-                       
+                       typedef std::list<ButtonPair*> ButtonList;
+
                        // ----------------------------------------------------------------------------------
                        /*!     @typedef std::map< std::string, ButtonList > ButtonGroupMap;
                         *      @brief Defines the ButtonGroupMap type.
                         */
-                       typedef std::map< std::string, ButtonList > ButtonGroupMap;
+                       typedef std::map<std::string, ButtonList> ButtonGroupMap;
                        // ----------------------------------------------------------------------------------
                        /*!     @typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
                         *      @brief Defines the BCStructVectorType type.
                         */
-                       typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
-                       //end typedef definition
+                       typedef std::vector<BCPSettingsStruct*> BCStructVectorType;
+                       //MLER
                        // ----------------------------------------------------------------------------------
-                       /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
-                        *      @brief This class contains the settings of the button container.
+                       /*!     @typedef std::pair<std::string, wxPanel*> ListAction;
+                        *      @brief Defines the ListAction type.
+                        *      First is the button name(item list), Second FunctionEventType
                         */
+                       typedef std::pair<std::string, wxPanel*> ListAction;
+                       // ----------------------------------------------------------------------------------
+                       /*!     @typedef std::vector<ListAction> ItemsVector;
+                        *      @brief Defines the Items Vector type.
+                        */
+                       typedef std::vector<ListAction> ItemsVector;
+                       //MLER
+                       //end typedef definition
+                       // ----------------------------------------------------------------------------------
 
-                       typedef std::map< std::string, wxPanel* > ItemsMap;
-
-                       public:
+               public:
                        // ----------------------------------------------------------------------------------
                        /*! @fn ButtonContainerSettings( );
                         *      @brief This is the default constructor.
                         */
-                       ButtonContainerSettings( );
+                       ButtonContainerSettings();
                        // ----------------------------------------------------------------------------------
                        /*! @fn virtual ~ButtonContainerSettings( );
                         *      @brief This is the destructor.
                         */
                        virtual
-                       ~ButtonContainerSettings( );
-                       
+                       ~ButtonContainerSettings();
+
                        // ----------------------------------------------------------------------------------
                        /*! @fn ButtonGroupMap GetButtonGroupContainer( );
                         *      @brief This method returns ButtonGroupMap with all buttons.
                         * @return
                         */
                        ButtonGroupMap
-                       GetButtonGroupContainer( );
+                       GetButtonGroupContainer();
                        // ----------------------------------------------------------------------------------
                        /*! @fn KeyMapList GetGroupNameList( );
                         *      @brief This method returns a KeyMapsList with the name of the groups.
                         * @return
                         */
                        KeyMapList
-                       GetGroupNameList( );
+                       GetGroupNameList();
                        // ----------------------------------------------------------------------------------
                        /*! @fn PanelButton GetPanelButton( const std::string &buttonName );
                         *      @brief This method returns the panel of a button.
@@ -163,7 +170,7 @@ namespace creaPanelButtonContainer
                         *      @return
                         */
                        PanelButton
-                       GetPanelButton( const std::string &buttonName );
+                       GetPanelButton(const std::string &buttonName);
                        // ----------------------------------------------------------------------------------
                        /*! @fn ButtonGroupSettings* GetButtonGroupSettings( TFunctor* functor );
                         *      @brief this method return the settings the generic settings for creaButtonContainer.
@@ -172,32 +179,22 @@ namespace creaPanelButtonContainer
                         * @return
                         */
                        ButtonGroupSettings*
-                       GetButtonGroupSettings( TFunctor* functor );
+                       GetButtonGroupSettings(TFunctor* functor);
                        // ----------------------------------------------------------------------------------
                        /*! @fn void SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
                         *      @brief This method sets the button group container.
                         * @param bGroupContainer
                         */
-
                        // ----------------------------------------------------------------------------------
-
-                       ButtonGroupSettings*
-                       GetListGroupSettings();
-
-                       // ----------------------------------------------------------------------------------
-
-
-
                        void
-                       SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
+                       SetButtonGroupContainer(ButtonGroupMap bGroupContainer);
                        // ----------------------------------------------------------------------------------
                        /*! @fn void SetGroupNameList( KeyMapList gNameList );
                         *      @brief this method sets the groupName list
                         * @param gNameList
                         */
                        void
-                       SetGroupNameList( KeyMapList gNameList );
-                       
+                       SetGroupNameList(KeyMapList gNameList);
                        // ----------------------------------------------------------------------------------
                        /*! @fn void AddButton( const std::string &groupName, const std::string &buttonName,
                         const std::string &iconpath, const std::string &buttonDescription,
@@ -211,10 +208,9 @@ namespace creaPanelButtonContainer
                         * @exception std::bad_alloc
                         */
                        void
-                       AddButton( const std::string &groupName, const std::string &buttonName,
-                           const wxBitmap &icon, const std::string &buttonDescription,
-                           PanelButton panel );
-                       
+                       AddButton(const std::string &groupName, const std::string &buttonName,
+                                       const wxBitmap &icon, const std::string &buttonDescription,
+                                       PanelButton panel);
                        // ----------------------------------------------------------------------------------
                        /*! @fn void AddButton( BCPSettingsStruct* info );
                         * @brief This method adds a new button into a group of buttons.
@@ -222,34 +218,52 @@ namespace creaPanelButtonContainer
                         * @exception std::bad_alloc
                         */
                        void
-                       AddButton( BCPSettingsStruct* info );
-                       
+                       AddButton(BCPSettingsStruct* info);
                        // ----------------------------------------------------------------------------------
-                       /*! @fn void AddButtons( BCStructVectorType infoList );
-                        * @brief This method adds new buttons into the container.
+                       /*! @fn void InitModel( BCStructVectorType infoList, int type );
+                        * @brief This method adds new buttons or items into the container (Depends type).
                         * @param infoList The BCStructVectorType
+                        * @param type If 1:Buttons 2:List 3:Configurable List
                         * @exception std::bad_alloc
                         */
                        void
-                       AddButtons( BCStructVectorType infoList, int type );
-
+                       InitModel(BCStructVectorType infoList, int type);
+                       // ----------------------------------------------------------------------------------
+                       //MLER
+                       /*! @fn void AddItems( BCPSettingsStruct* info );
+                        * @brief This method adds a new item into a list.
+                        * @param info The pointer to BCPSettingsStruct.
+                        * @exception std::bad_alloc
+                        */
                        void
                        AddItems(BCPSettingsStruct* info);
-
-                       ItemsMap
-                       GetItemsMap();
-
-                       PanelButton
-                       GetPanelList( const StringType &buttonName );
-
-
+                       // ----------------------------------------------------------------------------------
+                       /*! @fn PanelButton GetPanelList( const std::string &buttonName );
+                        *      @brief This method returns the panel of a list.
+                        *      @param buttonName (item element)
+                        *      @exception std::bad_alloc
+                        *      @return
+                        */
+                       ItemsVector
+                       GetItemsVector();
+                       // ----------------------------------------------------------------------------------
+                       /*! @fn PanelButton GetPanelList( const std::string &buttonName );
+                        *      @brief This method returns the panel of a list.
+                        *      @param buttonName (item element)
+                        *      @exception std::bad_alloc
+                        *      @return
+                        */
+                       wxPanel*
+                       GetPanelList(const StringType &buttonName);
+                       //MLER
                        // ----------------------------------------------------------------------------------
                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.
 
                        //MLER
-                       ItemsMap m_itemsMap; //This is the map with the name and the wPanel
-               };
-}//ecapseman
+                       ItemsVector m_ItemsVector; //!<This is the vector containing a pair of each item name and its wxPanel.
+
+       };
+} //ecapseman
 #endif /* BUTTONCONTAINERSETTINGS_H_ */