]> Creatis software - creaMaracasVisu.git/commitdiff
creaButtonContainer: new structure to make easy the button settings
authorDiego Caceres <Diego.Caceres@creatis.insa-lyon.fr>
Mon, 23 May 2011 23:58:03 +0000 (23:58 +0000)
committerDiego Caceres <Diego.Caceres@creatis.insa-lyon.fr>
Mon, 23 May 2011 23:58:03 +0000 (23:58 +0000)
creaButtonContainer & creaPanelButtonContainer doxygen documentation 99%
some changes in the boxes (not big)
the two libraries are ready to be usables :)
There are 1 bug to solve!! (wxScrolledWindow)
Good job!!! :) :) :)  :D :D :D

29 files changed:
bbtk/src/bbcreaMaracasVisuPanelButtonContainer.h
bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.cxx
bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/controller/buttonContainerController.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/controller/buttonContainerController.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/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/structBCSettings.h [new file with mode: 0755]
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/system.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonGroup.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonGroup.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/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 [new file with mode: 0755]
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/structButtonContainerSettings.h [deleted file]

index 1534987cf929170a72056fec9a5638b145edd1a0..ac0c96867ba80cf7728a3f436455c7c877a30ab9 100644 (file)
@@ -6,15 +6,16 @@
 #define __bbcreaMaracasVisuPanelButtonContainer_h_INCLUDED__
 #include "bbcreaMaracasVisu_EXPORT.h"
 #include "bbtkWxBlackBox.h"
-#include <structButtonContainerSettings.h>
+#include <structBCPSettings.h>
 #include <buttonContainerSettings.h>
 #include <creaPanelButtonContainer.h>
 
 namespace bbcreaMaracasVisu
 {
+       typedef creaPanelButtonContainer::BCPSettingsStruct BCPSettingsStruct;
        typedef creaPanelButtonContainer::ButtonContainerSettings ButtonContainerSettings;
        typedef creaPanelButtonContainer::PanelButtonContainer PBContainer;
-       typedef std::vector< BCSettingsStruct* > BCStructVectorType;
+       typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
 class bbcreaMaracasVisu_EXPORT PanelButtonContainer
  : 
    public bbtk::WxBlackBox
index 749867325d6345442893c4d204cddd5c2b6a9e0f..1911c214eca725f045091e866f3867d5e3e081fd 100644 (file)
@@ -66,7 +66,7 @@ PanelButtonContainerSettings::bbUserSetDefaultValues( )
 void
 PanelButtonContainerSettings::bbUserInitializeProcessing( )
 {
-       this->m_BSettings = new BCSettingsStruct();
+       this->m_BSettings = new BCPSettingsStruct();
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
index 9db1bd99d16f87e970a98be86003cddac75ee137..af9f02a325942b7407e75a7b519f7e65ec16693c 100644 (file)
 #include <string>
 #include <vector>
 
-#include <structButtonContainerSettings.h>
+#include <structBCPSettings.h>
 
 namespace bbcreaMaracasVisu
 {
-       typedef std::vector< BCSettingsStruct* > BCStructVectorType;
+       typedef creaPanelButtonContainer::BCPSettingsStruct BCPSettingsStruct;
+       typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
        class bbcreaMaracasVisu_EXPORT PanelButtonContainerSettings :
          public bbtk::WxBlackBox
        {
@@ -38,7 +39,7 @@ namespace bbcreaMaracasVisu
                        CreateWidget( wxWindow* );
 
                private:
-                       BCSettingsStruct* m_BSettings;
+                       BCPSettingsStruct* m_BSettings;
                        BCStructVectorType m_BCSettingsVector;
                        wxPanel* myPanel;
                        //=====
index 83560a44846f5ae530259fc5c317d9d05f3a154c..bb28d530ea03bef373e3a83959eb561b139e1f56 100644 (file)
@@ -2,7 +2,7 @@
  * @file buttonContainerController.cxx
  * @brief This contains the ButtonContainerController class implementation
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #include "buttonContainerController.h"
@@ -53,8 +53,7 @@ namespace creaButtonContainer
                        }//yrt
                        catch ( std::exception& e )
                        {
-                               std::cerr
-                                   << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
+                               std::cerr << "ButtonContainerController::AddEvents( ) exception: "
                                    << e.what( ) << std::endl;
                        }//hctac
                }
@@ -65,6 +64,7 @@ namespace creaButtonContainer
                        long id = event.GetId( );
                        try
                        {
+                               //changing the button label when its clicked and then hide the buttons of the group.
                                if ( this->m_BCPanel->m_GroupManagerList[ id ]->GetButton( )->GetLabel( ).Cmp(
                                    _( "+" ) ) == 0 )
                                {
@@ -83,7 +83,8 @@ namespace creaButtonContainer
                        }//yrt
                        catch ( std::exception& e )
                        {
-                               std::cerr << "ButtonContainerController::AddEvents( ) exception: "
+                               std::cerr
+                                   << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
                                    << e.what( ) << std::endl;
                        }//hctac
                }
@@ -97,15 +98,13 @@ namespace creaButtonContainer
                                    this->m_BCPanel->m_ButtonGroupList.begin( ); it
                                    != this->m_BCPanel->m_ButtonGroupList.end( ); ++it )
                                {
-
                                        ( *it )->GetButton( event.GetId( ) )->Execute( );
-
                                }//rof
                        }//yrt
                        catch ( std::exception& e )
                        {
                                std::cerr
-                                   << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
+                                   << "ButtonContainerController::ButtonEvent( wxCommandEvent& event ) exception: "
                                    << e.what( ) << std::endl;
                        }//hctac
                }
index 3ca492aa40ae9296dcb2e4e1d5258818fbb2c6d2..2ccadcc86d9977515446ae241f71a0c18ccca88e 100644 (file)
@@ -2,7 +2,7 @@
  * @file buttonContainerController.h
  * @brief This contains the ButtonContainerController class
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #ifndef BUTTONCONTAINERCONTROLLER_H_
@@ -25,7 +25,7 @@ namespace creaButtonContainer
        namespace view
        {
                //Predefinition of ButtonContainerPanel FriendClass!!
-               /*! @class ButtonContainerPanel : public wxScrolledWindow buttonContainerPanel.h "buttonContainerPanel.h"
+               /*! @class ButtonContainerPanel buttonContainerPanel.h "buttonContainerPanel.h"
                 *  @brief This class is the container of the creaButtonContainer.
                 *  @details This class derives from wxScrolledWindow and manages the view of the buttonContainer.
                 *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxscrolledwindow.html">wxScrolledWindow</a>
@@ -105,14 +105,14 @@ namespace creaButtonContainer
 
                                // ----------------------------------------------------------------------------------
                                /*! @fn void AddEvents( );
-                                *      @brief This function connect every buttonEvent to the view.
+                                *      @brief This method connect every buttonEvent to the view.
                                 *      @exception std::bad_alloc
                                 */
                                void
                                AddEvents( );
                                // ----------------------------------------------------------------------------------
                                /*! @fn void ButtonExpEvent( wxCommandEvent& event );
-                                *      @brief This function is the button group "+" "-" event.
+                                *      @brief This method is the button group "+" "-" event.
                                 *      @exception std::bad_alloc
                                 *      @param event Button action event.
                                 */
@@ -120,7 +120,7 @@ namespace creaButtonContainer
                                ButtonExpEvent( wxCommandEvent& event );
                                // ----------------------------------------------------------------------------------
                                /*! @fn void ButtonEvent( wxCommandEvent& event );
-                                *      @brief This function calls the events of the buttonContainer buttons
+                                *      @brief This method calls the events of the buttonContainer buttons
                                 *      @exception std::bad_alloc
                                 *      @param event Button action event.
                                 */
index 62287f3a42e5dc7c5ca7bf9feed24e1c0501dfce..167bade8e9e6cb42b281695037e7a3b7f37b6831 100644 (file)
@@ -2,7 +2,7 @@
  * @file buttonGroupFactory.cxx
  * @brief Implements the ButtonGroupFactory class.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #include "buttonGroupFactory.h"
@@ -45,8 +45,8 @@ namespace creaButtonContainer
                        catch ( std::exception& e )
                        {
                                std::cerr
-                                   << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
-                                   << e.what( ) << std::endl;
+                                   << "ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent,   ButtonGroupModel* settings )"
+                                   << " exception: " << e.what( ) << std::endl;
                        }//chtac
                        return ( groupView );
                }
@@ -68,8 +68,8 @@ namespace creaButtonContainer
                        catch ( std::exception& e )
                        {
                                std::cerr
-                                   << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
-                                   << e.what( ) << std::endl;
+                                   << "ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel )"
+                                   << "exception: " << e.what( ) << std::endl;
                        }//chtac
                }
        // ----------------------------------------------------------------------------------
index e9825bb1cc05493680c078d18a59b99c58368b96..b12cfb5edcbfa7554b8253b88ea94dc5dd1b8dd8 100644 (file)
@@ -2,7 +2,7 @@
  * @file buttonGroupFactory.h
  * @brief Contains ButtonGroupFactory class
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #ifndef BUTTONGROUPFACTORY_H
@@ -31,7 +31,6 @@ namespace creaButtonContainer
         */
        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.
@@ -79,7 +78,7 @@ namespace creaButtonContainer
                                virtual
                                ~ButtonGroupFactory( );
                                /*! @fn ButtonGroupContainer ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent, ButtonGroupModel* settings );
-                                * @brief This function allows to create the ButtonGroupContainer.
+                                * @brief This method allows to create the ButtonGroupContainer.
                                 * @param parent the wxWindow* parent to be attached.
                                 * @param settings The Container settings.
                                 * @exception std::bad_alloc
@@ -90,7 +89,7 @@ namespace creaButtonContainer
                                    ButtonGroupModel* settings );
                        private:
                                /*! @fn ButtonContainer ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel );
-                                * @brief  This function allows to create a wx button container for a group.
+                                * @brief  This method allows to create 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
index 188d0890677b6fd9cc39eaa2b35c4e70489b3d1e..10e387a71764ddccdbbf33386295331da857c81e 100644 (file)
@@ -2,7 +2,7 @@
  * @file containerSettings.cxx
  * @brief Implements the ContainerSettings class.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #include "containerSettings.h"
@@ -49,11 +49,11 @@ namespace creaButtonContainer
                    const std::string buttonName, const std::string iconpath,
                    const std::string buttonDescription, FunctionEventType event )
                {
-                       ButtonPair* pair = new ButtonPair(
-                           new ButtonInfo( buttonName, iconpath ),
-                           new ButtonAction( buttonDescription, event ) );
                        try
                        {
+                               ButtonPair* pair = new ButtonPair(
+                                   new ButtonInfo( buttonName, iconpath ),
+                                   new ButtonAction( buttonDescription, event ) );
                                for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
                                    != this->m_GroupNameList.end( ); ++it )
                                {
@@ -75,6 +75,53 @@ namespace creaButtonContainer
                                    << e.what( ) << std::endl;
                        }//hctac
                }
+               // ----------------------------------------------------------------------------------
+               void
+               ContainerSettings::AddButton( BCSettingsStruct* info )
+               {
+                       try
+                       {
+                               ButtonPair* pair = new ButtonPair(
+                                   new ButtonInfo( info->buttonName, info->iconpath ),
+                                   new ButtonAction( info->buttonDescription, info->eventFunction ) );
+                               for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
+                                   != this->m_GroupNameList.end( ); ++it )
+                               {
+                                       if ( ( *it ).compare( info->groupName ) == 0 )
+                                       {
+                                               this->m_ButtonGroupContainer[ info->groupName ].push_back( pair );
+                                               return;
+                                       }//fi
+                               }//rof
+                               this->m_GroupNameList.push_back( info->groupName );
+                               this->m_ButtonGroupContainer[ info->groupName ].push_back( pair );
+                       }//yrt
+                       catch ( std::exception& e )
+                       {
+                               std::cerr
+                                   << "void ContainerSettings::AddButton( BCSettingsStruct* info ) "
+                                   << "exception: " << e.what( ) << std::endl;
+                       }//hctac
+               }
+               // ----------------------------------------------------------------------------------
+               void
+               ContainerSettings::AddButtons( BCStructVectorType infoList )
+               {
+                       try
+                       {
+                               for( BCStructVectorType::iterator it = infoList.begin( ); it
+                                   != infoList.end( ); ++it )
+                               {
+                                       this->AddButton( *it );
+                               }//rof
+                       }//yrt
+                       catch ( std::exception& e )
+                       {
+                               std::cerr
+                                   << "ContainerSettings::AddButtons( BCStructVectorType infoList ) "
+                                   << "exception: " << e.what( ) << std::endl;
+                       }//hctac
+               }
        // ----------------------------------------------------------------------------------
        }//ecapseman
 }//ecapseman
index 4e259b02239b5e57c41f299ae43219893e0e822c..7a84073a14b563757e8685d014e7ab9401df151a 100644 (file)
@@ -2,7 +2,7 @@
  * @file containerSettings.h
  * @brief Contains the ContainerSettings class
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #ifndef BUTTONGROUPSETTINGS_H_
@@ -10,7 +10,9 @@
 
 #include <list>
 #include <map>
+#include <vector>
 #include <iostream>
+#include "structBCSettings.h"
 #include "system.h"
 #include "functor.h"
 
@@ -30,6 +32,20 @@ namespace creaButtonContainer
                 */
                class ContainerSettings
                {
+                       public:
+                               //typedef definition
+                               // ----------------------------------------------------------------------------------
+                               /*!     @typedef creaButtonContainer::model::BCSettingsStruct BCSettingsStruct;
+                                *      @brief Defines the BCSettingsStruct type.
+                                */
+                               typedef creaButtonContainer::model::BCSettingsStruct BCSettingsStruct;
+                               // ----------------------------------------------------------------------------------
+                               /*!     @typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
+                                *      @brief Defines the BCStructVectorType type.
+                                */
+                               typedef std::vector< BCSettingsStruct* > BCStructVectorType;
+                               // ----------------------------------------------------------------------------------
+                               //end of typedef definition
                        public:
                                // ----------------------------------------------------------------------------------
                                /*! @fn ContainerSettings::ContainerSettings( )
@@ -44,28 +60,28 @@ namespace creaButtonContainer
                                ~ContainerSettings( );
                                // ----------------------------------------------------------------------------------
                                /*! @fn ButtonGroupMap ContainerSettings::GetButtonGroupContainer( )
-                                *      @brief This function returns a container of buttons ordered by group.
+                                *      @brief This method returns a container of buttons ordered by group.
                                 *      @return ButtonGroupMap A container with buttons
                                 */
                                ButtonGroupMap
                                GetButtonGroupContainer( );
                                // ----------------------------------------------------------------------------------
                                /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
-                                *      @brief This function returns a container with the name of the groups.
+                                *      @brief This method returns a container with the name of the groups.
                                 *      @return KeyMapList A list with the name of the button groups.
                                 */
                                KeyMapList
                                GetGroupNameList( );
                                // ----------------------------------------------------------------------------------
                                /*! void ContainerSettings::SetButtonGroupContainer( ButtonGroupMap m_ButtonGroupContainer )
-                                *      @brief This function allows to create the ButtonGroupContainer.
+                                *      @brief This method allows to create the ButtonGroupContainer.
                                 *      @param bgContainer The ButtonGroupMap with all buttons.
                                 */
                                void
                                SetButtonGroupContainer( ButtonGroupMap bgContainer );
                                // ----------------------------------------------------------------------------------
                                /*! void ContainerSettings::SetGroupNameList( KeyMapList gNameList )
-                                * @brief This function sets a container with the name of the groups.
+                                * @brief This method sets a container with the name of the groups.
                                 * @param gNameList the KeyMapList with all groupNames.
                                 */
                                void
@@ -75,7 +91,7 @@ namespace creaButtonContainer
                                 * @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.
+                                * @brief This method 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.
@@ -89,7 +105,22 @@ namespace creaButtonContainer
                                    const std::string iconpath, const std::string buttonDescription,
                                    FunctionEventType event );
                                // ----------------------------------------------------------------------------------
-
+                               /*! @fn void AddButton( BCSettingsStruct* info );
+                                *      @brief This method adds a new button to the container.
+                                *      @exception std::bad_alloc
+                                *      @param info
+                                */
+                               void
+                               AddButton( BCSettingsStruct* info );
+                               // ----------------------------------------------------------------------------------
+                               /*! @fn void AddButtons( BCStructVectorType infoList );
+                                *      @brief This method adds new buttons to the container.
+                                *      @exception std::bad_alloc
+                                *      @param infoList
+                                */
+                               void
+                               AddButtons( BCStructVectorType infoList );
+                               // ----------------------------------------------------------------------------------
                        private:
                                ButtonGroupMap m_ButtonGroupContainer; //! <std::map< std::string, ButtonList > View pointer.
                                KeyMapList m_GroupNameList; //! <ButtonContainerPanel View pointer.
index aab0713ca54c02238b051e67a4a640c88408d716..f895a8204e54af9d93f3f06871950f27e921d032 100644 (file)
@@ -2,7 +2,7 @@
  * @file functor.h
  * @brief Defines TFunctor class
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #ifndef TFUNCTOR_H_
@@ -77,6 +77,7 @@ namespace creaButtonContainer
                                         *      @brief Override operator "()". Execute member function.
                                         *      @see TFunctor
                                         *      @param buttonName
+                                        *      @exception std::bad_alloc
                                         */
                                        virtual void
                                        operator()( const ButtonIDType &buttonName );
@@ -85,6 +86,7 @@ namespace creaButtonContainer
                                         *      @brief Override function "Call". Execute member function
                                         *      @see TFunctor
                                         *      @param buttonName
+                                        *      @exception std::bad_alloc
                                         */
                                        virtual void
                                        Call( const ButtonIDType &buttonName );
index f4c812147cc05a948ec82ed12951c92be4409923..2c761358f1f489622e617ddfb68765097791eca5 100644 (file)
@@ -2,39 +2,55 @@
  * @file functor.cxx
  * @brief Implements TFunctor class and it propose is Call_Back Functions
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
 */
 
 namespace creaButtonContainer
 {
-       namespace model
-       {
-               // 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 ) )
-                       {
-                               this->pt2Object = _pt2Object;
-                               this->fpt = _fpt;
-                       }
-               // -------------------------------------------------------------------------------
-               // override operator "()" // execute member functions
-               template< typename TClass >
-                       void
-                       TConcreteFunctor< TClass >::operator()( const ButtonIDType &buttonName )
-                       {
-                               ( *pt2Object.*fpt )( buttonName );
-                       }
-               // -------------------------------------------------------------------------------
-               // override function "Call" // execute member function
-               template< typename TClass >
-                       void
-                       TConcreteFunctor< TClass >::Call( const ButtonIDType &buttonName )
-                       {
-                               ( *pt2Object.*fpt )( buttonName );
-                       }
-       }//ecapseman
+  namespace model
+  {
+         // 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 ) )
+         {
+                 this->pt2Object = _pt2Object;
+                 this->fpt = _fpt;
+         }
+         // -------------------------------------------------------------------------------
+         // override operator "()" // execute member functions
+         template< typename TClass >
+         void
+         TConcreteFunctor< TClass >::operator()( const ButtonIDType &buttonName )
+         {
+           try
+           {
+                 ( *pt2Object.*fpt )( buttonName );
+           }//yrt
+           catch ( std::exception& e )
+           {
+                 std::cerr<< "TConcreteFunctor< TClass >::operator()( const ButtonIDType &buttonName )"
+                                 <<" exception: " << e.what( ) << std::endl;
+           }//hctac
+         }
+         // -------------------------------------------------------------------------------
+         // override function "Call" // execute member function
+         template< typename TClass >
+         void
+         TConcreteFunctor< TClass >::Call( const ButtonIDType &buttonName )
+         {
+           try
+           {
+                 ( *pt2Object.*fpt )( buttonName );
+           }//yrt
+           catch ( std::exception& e )
+           {
+                 std::cerr<< "TConcreteFunctor< TClass >::Call( const ButtonIDType &buttonName )"
+                                 <<" exception: " << e.what( ) << std::endl;
+           }//hctac
+         }
+  }//ecapseman
 }//ecapseman
 
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/structBCSettings.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/structBCSettings.h
new file mode 100755 (executable)
index 0000000..b78bdec
--- /dev/null
@@ -0,0 +1,38 @@
+/*!
+ * @file structBCSettings.h
+ * @brief Contains BCSettingsStruct structure.
+ * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * @date  2011-05-24
+ */
+
+#ifndef STRUCTBCSETTINGS_H_
+#define STRUCTBCSETTINGS_H_
+
+#include <string>
+#include "system.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
+       {
+               /*! @struct <BCSettingsStruct> structBCSettings.h "structBCSettings.h"
+                *      @brief This is the Button Container Settings structure.
+                */
+               struct BCSettingsStruct
+               {
+                               std::string groupName; //! <The name of the group of buttons.
+                               std::string buttonName; //! <The name of the button.
+                               std::string iconpath; //! <The iconPath of the button.
+                               std::string buttonDescription; //! <The description of the button.
+                               FunctionEventType eventFunction; //! <The event associated to the button.
+               };
+       } //ecapseman
+} //ecapseman
+#endif //STRUCTBCSETTINGS_H_
index 6aea190265aa194dbbbb645aeeec8bc9b2924f48..e0601fc98b3758e57f873ed3efa8ca9e5b65f7bc 100644 (file)
@@ -2,7 +2,7 @@
  * @file system.h
  * @brief Contains a system typedefs used to reuse code.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
 */
 
 #ifndef SYSTEM_H_
index 8f65b0310315dc882548ffe7cd5f6aaa5a03cc3b..d45f9c21fac05bad7b4a6b44107c3169c31ddb7f 100644 (file)
@@ -2,7 +2,7 @@
  * @file button.cxx
  * @brief Implements the Button class implementation.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #include "button.h"
@@ -54,11 +54,18 @@ namespace creaButtonContainer
                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 );
+                       try
+                       {
+                               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 );
+                       }//yrt
+                       catch ( std::exception& e )
+                       {
+                               std::cerr << "Button::Execute( ) exception: " << e.what( ) << std::endl;
+                       }//hctac
                }
        // ----------------------------------------------------------------------------------
        }//ecapseman
index 0bcf6ae7841b95b4447505bd084789b98f7af64c..71662a200a1fa78c30e3b82404cc165975143940 100644 (file)
@@ -2,7 +2,7 @@
  * @file button.h
  * @brief Contains the Button class.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #ifndef BUTTON_H
@@ -27,9 +27,9 @@ namespace creaButtonContainer
         */
        namespace view
        {
-               /*! @class Button : public wxBitmapButton button.h "button.h"
+               /*! @class Button button.h "button.h"
                 *      @brief This class contains the Button in the view perspective.
-                *  @details This class contains the information of a button, it derives from wxBitmapButton
+                *  @details This class contains the information of a button, it derives from wxBitmapButton.
                 *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxbitmapbutton.html">wxBitmapButton</a>
                 */
                class Button : public wxBitmapButton
@@ -58,37 +58,38 @@ namespace creaButtonContainer
                                ~Button( );
                                // ----------------------------------------------------------------------------------
                                /*! @fn long Button::GetID( );
-                                *      @brief This function gets the wxID of the button.
+                                *      @brief This method gets the wxID of the button.
                                 *      @return long wxID of the button.
                                 */
                                long
                                GetID( );
                                // ----------------------------------------------------------------------------------
                                /*! @fn std::string Button::GetButtonName( );
-                                *      @brief This function returns the name of the button.
+                                *      @brief This method returns the name of the button.
                                 *      @return std::string The name of the button.
                                 */
                                std::string
                                GetButtonName( );
                                // ----------------------------------------------------------------------------------
                                /*! @fn std::string Button::GetIconPath( );
-                                *      @brief This function returns the iconPath of the button.
+                                *      @brief This method returns the iconPath of the button.
                                 *      @return std::string The path of the icon.
                                 */
                                std::string
                                GetIconPath( );
                                // ----------------------------------------------------------------------------------
                                /*! @fn std::string Button::GetDescription( );
-                                *      @brief This function returns a the description of the button.
+                                *      @brief This method returns a the description of the button.
                                 *      @return std::string The tooltip of the button.
                                 */
                                std::string
                                GetDescription( );
                                // ----------------------------------------------------------------------------------
                                /*! @fn void Button::Execute( );
-                                *      @brief This function executes the Functor (Call_Back Function).
+                                *      @brief This method executes the Functor (Call_Back Function).
                                 *      This is the event of the button that it was defined to be called remotely using
                                 *      call_back functions. In this project it was implemented using Functors.
+                                *      @exception std::bad_alloc
                                 *      @see TFunctor
                                 */
                                void
index eb7acca31a09473489a8b1108409ffecba0edc71..7aad096a42810495ffb4822687b2e121e9758e51 100644 (file)
@@ -2,7 +2,7 @@
  * @file buttonGroup.cxx
  * @brief Implements the ButtonGroup class.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #include "buttonContainerPanel.h"
@@ -11,6 +11,7 @@ namespace creaButtonContainer
 {
        namespace view
        {
+               // ----------------------------------------------------------------------------------
                ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent,
                    ButtonGroupSettings* settings ) :
                            wxScrolledWindow(
@@ -25,47 +26,54 @@ namespace creaButtonContainer
                        this->SetGroupContainer(
                            factory.CreateButtonGroupContainer( this, settings ) );
                        this->PanelInit( );
-                       this->m_ButtonCController = new BCController(this);
-                       this->m_ButtonCController->AddEvents();
+                       this->m_ButtonCController = new BCController( this );
+                       this->m_ButtonCController->AddEvents( );
                        this->SetEventHandler( this->m_ButtonCController );
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                ButtonContainerPanel::~ButtonContainerPanel( )
                {
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                void
                ButtonContainerPanel::SetGroupContainer( ButtonGroupList groupContainer )
                {
                        this->m_ButtonGroupList = groupContainer;
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                void
                ButtonContainerPanel::PanelInit( )
                {
-                       this->m_Sizer = new Sizer( 0, 1, 0, 0 );
-                       for( ButtonGroupList::iterator it = this->m_ButtonGroupList.begin( ); it
-                           != this->m_ButtonGroupList.end( ); ++it )
+                       try
                        {
-                               GroupManager* manager = new GroupManager( this, *it );
-                               this->m_GroupManagerList[ manager->GetButtonID( ) ] = manager;
-                               this->m_Sizer->Add( manager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
-                               std::cout << "creaButtonContainer: New ButtonGroup Sizer Added"
-                                   << std::endl;
-                       }
-                       this->SetSizer( this->m_Sizer );
-                       this->FitSizer( );
+                               this->m_Sizer = new Sizer( 0, 1, 0, 0 );
+                               for( ButtonGroupList::iterator it = this->m_ButtonGroupList.begin( ); it
+                                   != this->m_ButtonGroupList.end( ); ++it )
+                               {
+                                       GroupManager* manager = new GroupManager( this, *it );
+                                       this->m_GroupManagerList[ manager->GetButtonID( ) ] = manager;
+                                       this->m_Sizer->Add( manager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
+                                       std::cout << "creaButtonContainer: New ButtonGroup Sizer Added"
+                                           << std::endl;
+                               }
+                               this->SetSizer( this->m_Sizer );
+                               this->FitSizer( );
+                       }//yrt
+                       catch ( std::exception& e )
+                       {
+                               std::cerr << "ButtonContainerPanel::PanelInit( ) " << "exception: "
+                                   << e.what( ) << std::endl;
+                       }//hctac
                }
-
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                void
                ButtonContainerPanel::FitSizer( )
                {
                        this->m_Sizer->Fit( this );
-                       this->m_Sizer->FitInside(this);
-                       this->SetScrollRate(20,20);
-                       this->m_Sizer->SetSizeHints(this);
+                       this->m_Sizer->FitInside( this );
+                       this->SetScrollRate( 20, 20 );
+                       this->m_Sizer->SetSizeHints( this );
                }
-
+       // ----------------------------------------------------------------------------------
        }//ecapseman
 }//ecapseman
index c65c693691b5f10212f15abf13188b67eb37c62d..a074b53c38c8bda5cb887a69d725f3fd63e73ed2 100644 (file)
@@ -2,7 +2,7 @@
  * @file buttonContainerController.h
  * @brief This contains the ButtonContainerController class
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #ifndef BUTTONCONTAINERPANEL_H
@@ -46,11 +46,11 @@ namespace creaButtonContainer
         */
        namespace view
        {
-               /*! @class ButtonContainerController buttonContainerController.h "buttonContainerController.h"
-                *      @brief This class contains the ButtonContainerPanel controller.
-                *  @details This class describes the button events, it derives from wxEvtHandler and it is the
-                *  controller in the MVC.
-                *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxscrolledWindow.html">wxScrolledWindow</a>
+               /*! @class ButtonContainerPanel buttonContainerPanel.h "buttonContainerPanel.h"
+                *  @brief This class is the container of the creaButtonContainer.
+                *  @details This class derives from wxScrolledWindow and manages the view of the buttonContainer.
+                *  @bug The scrolled it doesn't work! (to be changed soon)
+                *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxscrolledwindow.html">wxScrolledWindow</a>
                 */
                class ButtonContainerPanel : public wxScrolledWindow
                {
@@ -121,20 +121,21 @@ namespace creaButtonContainer
                                ~ButtonContainerPanel( );
                                // ----------------------------------------------------------------------------------
                                /*! @fn SetGroupContainer( ButtonGroupList groupContainer );
-                                * @brief This function sets the settings to the container.
+                                * @brief This method sets the settings to the container.
                                 * @param groupContainer
                                 */
                                void
                                SetGroupContainer( ButtonGroupList groupContainer );
                                // ----------------------------------------------------------------------------------
                                /*! @fn PanelInit( );
-                                *      This function initializes the panel.
+                                *      This method initializes the panel.
+                                *      @exception std::bad_alloc
                                 */
                                void
                                PanelInit( );
                                // ----------------------------------------------------------------------------------
                                /*! @fn FitSizer( );
-                                * This function fits and organizes the sizer.
+                                * This method fits and organizes the sizer.
                                 */
                                void
                                FitSizer( );
index a242b91d94e890f65ddd3e4d499e9121d6bb4d49..5a0db8b1a5adb71b4841ccc41ac395f117f69f4b 100644 (file)
@@ -2,7 +2,7 @@
  * @file buttonGroup.cxx
  * @brief Implements the ButtonGroup class.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #include "buttonGroup.h"
@@ -11,46 +11,63 @@ namespace creaButtonContainer
 {
        namespace view
        {
-               //--------------------------------------------------
+               // ----------------------------------------------------------------------------------
                ButtonGroup::ButtonGroup( wxStaticText* groupName,
                    ButtonContainer cartoButtons )
                {
                        this->m_GroupName = groupName;
                        this->m_Buttons = cartoButtons;
-
                }
-               //--------------------------------------------------
+               // ----------------------------------------------------------------------------------
                ButtonGroup::~ButtonGroup( )
                {
                }
-               //--------------------------------------------------
+               // ----------------------------------------------------------------------------------
                ButtonGroup::ButtonContainer
                ButtonGroup::GetButtonContainer( )
                {
                        return ( this->m_Buttons );
                }
-               //--------------------------------------------------
+               // ----------------------------------------------------------------------------------
                wxStaticText*
                ButtonGroup::GetGroupName( )
                {
                        return ( this->m_GroupName );
                }
-               //--------------------------------------------------
+               // ----------------------------------------------------------------------------------
                ButtonGroup::IdButtonContainer
                ButtonGroup::GetButtonIdContainer( )
                {
-                       IdButtonContainer idContainer;
-                       for( ButtonContainer::iterator it = this->m_Buttons.begin( ); it
-                           != this->m_Buttons.end( ); ++it )
-                               idContainer.push_back( (*it).first );
-                       return ( idContainer );
+                       try
+                       {
+                               IdButtonContainer idContainer;
+                               for( ButtonContainer::iterator it = this->m_Buttons.begin( ); it
+                                   != this->m_Buttons.end( ); ++it )
+                               {
+                                       idContainer.push_back( ( *it ).first );
+                               }
+                               return ( idContainer );
+                       }//yrt
+                       catch ( std::exception& e )
+                       {
+                               std::cerr << "ButtonGroup::GetButtonIdContainer( )" << "exception: "
+                                   << e.what( ) << std::endl;
+                       }//hctac
                }
-               //--------------------------------------------------
+               // ----------------------------------------------------------------------------------
                Button*
                ButtonGroup::GetButton( long id )
                {
-                       return( this->m_Buttons[id] );
+                       try
+                       {
+                               return ( this->m_Buttons[ id ] );
+                       }//yrt
+                       catch ( std::exception& e )
+                       {
+                               std::cerr << "ButtonGroup::GetButton( long id )" << "exception: "
+                                   << e.what( ) << std::endl;
+                       }//hctac
                }
-
+       // ----------------------------------------------------------------------------------
        }//ecapseman
 }//ecapseman
index fd1c3b80241a48906eab42c2b706dbb1f4265d95..ce064285e47a6bea4a4e51fc9e3452e61b580ca8 100644 (file)
@@ -2,7 +2,7 @@
  * @file buttonGroup.h
  * @brief This contains the ButtonGroup class.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #ifndef BUTTONGROUP_H
@@ -27,8 +27,8 @@ namespace creaButtonContainer
        namespace view
        {
                /*! @class ButtonGroup buttonGroup.h "buttonGroup.h"
-                                *      @brief This class contains the group of buttons.
-                                */
+                *      @brief This class contains the group of buttons.
+                */
                class ButtonGroup
                {
                        public:
@@ -72,6 +72,7 @@ namespace creaButtonContainer
                                // ----------------------------------------------------------------------------------
                                /*! @fn GetButtonContainer( );
                                 * @brief This method returns the button container.
+                                * @exception std::bad_alloc
                                 * @return ButtonContainer.
                                 */
                                ButtonContainer
@@ -79,6 +80,7 @@ namespace creaButtonContainer
                                // ----------------------------------------------------------------------------------
                                /*! @fn GetButtonIdContainer( );
                                 * @brief This method returns a list of button IDs.
+                                * @exception std::bad_alloc
                                 * @return
                                 */
                                IdButtonContainer
index 046164161f975e5891dcf52992e3579f5244876a..d85596953dd3cd4abd5196c3b161dd5032c7ba42 100644 (file)
@@ -2,7 +2,7 @@
  * @file buttonManager.cxx
  * @brief Implements the ButtonManager class.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #include "buttonManager.h"
@@ -11,54 +11,71 @@ namespace creaButtonContainer
 {
        namespace view
        {
-
+               // ----------------------------------------------------------------------------------
                ButtonManager::ButtonManager( ) :
                        wxFlexGridSizer( 0, 1, 0, 0 )
                {
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                ButtonManager::ButtonManager( ButtonGroup* buttonGroup ) :
                        wxFlexGridSizer( 0, 1, 0, 0 )
                {
-                       this->SetGroupName( buttonGroup->GetGroupName( ) );
-                       this->SetButtonManager( buttonGroup->GetButtonContainer( ) );
+                       try
+                       {
+                               this->SetGroupName( buttonGroup->GetGroupName( ) );
+                               this->SetButtonManager( buttonGroup->GetButtonContainer( ) );
+                       }//yrt
+                       catch ( std::exception& e )
+                       {
+                               std::cerr << "Button::Execute( ) exception: " << e.what( ) << std::endl;
+                       }//hctac
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                ButtonManager::~ButtonManager( )
                {
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                void
                ButtonManager::SetGroupName( wxStaticText* groupName )
                {
                        this->m_GroupName = groupName;
                        this->Add( this->m_GroupName, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                void
                ButtonManager::SetButtonManager( ButtonContainer buttonContainer )
                {
-                       if ( this->m_GroupName != NULL )
+                       try
+                       {
+                               if ( this->m_GroupName != NULL )
+                               {
+                                       this->m_GridSizer = new wxGridSizer( 0, 3, 0, 0 );
+                                       for( ButtonContainer::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 );
+                               }
+                       }//yrt
+                       catch ( std::exception& e )
                        {
-                               this->m_GridSizer = new wxGridSizer( 0, 3, 0, 0 );
-                               for( ButtonContainer::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 );
-                       }
+                               std::cerr
+                                   << "ButtonManager::SetButtonManager( ButtonContainer buttonContainer )"
+                                   << "exception: " << e.what( ) << std::endl;
+                       }//hctac
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                void
                ButtonManager::ShowButtonManager( )
                {
                        this->Show( this->m_GridSizer, true, false );
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                void
                ButtonManager::HideButtonManager( )
                {
                        this->Show( this->m_GridSizer, false, false );
                }
+       // ----------------------------------------------------------------------------------
        }//ecapseman
 }//ecapseman
index 8fe99e540419694ded3c36e892b1cd24f60adb82..d08cbdc63e3479fea4b1c607c79b02c782c6f437 100644 (file)
@@ -2,7 +2,7 @@
  * @file buttonManager.h
  * @brief This contains the ButtonManager class.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #ifndef CARTOBUTTONCONTAINER_H
@@ -29,8 +29,7 @@ namespace creaButtonContainer
        {
                /*! @class ButtonManager buttonManager.h "buttonManager.h"
                 *      @brief This class contains the ButtonManager view.
-                *  @details This class describes a wxFlexGridSizer with the button manager, it derives from wxFlexGridSizer and it is the
-                *  controller in the MVC.
+                *  @details This class describes a wxFlexGridSizer with the button manager.
                 *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxflexGridSizer.html">wxFlexGridSizer</a>
                 */
                class ButtonManager : public wxFlexGridSizer
@@ -56,7 +55,8 @@ namespace creaButtonContainer
                        public:
                                // ----------------------------------------------------------------------------------
                                /*! @fn ButtonManager( );
-                                * @brief This is the default construuctor.
+                                * @brief This is the default constructor.
+                                * @exception std::bad_alloc
                                 */
                                ButtonManager( );
                                // ----------------------------------------------------------------------------------
@@ -80,13 +80,14 @@ namespace creaButtonContainer
                                SetGroupName( wxStaticText* groupName );
                                // ----------------------------------------------------------------------------------
                                /*! @fn ShowButtonManager( );
-                                * @brief This function shows the ButtonManager
+                                * @brief This method shows the ButtonManager
                                 */
                                void
                                ShowButtonManager( );
                                // ----------------------------------------------------------------------------------
                                /*! @fn HideButtonManager( );
-                                * @brief This function hides the ButtonManager.
+                                * @brief This method hides the ButtonManager.
+                                * @exception std::bad_alloc
                                 */
                                void
                                HideButtonManager( );
@@ -94,7 +95,7 @@ namespace creaButtonContainer
                        private:
                                // ----------------------------------------------------------------------------------
                                /*! @fn SetButtonManager( ButtonContainer buttonContainer );
-                                * @brief This function set the buttons and it is private.
+                                * @brief This method set the buttons and it is private.
                                 * @param buttonContainer
                                 */
                                void
index 507fc9e81fb725bee1152cc856bc4494fcc26d2b..bdb49d2331d9e7295fb3620fcd97164b8925e8ef 100644 (file)
@@ -2,7 +2,7 @@
  * @file groupManager.cxx
  * @brief Implements the GroupManager class.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #include "groupManager.h"
@@ -11,7 +11,7 @@ namespace creaButtonContainer
 {
        namespace view
        {
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                GroupManager::GroupManager( wxWindow* parent, ButtonGroup* buttonGroup ) :
                        wxFlexGridSizer( 1, 0, 0, 0 )
                {
@@ -23,47 +23,47 @@ namespace creaButtonContainer
                        this->m_ButtonManager = new ButtonManager( buttonGroup );
                        this->Add( this->m_ButtonManager, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                GroupManager::~GroupManager( )
                {
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                long
                GroupManager::GetButtonID( )
                {
                        return ( this->m_IDExpButton );
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                GroupManager::ExpansionButton*
                GroupManager::GetButton( )
                {
                        return ( this->m_ExpansionButton );
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                ButtonManager*
                GroupManager::GetButtonManager( )
                {
                        return ( this->m_ButtonManager );
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                void
                GroupManager::SetButtonID( long id )
                {
                        this->m_IDExpButton = id;
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                void
                GroupManager::SetButton( ExpansionButton* button )
                {
                        this->m_ExpansionButton = button;
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                void
                GroupManager::SetButtonManager( ButtonManager* container )
                {
                        this->m_ButtonManager = container;
                }
-               // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
                void
                GroupManager::HideSubPanel( bool hide )
                {
@@ -72,6 +72,6 @@ namespace creaButtonContainer
                        else
                                this->m_ButtonManager->ShowButtonManager( );
                }
-       // -------------------------------------------------------------------
+               // ----------------------------------------------------------------------------------
        }//ecapseman
 }//ecapseman
index aeb8dfd79c1a6434b245a56b06646bf3b7baf02b..c7d2ca5309cbd336e6b92946a71eaced01c395c5 100644 (file)
@@ -2,7 +2,7 @@
  * @file groupManager.h
  * @brief This contains the GroupManager class
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
  */
 
 #ifndef GROUPMANAGER_H
@@ -29,6 +29,11 @@ namespace creaButtonContainer
         */
        namespace view
        {
+               /*! @class GroupManager groupManager.h "groupManager.h"
+                *      @brief This class contains the GroupManager.
+                *  @details This class describes a wxFlexGridSizer with the group manager.
+                *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxflexGridSizer.html">wxFlexGridSizer</a>
+                */
                class GroupManager : public wxFlexGridSizer
                {
                        public:
index 40701a9e678685155563d53bd59eb501b980efaf..7dcd9a42cc24fb862ee7949874359585bcec92c6 100644 (file)
-/***************************************************************
- * Name:      buttonContainerSettings.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/)
- * License:
- **************************************************************/
+/*!
+ * @file buttonContainerSettings.cxx
+ * @brief Implements the ButtonContainerSettings class.
+ * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * @date  2011-05-24
+ */
+
 #include "buttonContainerSettings.h"
 #include <iostream>
 
 namespace creaPanelButtonContainer
 {
-
+       // ----------------------------------------------------------------------------------
        ButtonContainerSettings::ButtonContainerSettings( )
        {
        }
+       // ----------------------------------------------------------------------------------
        ButtonContainerSettings::~ButtonContainerSettings( )
        {
        }
-       ButtonGroupMap
+       // ----------------------------------------------------------------------------------
+       ButtonContainerSettings::ButtonGroupMap
        ButtonContainerSettings::GetButtonGroupContainer( )
        {
                return m_ButtonGroupContainer;
        }
-
-       KeyMapList
+       // ----------------------------------------------------------------------------------
+       ButtonContainerSettings::KeyMapList
        ButtonContainerSettings::GetGroupNameList( )
        {
                return m_GroupNameList;
        }
-
-       //GetButtonPanel returns the panel asociated to de buttonAction
-       PanelButton
+       // ----------------------------------------------------------------------------------
+       //GetButtonPanel returns the panel associated to the buttonAction
+       ButtonContainerSettings::PanelButton
        ButtonContainerSettings::GetPanelButton( const std::string &buttonName )
        {
-               for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
-                   != this->m_GroupNameList.end( ); ++it )
+               try
                {
-                       ButtonList list = this->m_ButtonGroupContainer[ ( *it ) ];
-                       for( ButtonList::iterator it1 = list.begin( ); it1 != list.end( ); ++it1 )
+                       for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
+                           != this->m_GroupNameList.end( ); ++it )
                        {
-                               if ( ( *it1 )->first->first.compare( buttonName ) == 0 )
+                               ButtonList list = this->m_ButtonGroupContainer[ ( *it ) ];
+                               for( ButtonList::iterator it1 = list.begin( ); it1 != list.end( ); ++it1 )
                                {
-                                       return ( ( *it1 )->second->second );
-                               }//fi
+                                       if ( ( *it1 )->first->first.compare( buttonName ) == 0 )
+                                       {
+                                               return ( ( *it1 )->second->second );
+                                       }//fi
+                               }//rof
                        }//rof
-               }//rof
-               return ( NULL );
+               }//yrt
+               catch ( std::exception& e )
+               {
+                       std::cerr
+                           << "ButtonContainerSettings::GetPanelButton( const std::string &buttonName ) "
+                           << "exception: " << e.what( ) << std::endl;
+                       return ( NULL );
+               }//hctac
        }
-       ButtonGroupSettings*
+       // ----------------------------------------------------------------------------------
+       ButtonContainerSettings::ButtonGroupSettings*
        ButtonContainerSettings::GetButtonGroupSettings( TFunctor* functor )
        {
                ButtonGroupSettings* settings = new ButtonGroupSettings( );
-               for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
-                   != this->m_GroupNameList.end( ); ++it )
+               try
                {
-                       ButtonList list = this->m_ButtonGroupContainer[ ( *it ) ];
-                       for( ButtonList::iterator it1 = list.begin( ); it1 != list.end( ); ++it1 )
+                       for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
+                           != this->m_GroupNameList.end( ); ++it )
                        {
-                               settings->AddButton( ( *it ), ( *it1 )->first->first,
-                                   ( *it1 )->first->second, ( *it1 )->second->first, functor );
+                               ButtonList list = this->m_ButtonGroupContainer[ ( *it ) ];
+                               for( ButtonList::iterator it1 = list.begin( ); it1 != list.end( ); ++it1 )
+                               {
+                                       settings->AddButton( ( *it ), ( *it1 )->first->first,
+                                           ( *it1 )->first->second, ( *it1 )->second->first, functor );
+                               }//rof
                        }//rof
-               }//rof
-               return ( settings );
+                       return ( settings );
+               }//yrt
+               catch ( std::exception& e )
+               {
+                       std::cerr
+                           << "ButtonContainerSettings::GetPanelButton( const std::string &buttonName ) "
+                           << "exception: " << e.what( ) << std::endl;
+                       return ( NULL );
+               }//hctac
        }
+       // ----------------------------------------------------------------------------------
        void
        ButtonContainerSettings::SetButtonGroupContainer(
            ButtonGroupMap m_ButtonGroupContainer )
        {
                this->m_ButtonGroupContainer = m_ButtonGroupContainer;
        }
-
+       // ----------------------------------------------------------------------------------
        void
        ButtonContainerSettings::SetGroupNameList( KeyMapList m_GroupNameList )
        {
                this->m_GroupNameList = m_GroupNameList;
        }
-
+       // ----------------------------------------------------------------------------------
        void
        ButtonContainerSettings::AddButton( const std::string & groupName,
            const std::string &buttonName, const std::string &iconpath,
            const std::string &buttonDescription, PanelButton panel )
        {
-               //builds the button information
-               panel->Show( false );
-               ButtonPair* pair = new ButtonPair( new ButtonInfo( buttonName, iconpath ),
-                   new ActionButton( buttonDescription, panel ) );
-               for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
-                   != this->m_GroupNameList.end( ); ++it )
+               try
                {
-                       if ( ( *it ).compare( groupName ) == 0 )
+                       //builds the button information
+                       panel->Show( false );
+                       ButtonPair* pair = new ButtonPair(
+                           new ButtonInfo( buttonName, iconpath ),
+                           new ActionButton( buttonDescription, panel ) );
+                       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
+                           << "ButtonContainerSettings::AddButton( const std::string & groupName,"
+                           << "const std::string &buttonName, const std::string &iconpath,"
+                           << "const std::string &buttonDescription, PanelButton panel ) "
+                           << "exception: " << e.what( ) << std::endl;
+               }//hctac
        }
-
+       // ----------------------------------------------------------------------------------
        void
-       ButtonContainerSettings::AddButton( BCSettingsStruct* info )
+       ButtonContainerSettings::AddButton( BCPSettingsStruct* info )
        {
-               //builds the button information
-               info->panel->Show( false );
-               ButtonPair* pair = new ButtonPair(
-                   new ButtonInfo( info->buttonName, info->iconpath ),
-                   new ActionButton( info->buttonDescription, info->panel ) );
-               for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
-                   != this->m_GroupNameList.end( ); ++it )
+               try
                {
-                       if ( ( *it ).compare( info->groupName ) == 0 )
+                       //builds the button information
+                       info->panel->Show( false );
+                       ButtonPair* pair = new ButtonPair(
+                           new ButtonInfo( info->buttonName, info->iconpath ),
+                           new ActionButton( info->buttonDescription, info->panel ) );
+                       for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
+                           != this->m_GroupNameList.end( ); ++it )
                        {
-                               this->m_ButtonGroupContainer[ info->groupName ].push_back( pair );
-                               return;
-                       }//fi
-               }//rof
-               this->m_GroupNameList.push_back( info->groupName );
-               this->m_ButtonGroupContainer[ info->groupName ].push_back( pair );
+                               if ( ( *it ).compare( info->groupName ) == 0 )
+                               {
+                                       this->m_ButtonGroupContainer[ info->groupName ].push_back( pair );
+                                       return;
+                               }//fi
+                       }//rof
+                       this->m_GroupNameList.push_back( info->groupName );
+                       this->m_ButtonGroupContainer[ info->groupName ].push_back( pair );
+               }
+               catch ( std::exception& e )
+               {
+                       std::cerr
+                           << "ButtonContainerSettings::AddButton( BCPSettingsStruct* info )"
+                           << "exception: " << e.what( ) << std::endl;
+               }//hctac
        }
-
+       // ----------------------------------------------------------------------------------
        void
        ButtonContainerSettings::AddButtons( BCStructVectorType infoList )
        {
-               for( BCStructVectorType::iterator it = infoList.begin( ); it
-                                   != infoList.end( ); ++it )
+               try
+               {
+                       for( BCStructVectorType::iterator it = infoList.begin( ); it
+                           != infoList.end( ); ++it )
+                       {
+                               this->AddButton( *it );
+                       }//rof
+               }
+               catch ( std::exception& e )
                {
-                       this->AddButton( *it );
-               }//rof
+                       std::cerr
+                           << "ButtonContainerSettings::AddButtons( BCStructVectorType infoList )"
+                           << "exception: " << e.what( ) << std::endl;
+               }//hctac
        }
-
+// ----------------------------------------------------------------------------------
 }//ecapseman
 
index 55b6e2c1183e52c4c7db1d859b58201227a26848..ff61b632ec557618d10371a7cee18e9444555a36 100644 (file)
@@ -1,11 +1,9 @@
-/***************************************************************
- * 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:
- **************************************************************/
+/*!
+ * @file buttonContainerSettings.h
+ * @brief This contains the ButtonContainerSettings class.
+ * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * @date  2011-05-24
+ */
 
 #ifndef BUTTONCONTAINERSETTINGS_H_
 #define BUTTONCONTAINERSETTINGS_H_
 #include <wx/panel.h>
 #include <vector>
 
-#include "structButtonContainerSettings.h"
+#include "structBCPSettings.h"
 #include "containerSettings.h"
 #include "functor.h"
 
+/*!    @namespace <creaPanelButtonContainer>
+ *     @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::vector< BCSettingsStruct* > BCStructVectorType;
+       /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
+        *      @brief This class contains the settings of the buttons.
+        */
        class ButtonContainerSettings
        {
                public:
+                       //typedef definition.
+                       /*!     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 description, Second FunctionEventType
+                        */
+                       typedef std::pair< std::string, PanelButton > ActionButton;
+                       // ----------------------------------------------------------------------------------
+                       /*!     @typedef std::pair< std::string, std::string > ButtonInfo;
+                        *      @brief Defines the ButtonInfo type.
+                        *      First is the ButtonName, Second is the ImageIconPath
+                        */
+                       typedef std::pair< std::string, std::string > ButtonInfo;
+                       // ----------------------------------------------------------------------------------
+                       /*!     @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
+                        *      @brief Defines the ButtonPair type.
+                        */
+                       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< 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;
+                       // ----------------------------------------------------------------------------------
+                       /*!     @typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
+                        *      @brief Defines the BCStructVectorType type.
+                        */
+                       typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
+                       //end typedef definition
+                       // ----------------------------------------------------------------------------------
+                       /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
+                        *      @brief This class contains the settings of the button container.
+                        */
+               public:
+                       // ----------------------------------------------------------------------------------
+                       /*! @fn ButtonContainerSettings( );
+                        *      @brief This is the default constructor.
+                        */
                        ButtonContainerSettings( );
+                       // ----------------------------------------------------------------------------------
+                       /*! @fn virtual ~ButtonContainerSettings( );
+                        *      @brief This is the destructor.
+                        */
                        virtual
                        ~ButtonContainerSettings( );
+                       // ----------------------------------------------------------------------------------
+                       /*! @fn ButtonGroupMap GetButtonGroupContainer( );
+                        *      @brief This method returns ButtonGroupMap with all buttons.
+                        * @return
+                        */
                        ButtonGroupMap
                        GetButtonGroupContainer( );
+                       // ----------------------------------------------------------------------------------
+                       /*! @fn KeyMapList GetGroupNameList( );
+                        *      @brief This method returns a KeyMapsList with the name of the groups.
+                        * @return
+                        */
                        KeyMapList
                        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 );
+                       // ----------------------------------------------------------------------------------
+                       /*! @fn ButtonGroupSettings* GetButtonGroupSettings( TFunctor* functor );
+                        *      @brief this method return the settings the generic settings for creaButtonContainer.
+                        * @param functor
+                        * @exception std::bad_alloc
+                        * @return
+                        */
                        ButtonGroupSettings*
                        GetButtonGroupSettings( TFunctor* functor );
+                       // ----------------------------------------------------------------------------------
+                       /*! @fn void SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
+                        *      @brief This method sets the button group container.
+                        * @param bGroupContainer
+                        */
                        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
+                        * @param buttonName
+                        * @param iconpath
+                        * @param buttonDescription
+                        * @param panel
+                        * @exception std::bad_alloc
+                        */
                        void
                        AddButton( const std::string &groupName, const std::string &buttonName,
                            const std::string &iconpath, 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
+                        * @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
+                        * @exception std::bad_alloc
+                        */
                        void
                        AddButtons( BCStructVectorType infoList );
-
+                       // ----------------------------------------------------------------------------------
                private:
-                       ButtonGroupMap m_ButtonGroupContainer;
-                       KeyMapList m_GroupNameList;
+                       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.
        };
 }//ecapseman
 #endif /* BUTTONCONTAINERSETTINGS_H_ */
index 8bac02d5c6e42132977c8d5aea021fb79a3c0cfc..133a214ddbd67baad7e14875ea08dd0500ccce8f 100644 (file)
@@ -1,22 +1,20 @@
-/***************************************************************
- * Name:      CartoPanel.cxx
- * Purpose:   Code for Application Frame
- * 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:
- **************************************************************/
+/*!
+ * @file creaPanelButtonContainer.h
+ * @brief implements PanelButtonContainer class
+ * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * @date  2011-05-24
+ */
 
 #include "creaPanelButtonContainer.h"
 
 namespace creaPanelButtonContainer
 {
-       //--------------------------------------------------------------------------------
+       // ----------------------------------------------------------------------------------
        typedef creaButtonContainer::model::TConcreteFunctor< PanelButtonContainer >
            TConcreteFunctor;
-
+       // ----------------------------------------------------------------------------------
        PanelButtonContainer::PanelButtonContainer( wxWindow* parent,
-                       ButtonContainerSettings* bcSettings ) :
+           ButtonContainerSettings* bcSettings ) :
                    wxPanel( parent, -1, wxDefaultPosition, wxSize( 300, 700 ),
                        wxDEFAULT_FRAME_STYLE, _T("creaPanelButtonContainer") )
        {
@@ -33,21 +31,22 @@ namespace creaPanelButtonContainer
                // CartoSettingsPanel Management
                this->m_AuiManager->AddPane(
                    this->m_ButtonPanel,
-                   wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption(
-                       _("Panel") ). CaptionVisible( ).CloseButton( false ).Left( ).MinSize(wxSize(300,300)) );
+                   wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("Panel") ). CaptionVisible( ).CloseButton(
+                       false ).Left( ).MinSize( wxSize( 300, 300 ) ) );
                //CartoButtonPanel Management
                this->m_AuiManager->AddPane(
                    this->m_ButtonContainerPanel,
                    wxAuiPaneInfo( ).Name( _T("creaButtonContainer") ).Caption(
-                       _("creaButtonContainer") ). CaptionVisible( ).CloseButton( false ).Left( ) .MinSize(wxSize(300,300) ) );
+                       _("creaButtonContainer") ). CaptionVisible( ).CloseButton( false ).Left( ) .MinSize(
+                       wxSize( 300, 300 ) ) );
                this->m_AuiManager->Update( );
                //this->createGimmick();
        }
-
+       // ----------------------------------------------------------------------------------
        PanelButtonContainer::~PanelButtonContainer( )
        {
        }
-
+       // ----------------------------------------------------------------------------------
        void
        PanelButtonContainer::UpdatePanel( const std::string &buttonName )
        {
@@ -62,13 +61,13 @@ namespace creaPanelButtonContainer
                //Updating the manager
                this->m_AuiManager->Update( );
        }
-
+       // ----------------------------------------------------------------------------------
        void
        PanelButtonContainer::GenericButtonEvent( const std::string &buttonName )
        {
                this->UpdatePanel( buttonName );
        }
-
+// ----------------------------------------------------------------------------------
 }//ecapseman
 
 
index d49ac59233d4a230d29cdd6da8411993643a0f28..6579b6332a435572d30d13648d70e676f38b10bd 100644 (file)
@@ -1,11 +1,9 @@
-/***************************************************************
- * Name:      pCartoGUIManager.h
- * Purpose:   Defines Application Frame
- * 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:
- **************************************************************/
+/*!
+ * @file PanelButtonContainer
+ * @brief This contains the ButtonContainerSettings class.
+ * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * @date  2011-05-24
+ */
 
 #ifndef PANELBUTTONCONTAINER_H_
 #define PANELBUTTONCONTAINER_H_
 #include "buttonContainerSettings.h"
 #include "functor.h"
 
+/*!    @namespace <creaPanelButtonContainer>
+ *     @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.
+ */
 namespace creaPanelButtonContainer
 {
-
-       typedef creaPanelButtonContainer::ButtonContainerSettings
-           ButtonContainerSettings;
-       typedef creaButtonContainer::view::ButtonContainerPanel ButtonContainerPanel;
+       /*! @class PanelButtonContainer panelButtonContainer.h "panelButtonContainer.h"
+        *      @brief This class contains the PanelButtonContainer. It derives from wxPanel.
+        *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxpanel.html">wxPanel</a>
+        */
        class PanelButtonContainer : public wxPanel
        {
                public:
+                       //typedef definition.
+                       /*!     typedef creaButtonContainer::model::TFunctor TFunctor;
+                        *      @brief Defines the TFunctor type.
+                        */
+                       typedef creaPanelButtonContainer::ButtonContainerSettings
+                           ButtonContainerSettings;
+                       /*!     typedef creaButtonContainer::model::TFunctor TFunctor;
+                        *      @brief Defines the TFunctor type.
+                        */
+                       typedef creaButtonContainer::view::ButtonContainerPanel
+                           ButtonContainerPanel;
+                       // ----------------------------------------------------------------------------------
+                       //end of typedef definition.
+               public:
+                       // ----------------------------------------------------------------------------------
+                       /*! @fn PanelButtonContainer( wxWindow* parent, ButtonContainerSettings* bcSettings );
+                        *      @brief This is the parameterized constructor.
+                        *      @param parent
+                        *      @param bcSettings
+                        */
                        PanelButtonContainer( wxWindow* parent,
                            ButtonContainerSettings* bcSettings );
+                       // ----------------------------------------------------------------------------------
+                       /*! @fn virtual PanelButtonContainer( );
+                        *      @brief This is the destructor.
+                        */
                        virtual
                        ~PanelButtonContainer( );
+                       // ----------------------------------------------------------------------------------
+                       /*! @fn void UpdatePanel( const std::string &buttonName );
+                        *  @brief This method Updates the m_ButtonPanel for a panel
+                        *  of the clicked button in creaButtonContainer.
+                        *      @param buttonName
+                        */
                        void
                        UpdatePanel( const std::string &buttonName );
+                       // ----------------------------------------------------------------------------------
+                       /*! @fn void GenericButtonEvent( const std::string &buttonName );
+                        *      @brief This method is the function that calls the panels contained in the buttons
+                        *      (in creaButtonContainer is the function contained in the functors to be called back.
+                        *      @param buttonName
+                        */
                        void
                        GenericButtonEvent( const std::string &buttonName );
+                       // ----------------------------------------------------------------------------------
                private:
                        //Settings
-                       ButtonContainerSettings* m_ButtonContainerSettings;
+                       ButtonContainerSettings* m_ButtonContainerSettings; //!<This is the buttonContainer settings.
                        //Panel
-                       ButtonContainerPanel* m_ButtonContainerPanel;
-                       wxAuiManager* m_AuiManager;
-                       wxPanel* m_ButtonPanel;
+                       ButtonContainerPanel* m_ButtonContainerPanel; //!<This is the panel with de buttons (creaButtonContainer)
+                       wxAuiManager* m_AuiManager; //!<The AUI Manager for the panels.
+                       wxPanel* m_ButtonPanel; //!<This is the panel used to contain the panels of the buttons. (it changes with the buttonAction)
        };
 }//ecapseman
 
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/structBCPSettings.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/structBCPSettings.h
new file mode 100755 (executable)
index 0000000..be67f22
--- /dev/null
@@ -0,0 +1,31 @@
+/*!
+ * @file structBCPSettings.h
+ * @brief Contains BCPSettingsStruct structure.
+ * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * @date  2011-05-24
+ */
+
+#ifndef STRUCTBCPSETTINGS_H_
+#define STRUCTBCPSETTINGS_H_
+
+#include <string>
+#include <wx/panel.h>
+
+/*!    @namespace <creaPanelButtonContainer>
+ *     @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.
+ */
+namespace creaPanelButtonContainer
+{
+       /*! @struct <BCPSettingsStruct> structBCPSettings.h "structBCPSettings.h"
+        *      @brief This is the Button Container Settings structure.
+        */
+       struct BCPSettingsStruct
+       {
+                       std::string groupName; //! <The name of the group of buttons.
+                       std::string buttonName; //! <The name of the button.
+                       std::string iconpath; //! <The iconPath of the button.
+                       std::string buttonDescription; //! <The description of the button.
+                       wxPanel* panel; //! <The panel of the button.
+       };
+}
+#endif //STRUCTBCPSETTINGS_H_
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/structButtonContainerSettings.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/structButtonContainerSettings.h
deleted file mode 100644 (file)
index fc00695..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/***************************************************************
- * Name:      pCartoGUIManager.h
- * Purpose:   Defines Application Frame
- * Author:    Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified:  2011-04-03
- * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
- * License:
- **************************************************************/
-
-#ifndef STRUCTBUTTONCONTAINERSETTINGS_H_
-#define STRUCTBUTTONCONTAINERSETTINGS_H_
-
-#include <string>
-#include <wx/panel.h>
-
-typedef std::string StringType;
-typedef wxPanel PanelButton;
-
-struct BCSettingsStruct
-{
-               StringType groupName;
-               StringType buttonName;
-               StringType iconpath;
-               StringType buttonDescription;
-               PanelButton* panel;
-};
-#endif //STRUCTBUTTONCONTAINERSETTINGS_H_