X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FcreaPanelButtonContainer%2FbuttonContainerSettings.h;h=3d71e1a85b13e6195a9f48236df4a79806e909c0;hb=3c6c4d236dd41550927d9180688f40c127301431;hp=e568683caf874eadf01905c80899f70c4be37a3b;hpb=e7d20ba9cf53e6da12e5118a7d616248ea48f168;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h index e568683..3d71e1a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h @@ -1,68 +1,254 @@ -/*************************************************************** - * Name: buttonContainerSettings.h - * Purpose: It is the ButtonGroupSettings - * Author: Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr) - * Modified: 2011-05-09 - * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/) - * License: - **************************************************************/ +/*# --------------------------------------------------------------------- + # + # 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 + * @brief This contains the ButtonContainerSettings class. + * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr) + * @date 2011-06-02 + */ #ifndef BUTTONCONTAINERSETTINGS_H_ #define BUTTONCONTAINERSETTINGS_H_ +#include +#include +#include + #include #include -#include +#include +#include -#include "structButtonContainerSettings.h" +#include "structBCPSettings.h" #include "containerSettings.h" #include "functor.h" +/*! @namespace + * @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu. + */ namespace creaPanelButtonContainer { - typedef creaButtonContainer::model::TFunctor TFunctor; - typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings; - typedef wxPanel* PanelButton; - //First is the button description, Second FunctionEventType - typedef std::pair< std::string, PanelButton > ActionButton; - //First is the ButtonName and Second is the ImageIconPath - typedef std::pair< std::string, std::string > ButtonInfo; - typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair; - typedef std::list< std::string > KeyMapList; - typedef std::list< ButtonPair* > ButtonList; - typedef std::map< std::string, ButtonList > ButtonGroupMap; - typedef std::list< BCSettingsStruct* > BCSetListType; + /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h" + * @brief This class contains the settings of the buttons. + */ class ButtonContainerSettings { public: - ButtonContainerSettings( ); + //typedef definition. + // ---------------------------------------------------------------------------------- + /*! @typedef std::string* StringType; + * @brief Defines the StringType type. + */ + typedef std::string StringType; + // ---------------------------------------------------------------------------------- + /*! typedef creaButtonContainer::model::TFunctor TFunctor; + * @brief Defines the TFunctor type. + */ + typedef creaButtonContainer::model::TFunctor TFunctor; + // ---------------------------------------------------------------------------------- + /*! @typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings; + * @brief Defines the ButtonGroupSettings type. + */ + typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings; + // ---------------------------------------------------------------------------------- + /*! @typedef wxPanel* PanelButton; + * @brief Defines the PanelButton type. + */ + typedef wxPanel* PanelButton; + // ---------------------------------------------------------------------------------- + /*! @typedef std::pair< std::string, PanelButton > ActionButton; + * @brief Defines the ActionButton type. + * First is the button name, Second FunctionEventType + */ + typedef std::pair ActionButton; + + // ---------------------------------------------------------------------------------- + /*! @typedef std::pair< std::string, wxBitmap > ButtonInfo; + * @brief Defines the ButtonInfo type. + * First is the ButtonName, Second is the ImageIcon + */ + typedef std::pair ButtonInfo; + + // ---------------------------------------------------------------------------------- + /*! @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair; + * @brief Defines the ButtonPair type. + */ + typedef std::pair ButtonPair; + // ---------------------------------------------------------------------------------- + /*! @typedef std::list< std::string > KeyMapList; + * @brief Defines the KeyMapList type. + */ + typedef std::list KeyMapList; + + // ---------------------------------------------------------------------------------- + /*! @typedef std::list< ButtonPair* > ButtonList; + * @brief Defines the ButtonList type. + */ + typedef std::list ButtonList; + + // ---------------------------------------------------------------------------------- + /*! @typedef std::map< std::string, ButtonList > ButtonGroupMap; + * @brief Defines the ButtonGroupMap type. + */ + typedef std::map ButtonGroupMap; + // ---------------------------------------------------------------------------------- + /*! @typedef std::vector< BCPSettingsStruct* > BCStructVectorType; + * @brief Defines the BCStructVectorType type. + */ + typedef std::vector BCStructVectorType; + //end typedef definition + + //MLER + typedef std::pair ListAction; + typedef std::vector ItemsVector; + //MLER + + // ---------------------------------------------------------------------------------- + + public: + // ---------------------------------------------------------------------------------- + /*! @fn ButtonContainerSettings( ); + * @brief This is the default constructor. + */ + 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. + * @param buttonName + * @exception std::bad_alloc + * @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. + * @param functor The function to be called in the action button. + * @exception std::bad_alloc + * @return + */ + ButtonGroupSettings* + GetButtonGroupSettings(TFunctor* functor); + // ---------------------------------------------------------------------------------- + /*! @fn void SetButtonGroupContainer( ButtonGroupMap bGroupContainer ); + * @brief This method sets the button group container. + * @param bGroupContainer + */ + + // ---------------------------------------------------------------------------------- ButtonGroupSettings* - GetButtonGroupSettings( TFunctor* functor ); + GetListGroupSettings(); + + // ---------------------------------------------------------------------------------- + void - SetButtonGroupContainer( ButtonGroupMap m_ButtonGroupContainer ); + SetButtonGroupContainer(ButtonGroupMap bGroupContainer); + // ---------------------------------------------------------------------------------- + /*! @fn void SetGroupNameList( KeyMapList gNameList ); + * @brief this method sets the groupName list + * @param gNameList + */ void - SetGroupNameList( KeyMapList m_GroupNameList ); + SetGroupNameList(KeyMapList gNameList); + + // ---------------------------------------------------------------------------------- + /*! @fn void AddButton( const std::string &groupName, const std::string &buttonName, + const std::string &iconpath, const std::string &buttonDescription, + PanelButton panel ); + * @brief This method adds a new button into a group of buttons. + * @param groupName The button groupName + * @param buttonName The buttonName + * @param iconpath The path of the icon + * @param buttonDescription The button tooltip + * @param panel The panel to be called when the button is clicked + * @exception std::bad_alloc + */ void - AddButton( const std::string &groupName, const std::string &buttonName, - const std::string &iconpath, 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. + * @param info The pointer to BCPSettingsStruct. + * @exception std::bad_alloc + */ void - AddButton( BCSettingsStruct* info ); + AddButton(BCPSettingsStruct* info); + // ---------------------------------------------------------------------------------- + /*! @fn void AddButtons( BCStructVectorType infoList ); + * @brief This method adds new buttons into the container. + * @param infoList The BCStructVectorType + * @exception std::bad_alloc + */ + void + InitModel(BCStructVectorType infoList, int type); + // ---------------------------------------------------------------------------------- + //MLER void - AddButtons( BCSetListType infoList ); + AddItems(BCPSettingsStruct* info); + // ---------------------------------------------------------------------------------- + ItemsVector + GetItemsVector(); + + wxPanel* + GetPanelList(const StringType &buttonName); + //MLER + // ---------------------------------------------------------------------------------- private: - ButtonGroupMap m_ButtonGroupContainer; - KeyMapList m_GroupNameList; + ButtonGroupMap m_ButtonGroupContainer; //!