]> Creatis software - creaMaracasVisu.git/commitdiff
creaButtonContainer: Updates in documentation, adding try catch clauses and cleaning...
authorDiego Caceres <Diego.Caceres@creatis.insa-lyon.fr>
Thu, 19 May 2011 07:43:10 +0000 (07:43 +0000)
committerDiego Caceres <Diego.Caceres@creatis.insa-lyon.fr>
Thu, 19 May 2011 07:43:10 +0000 (07:43 +0000)
14 files changed:
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/controller/buttonContainerController.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/functor.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/functor.txx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/system.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonGroup.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonGroup.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/groupManager.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/groupManager.h

index ecbf950d05cbfb2d2f6731bc98a33577ee104114..175093062ccc60bfd9690dcfb95e68b1c1b7f282 100644 (file)
@@ -58,13 +58,13 @@ namespace creaButtonContainer
                                                        & ButtonContainerController::ButtonEvent );
                                        }//rof
                                }//rof
-                       }
+                       }//yrt
                        catch ( std::exception& e )
                        {
                                std::cerr
                                    << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
                                    << e.what( ) << std::endl;
-                       }
+                       }//hctac
                }
                // ----------------------------------------------------------------------------------
                void
@@ -79,41 +79,43 @@ namespace creaButtonContainer
                                        this->m_BCPanel->m_GroupManagerList[ id ]->GetButton( )->SetLabel(
                                            _( "-" ) );
                                        this->m_BCPanel->m_GroupManagerList[ id ]->HideSubPanel( false );
-                               }
+                               }//fi
                                else if ( this->m_BCPanel->m_GroupManagerList[ id ]->GetButton( )->GetLabel( ).Cmp(
                                    _( "-" ) ) == 0 )
                                {
                                        this->m_BCPanel->m_GroupManagerList[ id ]->GetButton( )->SetLabel(
                                            _( "+" ) );
                                        this->m_BCPanel->m_GroupManagerList[ id ]->HideSubPanel( true );
-                               }
+                               }//fi esle
                                this->m_BCPanel->FitSizer( );
-                       }
+                       }//yrt
                        catch ( std::exception& e )
                        {
                                std::cerr << "ButtonContainerController::AddEvents( ) exception: "
                                    << e.what( ) << std::endl;
-                       }
+                       }//hctac
                }
                // ----------------------------------------------------------------------------------
                void
                ButtonContainerController::ButtonEvent( wxCommandEvent& event )
                {
-                       for( ButtonGroupList::iterator it =
-                           this->m_BCPanel->m_ButtonGroupList.begin( ); it
-                           != this->m_BCPanel->m_ButtonGroupList.end( ); ++it )
+                       try
                        {
-                               try
+                               for( ButtonGroupList::iterator it =
+                                   this->m_BCPanel->m_ButtonGroupList.begin( ); it
+                                   != this->m_BCPanel->m_ButtonGroupList.end( ); ++it )
                                {
+
                                        ( *it )->GetButton( event.GetId( ) )->Execute( );
-                               }
-                               catch ( std::exception& e )
-                               {
-                                       std::cerr
-                                           << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
-                                           << e.what( ) << std::endl;
-                               }
-                       }
+
+                               }//rof
+                       }//yrt
+                       catch ( std::exception& e )
+                       {
+                               std::cerr
+                                   << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
+                                   << e.what( ) << std::endl;
+                       }//hctac
                }
        // ----------------------------------------------------------------------------------
        }//ecapsename
index 7acc0d9a4700a9af19fb78ade28be1d2059f535d..eda556b8096b410295705ddbd7debcaaf44886eb 100644 (file)
@@ -2,7 +2,7 @@
  * Name:      @file buttonGroupFactory.cxx
  * Purpose:   @brief This contains the ButtonGroupFactory class implementation
  * Author:    @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified:  2011-05-17
+ * Modified:  2011-05-18
  * Copyright:
  * License:
  ***************************************************************************************/
@@ -35,21 +35,24 @@ namespace creaButtonContainer
                                ButtonGroupMap map = settings->GetButtonGroupContainer( );
                                for( ButtonGroupMap::iterator it = map.begin( ); it != map.end( ); ++it )
                                {
+                                       //using wxWidgets.
                                        wxString groupNameAux( ( *it ).first.c_str( ), wxConvUTF8 );
                                        wxStaticText* wxGroupName = new wxStaticText( parent, -1,
                                            groupNameAux, wxDefaultPosition, wxDefaultSize, 0,
                                            _T( "GroupText" ) );
+                                       //creating a wxButtonGroup.
                                        ButtonGroup* group = new ButtonGroup( wxGroupName,
                                            this->GetButtons( parent, ( *it ).second ) );
+                                       //adding the group to the container.
                                        groupView.push_back( group );
-                               }
-                       }
+                               }//rof
+                       }//yrt
                        catch ( std::exception& e )
                        {
                                std::cerr
                                    << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
                                    << e.what( ) << std::endl;
-                       }
+                       }//chtac
                        return ( groupView );
                }
                // ----------------------------------------------------------------------------------
@@ -66,13 +69,13 @@ namespace creaButtonContainer
                                        buttonList[ id ] = new Button( parent, id, *it );
                                }
                                return ( buttonList );
-                       }
+                       }//yrt
                        catch ( std::exception& e )
                        {
                                std::cerr
                                    << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
                                    << e.what( ) << std::endl;
-                       }
+                       }//chtac
                }
        // ----------------------------------------------------------------------------------
        }//ecapseman
index 61609108ec49e8fa87286dc1068a1df743915e8d..cb29a68992c9f285de3fb5d19aafdaa0d3f86347 100644 (file)
@@ -38,8 +38,6 @@ namespace creaButtonContainer
        //!     @namespace <model>
        namespace model
        {
-               //! @class ButtonGroupFactory
-               //! @brief This class is the factory of a group of wxButtons.
 
                /*! @class ButtonGroupFactory buttonGroupFactory.h "buttonGroupFactory.h"
                 *      @brief This class contains the ButtonContainer factory.
index 7a7da4057690a5ce0dba613a1f793d67f81cdb73..fc1219691ac7fb5998f5fbb230c1723d9e100162 100644 (file)
@@ -1,51 +1,55 @@
-/***************************************************************
- * Name:      ButtonGroupSettings.cxx
- * 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/)
+/************************************************************************************//*!
+ * Name:      @file buttonContainerController.cxx
+ * Purpose:   @brief This contains the ButtonContainerController class implementation
+ * Author:    @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * Modified:  2011-05-18
+ * Copyright:
  * License:
- **************************************************************/
+ ***************************************************************************************/
+
+//! @include "containerSettings.h"
 #include "containerSettings.h"
 
+//!    @namespace<creaButtonContainer>
 namespace creaButtonContainer
 {
+       //!     @namespace<model>
        namespace model
        {
-
+               // ----------------------------------------------------------------------------------
                ContainerSettings::ContainerSettings( )
                {
                }
-
+               // ----------------------------------------------------------------------------------
                ContainerSettings::~ContainerSettings( )
                {
                }
-
+               // ----------------------------------------------------------------------------------
                ButtonGroupMap
                ContainerSettings::GetButtonGroupContainer( )
                {
-                       return m_ButtonGroupContainer;
+                       return this->m_ButtonGroupContainer;
                }
-
+               // ----------------------------------------------------------------------------------
                KeyMapList
                ContainerSettings::GetGroupNameList( )
                {
-                       return m_GroupNameList;
+                       return this->m_GroupNameList;
                }
-
+               // ----------------------------------------------------------------------------------
                void
                ContainerSettings::SetButtonGroupContainer(
-                   ButtonGroupMap m_ButtonGroupContainer )
+                   ButtonGroupMap bgContainer )
                {
-                       this->m_ButtonGroupContainer = m_ButtonGroupContainer;
+                       this->m_ButtonGroupContainer = bgContainer;
                }
-
+               // ----------------------------------------------------------------------------------
                void
-               ContainerSettings::SetGroupNameList( KeyMapList m_GroupNameList )
+               ContainerSettings::SetGroupNameList( KeyMapList gNameList )
                {
-                       this->m_GroupNameList = m_GroupNameList;
+                       this->m_GroupNameList = gNameList;
                }
-
+               // ----------------------------------------------------------------------------------
                void
                ContainerSettings::AddButton( const std::string & groupName,
                    const std::string buttonName, const std::string iconpath,
@@ -53,18 +57,30 @@ namespace creaButtonContainer
                {
                        ButtonPair* pair = new ButtonPair(
                            new ButtonInfo( buttonName, iconpath ),
-                           new ActionButton( buttonDescription, event ) );
-                       for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
-                           != this->m_GroupNameList.end( ); ++it )
-                               if ( ( *it ).compare( groupName ) == 0 )
+                           new ButtonAction( buttonDescription, event ) );
+                       try
+                       {
+                               for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
+                                   != this->m_GroupNameList.end( ); ++it )
                                {
-                                       this->m_ButtonGroupContainer[ groupName ].push_back( pair );
-                                       return;
-                               }//fi
-                       //rof
-                       this->m_GroupNameList.push_back( groupName );
-                       this->m_ButtonGroupContainer[ groupName ].push_back( pair );
+                                       if ( ( *it ).compare( groupName ) == 0 )
+                                       {
+                                               this->m_ButtonGroupContainer[ groupName ].push_back( pair );
+                                               return;
+                                       }//fi
+                               }//rof
+                               this->m_GroupNameList.push_back( groupName );
+                               this->m_ButtonGroupContainer[ groupName ].push_back( pair );
+                       }//yrt
+                       catch ( 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
                }
-
-       }
-}
+       // ----------------------------------------------------------------------------------
+       }//ecapseman
+}//ecapseman
index 6d10f7a1c7db94b43f4d014245c0bdaaa12912fe..d0680e77a1db91ded83b92ff1b687bf70c11ee8b 100644 (file)
-/***************************************************************
+/************************************************************************************//*!
  * Name:      @file containerSettings.h
- * Purpose:   @brief This contains ContainerSettings class
+ * Purpose:   @brief This contains the ContainerSettings class
  * Author:    @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified:  2011-05-09
- * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
+ * Modified:  2011-05-18
+ * Copyright:
  * License:
- **************************************************************/
+ ***************************************************************************************/
 
 #ifndef BUTTONGROUPSETTINGS_H_
 #define BUTTONGROUPSETTINGS_H_
 
+//! @include <list>
 #include <list>
+//! @include <map>
 #include <map>
+//! @include <iostream>
 #include <iostream>
+//! @include "system.h"
 #include "system.h"
-
+//! @include "functor"
 #include "functor.h"
 
-///@namespace <creaButtonContainer>
+//!    @namespace <creaButtonContainer>
 namespace creaButtonContainer
 {
-       ///@namespace <model>
+       //!     @namespace <model>
        namespace model
        {
-               /*!
-                * @class ContainerSettings
-                * @brief This class contains all information of groups and its buttons
+               /*! @class ContainerSettings containerSettings.h "containerSettings.h"
+                *      @brief This class contains the settings of the button container.
+                *  This class describes how to add new buttons to the container.
                 */
                class ContainerSettings
                {
                        public:
-                               /*!
-                                * @brief This is the default constructor
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn void ContainerSettings::ContainerSettings( )
+                                *      @brief This is the constructor.
                                 */
                                ContainerSettings( );
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn ContainerSettings::~ContainerSettings( )
+                                *      @brief This is the destructor.
+                                */
                                virtual
                                ~ContainerSettings( );
-                               /*!
-                                * @brief This function allows to create the ButtonGroupContainer.
-                                * @param the wxWindow* parent to be attached.
-                                * @param The Container settings.
-                                * @return The wx button group container.
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn ButtonGroupMap ContainerSettings::GetButtonGroupContainer( )
+                                *      @brief This function returns a container of buttons ordered by group.
+                                *      @return ButtonGroupMap A container with buttons
                                 */
                                ButtonGroupMap
                                GetButtonGroupContainer( );
-                               /*!
-                                * @brief This function allows to create the ButtonGroupContainer.
-                                * @param the wxWindow* parent to be attached.
-                                * @param The Container settings.
-                                * @return The wx button group container.
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
+                                *      @brief This function returns a container with the name of the groups.
+                                *      @return KeyMapList A list with the name of the button groups.
                                 */
                                KeyMapList
                                GetGroupNameList( );
-                               /*!
-                                * @brief This function allows to create the ButtonGroupContainer.
-                                * @param the wxWindow* parent to be attached.
-                                * @param The Container settings.
-                                * @return The wx button group container.
+                               // ----------------------------------------------------------------------------------
+                               /*! void ContainerSettings::SetButtonGroupContainer( ButtonGroupMap m_ButtonGroupContainer )
+                                *      @brief This function allows to create the ButtonGroupContainer.
+                                *      @param bgContainer The ButtonGroupMap with all buttons.
                                 */
                                void
-                               SetButtonGroupContainer( ButtonGroupMap m_ButtonGroupContainer );
-                               /*!
-                                * @brief This function allows to create the ButtonGroupContainer.
-                                * @param the wxWindow* parent to be attached.
-                                * @param The Container settings.
-                                * @return The wx button group container.
+                               SetButtonGroupContainer( ButtonGroupMap bgContainer );
+                               // ----------------------------------------------------------------------------------
+                               /*! void ContainerSettings::SetGroupNameList( KeyMapList gNameList )
+                                * @brief This function sets a container with the name of the groups.
+                                * @param gNameList the KeyMapList with all groupNames.
                                 */
                                void
-                               SetGroupNameList( KeyMapList m_GroupNameList );
+                               SetGroupNameList( KeyMapList gNameList );
+                               // ----------------------------------------------------------------------------------
                                /*!
-                                * @brief This function allows to create the ButtonGroupContainer.
-                                * @param the wxWindow* parent to be attached.
-                                * @param The Container settings.
-                                * @return The wx button group container.
+                                * @fn ContainerSettings::AddButton( const std::string & groupName, const std::string buttonName,
+                                const std::string iconpath, const std::string buttonDescription,
+                                FunctionEventType event )
+                                * @brief This function adds a new button to the container.
+                                * @param groupName The name of the group of buttons.
+                                * @param buttonName The ID of the button.
+                                * @param iconpath The path of the button icon.
+                                * @param buttonDescription The description of the button.
+                                * @param event The event associated to the button.
+                                * @see class Functor, ConcreteFunctor for add an event for a button.
+                                * @exception std::bad_alloc
                                 */
                                void
                                AddButton( const std::string & groupName, const std::string buttonName,
                                    const std::string iconpath, const std::string buttonDescription,
                                    FunctionEventType event );
+                               // ----------------------------------------------------------------------------------
 
                        private:
-                               ButtonGroupMap m_ButtonGroupContainer;
-                               KeyMapList m_GroupNameList;
+                               ButtonGroupMap m_ButtonGroupContainer; //! <std::map< std::string, ButtonList > View pointer.
+                               KeyMapList m_GroupNameList; //! <ButtonContainerPanel View pointer.
                };
        }
 }
index 3ec8df4281ff572ba4234ba743a4155373295dfc..82137738b149ddc1370af261d0dcca4cc1c48f95 100644 (file)
-/***************************************************************
- * Name:      TFunctor
- * Purpose:   Call_Back Functions
- * Author:    Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified:  2011-05-09
- * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
+/************************************************************************************//*!
+ * Name:      @file functor.h
+ * Purpose:   @brief defines TFunctor class
+ * Author:    @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * Modified:  2011-05-18
+ * Copyright:
  * License:
- **************************************************************/
+ ***************************************************************************************/
 
 #ifndef TFUNCTOR_H_
 #define TFUNCTOR_H_
 
+//! @include <string>
 #include <string>
 
+//!    @namespace <creaButtonContainer>
 namespace creaButtonContainer
 {
+       //!     @namespace <model>
        namespace model
        {
+               /*!     @typedef std::string ButtonIDType;
+                *      @brief Defines the ButtonIDType type.
+                */
                typedef std::string ButtonIDType;
-               // abstract base class
+
+               /*! @class TFunctor functor.h "functor.h"
+                *      @brief This is an abstract class for call_back functions.
+                */
                class TFunctor
                {
                        public:
                                // two possible functions to call member function. virtual cause derived
                                // classes will use a pointer to an object and a pointer to a member function
-                               // to make the function call
+                               /*! @fn virtual void TFunctor::operator()( const ButtonIDType &buttonName )
+                                *      @brief  To make the function call.
+                                *      Call_Back function.
+                                *      @param buttonName
+                                */
                                virtual void
                                operator()( const ButtonIDType &buttonName )=0; // call using operator
+                               /*! @fn
+                                *  @brief Call using function.
+                                *  Call_Back function.
+                                *      @param buttonName
+                                */
                                virtual void
                                Call( const ButtonIDType &buttonName )=0;
-                               // call using function
                };
 
                // derived template class
+               /*! @tparam <typename TClass>
+                *      @brief It makes TConcreteFunctor usable for all Classes.
+                */
                template< typename TClass >
+                       /*! @class TConcreteFunctor: public TFunctor  functor.h "functor.h"
+                        *      @brief This class contains the ButtonContainer factory.
+                        *  This class describes the factory of the ButtonContainer using design patterns.
+                        */
                        class TConcreteFunctor : public TFunctor
                        {
                                public:
-                                       // constructor - takes pointer to an object and pointer to a member and stores
-                                       // them in two private variables
+                                       /*! @fn TConcreteFunctor::TConcreteFunctor( TClass* _pt2Object, void
+                                        (TClass::*_fpt)( const ButtonIDType &buttonName ) );
+                                        *      @brief This is the parameterized constructor.
+                                        *      Takes pointer to an object and pointer to a member and stores them in two private variables
+                                        *      @param _pt2Object Pointer to object.
+                                        *      @param _fpt Pointer to the function.
+                                        *      @param buttonName The ID of the button (ButtonName).
+                                        */
                                        TConcreteFunctor( TClass* _pt2Object, void
                                        (TClass::*_fpt)( const ButtonIDType &buttonName ) );
-                                       // override operator "()" // execute member function
+                                       // -------------------------------------------------------------------------------
+                                       /*! @fn virtual void TConcreteFunctor::operator()( const ButtonIDType &buttonName );
+                                        *      @brief Override operator "()". Execute member function.
+                                        *      @see TFunctor
+                                        *      @param buttonName
+                                        */
                                        virtual void
                                        operator()( const ButtonIDType &buttonName );
-                                       // override function "Call" // execute member function
+                                       // -------------------------------------------------------------------------------
+                                       /*! @fn virtual void TConcreteFunctor::Call( const ButtonIDType &buttonName );
+                                        *      @brief Override function "Call". Execute member function
+                                        *      @see TFunctor
+                                        *      @param buttonName
+                                        */
                                        virtual void
                                        Call( const ButtonIDType &buttonName );
+                                       // -------------------------------------------------------------------------------
                                private:
-                                       void
-                                       (TClass::*fpt)( const ButtonIDType &buttonName );
-                                       // pointer to member function
-                                       TClass* pt2Object;
-                                       // pointer to object
+                                       void (TClass::*fpt)( const ButtonIDType &buttonName ); //! <void (TClass::*fpt) Pointer to member function.
+                                       TClass* pt2Object; //! <TClass* pointer to object.
                        };
 
        }//ecapseman
 }//ecapseman
 
+//! @include "functor.txx"
 #include "functor.txx"
 
 #endif /* TFUNCTOR_H_ */
index 7445586c554a448cba0ade9e5eb0bfbfb01c0833..42e660bfcc67e7f187db8c743eefc462f0e2a195 100644 (file)
@@ -1,11 +1,11 @@
-/***************************************************************
- * Name:      TFunctor
- * Purpose:   Call_Back Functions
- * Author:    Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified:  2011-05-09
- * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
+/************************************************************************************//*!
+ * Name:      @file functor.cxx
+ * Purpose:   @brief implements TFunctor class and it propose is Call_Back Functions
+ * Author:    @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * Modified:  2011-05-18
+ * Copyright:
  * License:
- **************************************************************/
+ ***************************************************************************************/
 
 namespace creaButtonContainer
 {
@@ -13,13 +13,15 @@ namespace creaButtonContainer
        {
                // constructor - takes pointer to an object and pointer to a member and stores
                // them in two private variables
+               // -------------------------------------------------------------------------------
                template< typename TClass >
                        TConcreteFunctor< TClass >::TConcreteFunctor( TClass* _pt2Object, void
                        (TClass::*_fpt)( const ButtonIDType &buttonName ) )
                        {
-                               pt2Object = _pt2Object;
-                               fpt = _fpt;
+                               this->pt2Object = _pt2Object;
+                               this->fpt = _fpt;
                        }
+               // -------------------------------------------------------------------------------
                // override operator "()" // execute member functions
                template< typename TClass >
                        void
@@ -27,6 +29,7 @@ namespace creaButtonContainer
                        {
                                ( *pt2Object.*fpt )( buttonName );
                        }
+               // -------------------------------------------------------------------------------
                // override function "Call" // execute member function
                template< typename TClass >
                        void
index 55beaf4b9cf8ddeda96cb9147971a3d0a8de8115..13367bdbcde777e0a4da4d1d3d88ae01852d6f65 100644 (file)
@@ -1,32 +1,65 @@
-/***************************************************************
- * Name:      TFunctor
- * Purpose:   Call_Back Functions
- * Author:    Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified:  2011-05-09
- * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
+/************************************************************************************//*!
+ * Name:      @file system.h
+ * Purpose:   @brief contains a system typedefs used to reuse code.
+ * Author:    @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * Modified:  2011-05-18
+ * Copyright:
  * License:
- **************************************************************/
+ ***************************************************************************************/
 
 #ifndef SYSTEM_H_
 #define SYSTEM_H_
 
+//! @include <list>
 #include <list>
+//! @include <map>
 #include <map>
+//! @include <iostream>
 #include <iostream>
+//! @include "functor.h"
 #include "functor.h"
 
 ///@namespace <creaButtonContainer>
 namespace creaButtonContainer
 {
-               typedef model::TFunctor* FunctionEventType;
-               //First is the button description, Second FunctionEventType
-               typedef std::pair< std::string, FunctionEventType > 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 model::TFunctor* FunctionEventType;
+        *      @brief Defines the FunctionEventType type.
+        *
+        */
+       typedef model::TFunctor* FunctionEventType;
+       // ----------------------------------------------------------------------------------
+       /*!     @typedef creaButtonContainer::view::Button Button;
+        *      @brief Defines the ActionButton type.
+        *      First is the button description, Second FunctionEventType
+        */
+       typedef std::pair< std::string, FunctionEventType > ButtonAction;
+       // ----------------------------------------------------------------------------------
+       /*!     @typedef std::pair< std::string, std::string > ButtonInfo;
+        *      @brief Defines the ButtonInfo type.
+        *      First is the ButtonName and Second is the IconPath
+        */
+       typedef std::pair< std::string, std::string > ButtonInfo;
+       // ----------------------------------------------------------------------------------
+       /*!     @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
+        *      @brief Defines the ButtonPair type.
+        */
+       typedef std::pair< ButtonInfo*, ButtonAction* > ButtonPair;
+       // ----------------------------------------------------------------------------------
+       /*!     @typedef std::list< std::string > KeyMapList;
+        *      @brief Defines the KeyMapList type.
+        */
+       typedef std::list< std::string > KeyMapList;
+       // ----------------------------------------------------------------------------------
+       /*!     @typedef std::list< ButtonPair* > ButtonList;
+        *      @brief Defines the ButtonList type.
+        */
+       typedef std::list< ButtonPair* > ButtonList;
+       // ----------------------------------------------------------------------------------
+       /*!     @typedef std::map< std::string, ButtonList > ButtonGroupMap;
+        *      @brief Defines the ButtonGroupMap type.
+        */
+       typedef std::map< std::string, ButtonList > ButtonGroupMap;
+// ----------------------------------------------------------------------------------
 }
 
 #endif /* SYSTEM_H_ */
index d936a53ba097cbbb74e8970124ec62cfcdf03ebb..15ad6fc3120d593d539054ec2fb206ecad1ae48c 100644 (file)
@@ -7,14 +7,16 @@
  * License:
  **************************************************************/
 
+//! @include "button.h"
 #include "button.h"
-#include <iostream>
 
+//!    @namespace <creaButtonContainer>
 namespace creaButtonContainer
 {
+       //!     @namespace <view>
        namespace view
        {
-               //--------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                Button::Button( wxWindow* parent, long id, ButtonPair* pair )
                {
                        this->m_ButtonPair = pair;
@@ -24,43 +26,45 @@ namespace creaButtonContainer
                        wxString buttonName( wXbuttonName.c_str( ), wxConvUTF8 );
                        wxString imageIcon( wXiconPath.c_str( ), wxConvUTF8 );
                        wxString description( wXdescription.c_str( ), wxConvUTF8 );
+                       //creating the button.
                        this->Create( parent, id,
                            wxBitmap( wxImage( imageIcon, wxBITMAP_TYPE_ANY, -1 ) ),
                            wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator,
                            buttonName );
                        this->SetToolTip( description );
                }
-               //--------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                Button::~Button( )
                {
                }
-               //--------------------------------------------------------------------
-               //--------------------------------------------------------------------
-               string
+               // ----------------------------------------------------------------------------------
+               std::string
                Button::GetButtonName( )
                {
-                       return( this->m_ButtonPair->first->first );
+                       return ( this->m_ButtonPair->first->first );
                }
-               //--------------------------------------------------------------------
-               string
+               // ----------------------------------------------------------------------------------
+               std::string
                Button::GetIconPath( )
                {
-                       return( this->m_ButtonPair->first->second );
+                       return ( this->m_ButtonPair->first->second );
                }
-               //--------------------------------------------------------------------
-               string
+               // ----------------------------------------------------------------------------------
+               std::string
                Button::GetDescription( )
                {
-                       return( this->m_ButtonPair->second->first );
+                       return ( this->m_ButtonPair->second->first );
                }
-               //--------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                void
                Button::Execute( )
                {
-                       std::cout << "ButtonAction: "<< this->m_ButtonPair->first->first <<std::endl;
-                       TFunctor* vTable[] = {this->m_ButtonPair->second->second};
-                       vTable[0]->Call( this->m_ButtonPair->first->first );
+                       std::cout << "ButtonAction: " << this->m_ButtonPair->first->first
+                           << std::endl;
+                       TFunctor* vTable[ ] =
+                       { this->m_ButtonPair->second->second };
+                       vTable[ 0 ]->Call( this->m_ButtonPair->first->first );
                }
-
+       // ----------------------------------------------------------------------------------
        }//ecapseman
 }//ecapseman
index 4ef2af960736a75e37088b138657859a56acc3c2..ea30b2024bf45340c1eb49faa4fb4a4db41e0f31 100644 (file)
@@ -1,56 +1,98 @@
-/***************************************************************
- * Name:      Button.h
- * Purpose:   Defines a Button
- * Author:    Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified:  2011-05-09
- * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
+/************************************************************************************//*!
+ * Name:      @file button.h
+ * Purpose:   @brief This contains the Button class
+ * Author:    @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * Modified:  2011-05-18
+ * Copyright:
  * License:
- **************************************************************/
+ ***************************************************************************************/
 
 #ifndef BUTTON_H
 #define BUTTON_H
 
+//! @include <wx/bmpbuttn.h>
 #include <wx/bmpbuttn.h>
+//! @include <<wx/image.h>
 #include <wx/image.h>
+//! @include <wx/string.h>
 #include <wx/string.h>
+//! @include <string>
 #include <string>
+//! @include <iostream>
+#include <iostream>
+//! @include "functor.h"
 #include "functor.h"
+//! @include "system.h"
 #include "system.h"
 
-using std::string;
-
+//!    @namespace <creaButtonContainer>
 namespace creaButtonContainer
 {
+       //!     @namespace <view>
        namespace view
        {
-               /**
-                Class Description: This class defines a wxBitmapButton.
-                **/
-                       class Button : public wxBitmapButton
-                       {
-                               public:
-                                       //Typedef definition
-                                       typedef creaButtonContainer::model::TFunctor TFunctor;
-                               public:
-                                       //--------------------------------------------------------------------
-                                       Button( wxWindow* parent, long id, ButtonPair* pair );
-                                       virtual
-                                       ~Button( );
-                                       //--------------------------------------------------------------------
-                                       long
-                                       GetID( );
-                                       string
-                                       GetButtonName( );
-                                       string
-                                       GetIconPath( );
-                                       string
-                                       GetDescription( );
-                                       //--------------------------------------------------------------------
-                                       void
-                                       Execute( );
-                               private:
-                                       ButtonPair* m_ButtonPair;
-                       };
+               /*! @class ContainerSettings containerSettings.h "containerSettings.h"
+                *      @brief This class contains the settings of the button container.
+                *  This class describes how to add new buttons to the container.
+                */
+               class Button : public wxBitmapButton
+               {
+                       public:
+                               /*!     @typedef creaButtonContainer::model::ContainerSettings ButtonGroupModel;
+                                *      @brief Defines the ButtonGroupModel type.
+                                */
+                               typedef creaButtonContainer::model::TFunctor TFunctor;
+                       public:
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn void ContainerSettings::ContainerSettings( )
+                                *      @brief This is the constructor.
+                                */
+                               Button( wxWindow* parent, long id, ButtonPair* pair );
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn void ContainerSettings::ContainerSettings( )
+                                *      @brief This is the constructor.
+                                */
+                               virtual
+                               ~Button( );
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
+                                *      @brief This function returns a container with the name of the groups.
+                                *      @return KeyMapList A list with the name of the button groups.
+                                */
+                               long
+                               GetID( );
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
+                                *      @brief This function returns a container with the name of the groups.
+                                *      @return long A list with the name of the button groups.
+                                */
+                               std::string
+                               GetButtonName( );
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
+                                *      @brief This function returns a container with the name of the groups.
+                                *      @return std::string A list with the name of the button groups.
+                                */
+                               std::string
+                               GetIconPath( );
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
+                                *      @brief This function returns a container with the name of the groups.
+                                *      @return std::string A list with the name of the button groups.
+                                */
+                               std::string
+                               GetDescription( );
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
+                                *      @brief This function returns a container with the name of the groups.
+                                *      @return std::string A list with the name of the button groups.
+                                */
+                               void
+                               Execute( );
+                               // ----------------------------------------------------------------------------------
+                       private:
+                               ButtonPair* m_ButtonPair; //! <ButtonPair* ButtonPail pointer.
+               };
        }//ecapseman
 }//ecapseman
 
index 945107f8b56dd4787413bfd964cbb43541a7e12a..e21ec1329287215e01633f3a34f4e418c9394dec 100644 (file)
@@ -26,7 +26,7 @@ namespace creaButtonContainer
                {
                }
                //--------------------------------------------------
-               ButtonContainer
+               ButtonGroup::ButtonContainer
                ButtonGroup::GetButtonContainer( )
                {
                        return ( this->m_Buttons );
@@ -38,7 +38,7 @@ namespace creaButtonContainer
                        return ( this->m_GroupName );
                }
                //--------------------------------------------------
-               IdButtonContainer
+               ButtonGroup::IdButtonContainer
                ButtonGroup::GetButtonIdContainer( )
                {
                        IdButtonContainer idContainer;
index 920dfd260c997c763b178566ed485531aae8aa41..74ec0f8aa33bd19beabe21f10f7bfd4139201141 100644 (file)
@@ -21,16 +21,16 @@ namespace creaButtonContainer
 {
        namespace view
        {
-               //Typedef definition
-               typedef creaButtonContainer::view::Button Button;
-               typedef std::map< long, Button* > ButtonContainer;
-               typedef std::list< long > IdButtonContainer;
-
                /**
                 Class Description: This class defines a ButtonGroup.
                 **/
                class ButtonGroup
                {
+                       public:
+                               //Typedef definition
+                               typedef creaButtonContainer::view::Button Button;
+                               typedef std::map< long, Button* > ButtonContainer;
+                               typedef std::list< long > IdButtonContainer;
                        public:
                                ButtonGroup( wxStaticText* groupName, ButtonContainer buttons );
                                virtual
index 3708bb0777619d182150f7f577ebdd7d26df9a24..34de644f0358034887b1681a905e25c0c5a16b00 100644 (file)
@@ -37,7 +37,7 @@ namespace creaButtonContainer
                        return ( this->m_IDExpButton );
                }
                // -------------------------------------------------------------------
-               ExpansionButton*
+               GroupManager::ExpansionButton*
                GroupManager::GetButton( )
                {
                        return ( this->m_ExpansionButton );
index 562da7ae0b82346f6f8b6f0f11f54c92a38cd92c..3358cf3d46bae3fa3f02ca58886f31d46c743c46 100644 (file)
@@ -22,13 +22,14 @@ namespace creaButtonContainer
 {
        namespace view
        {
-               typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
-               typedef wxButton ExpansionButton;
                /**
                 Class Description:
                 **/
                class GroupManager : public wxFlexGridSizer
                {
+                       public:
+                               typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
+                               typedef wxButton ExpansionButton;
                        public:
                                GroupManager( wxWindow* parent, ButtonGroup* buttonGroup );
                                virtual