]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.cxx
DFCH: Manual paint changes!
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / model / buttonGroupFactory.cxx
index 9a76e9b668ced4fd3afd969b5b8ed28b4a8505ce..57cbf9b544572f124519244a19b6a7d996d47d50 100644 (file)
@@ -1,8 +1,8 @@
 /*!
  * @file buttonGroupFactory.cxx
- * @brief This contains the ButtonGroupFactory class implementation.
+ * @brief Implements the ButtonGroupFactory class.
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-06-02
  */
 
 #include "buttonGroupFactory.h"
@@ -30,23 +30,20 @@ namespace creaButtonContainer
                                ButtonGroupMap map = settings->GetButtonGroupContainer( );
                                for( ButtonGroupMap::iterator it = map.begin( ); it != map.end( ); ++it )
                                {
-                                       //using wxWidgets.
                                        wxString groupNameAux( ( *it ).first.c_str( ), wxConvUTF8 );
                                        wxStaticText* wxGroupName = new wxStaticText( parent, -1,
                                            groupNameAux, wxDefaultPosition, wxDefaultSize, 0,
-                                           _T( "GroupText" ) );
-                                       //creating a wxButtonGroup.
+                                           _T("GroupText") );
                                        ButtonGroup* group = new ButtonGroup( wxGroupName,
                                            this->GetButtons( parent, ( *it ).second ) );
-                                       //adding the group to the container.
                                        groupView.push_back( group );
                                }//rof
                        }//yrt
-                       catch ( std::exception& e )
+                       catch ( const 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 );
                }
@@ -57,20 +54,22 @@ namespace creaButtonContainer
                        ButtonContainer buttonList;
                        try
                        {
+                               ButtonContainer buttonList;
                                for( ButtonList::iterator it = buttonModel.begin( ); it
                                    != buttonModel.end( ); ++it )
                                {
                                        long id = wxNewId( );
                                        buttonList[ id ] = new Button( parent, id, *it );
-                               }
-                               return ( buttonList );
+                               }//rof
+                               //return ( buttonList ); // JPR
                        }//yrt
-                       catch ( std::exception& e )
+                       catch ( const 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
+                       return ( buttonList );   // JPR
                }
        // ----------------------------------------------------------------------------------
        }//ecapseman