* @file buttonContainerSettings.cxx
* @brief Implements the ButtonContainerSettings class.
* @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date 2011-05-24
+ * @date 2011-06-02
*/
#include "buttonContainerSettings.h"
-#include <iostream>
namespace creaPanelButtonContainer
{
// ----------------------------------------------------------------------------------
//GetButtonPanel returns the panel associated to the buttonAction
ButtonContainerSettings::PanelButton
- ButtonContainerSettings::GetPanelButton( const std::string &buttonName )
+ ButtonContainerSettings::GetPanelButton( const StringType &buttonName )
{
try
{
catch ( std::exception& e )
{
std::cerr
- << "ButtonContainerSettings::GetPanelButton( const std::string &buttonName ) "
+ << "ButtonContainerSettings::GetPanelButton( const StringType &buttonName ) "
<< "exception: " << e.what( ) << std::endl;
- return ( NULL );
}//hctac
+ return ( NULL );
}
// ----------------------------------------------------------------------------------
ButtonContainerSettings::ButtonGroupSettings*
ButtonContainerSettings::GetButtonGroupSettings( TFunctor* functor )
{
- ButtonGroupSettings* settings = new ButtonGroupSettings( );
try
{
+ ButtonGroupSettings* settings = new ButtonGroupSettings( );
for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
!= this->m_GroupNameList.end( ); ++it )
{
catch ( std::exception& e )
{
std::cerr
- << "ButtonContainerSettings::GetPanelButton( const std::string &buttonName ) "
+ << "ButtonContainerSettings::GetPanelButton( const StringType &buttonName ) "
<< "exception: " << e.what( ) << std::endl;
- return ( NULL );
}//hctac
}
// ----------------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------------
void
- ButtonContainerSettings::AddButton( const std::string & groupName,
- const std::string &buttonName, const std::string &iconpath,
- const std::string &buttonDescription, PanelButton panel )
+ ButtonContainerSettings::AddButton( const StringType & groupName,
+ const StringType &buttonName, const StringType &iconpath,
+ const StringType &buttonDescription, PanelButton panel )
{
try
{
//builds the button information
+ //I don't know the try catch doesn't work!!
+ if ( panel == NULL )
+ {
+ std::cerr << "ButtonContainerSettings::AddButton"
+ << "exception: NULL Pointer in panel " << std::endl;
+ exit( 1 );
+ }
panel->Show( false );
ButtonPair* pair = new ButtonPair(
new ButtonInfo( buttonName, iconpath ),
this->m_GroupNameList.push_back( groupName );
this->m_ButtonGroupContainer[ groupName ].push_back( pair );
}//yrt
- catch ( std::exception& e )
+ catch ( const 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 ) "
+ << "ButtonContainerSettings::AddButton( const StringType & groupName,"
+ << "const StringType &buttonName, const StringType &iconpath,"
+ << "const StringType &buttonDescription, PanelButton panel ) "
<< "exception: " << e.what( ) << std::endl;
}//hctac
}
try
{
//builds the button information
+ //I don't know the try catch doesn't work!!
+ if ( info->panel == NULL )
+ {
+ std::cerr << "ButtonContainerSettings::AddButton"
+ << "exception: NULL Pointer in panel " << std::endl;
+ exit( 1 );
+ }
info->panel->Show( false );
ButtonPair* pair = new ButtonPair(
new ButtonInfo( info->buttonName, info->iconpath ),
}//rof
this->m_GroupNameList.push_back( info->groupName );
this->m_ButtonGroupContainer[ info->groupName ].push_back( pair );
- }
- catch ( std::exception& e )
+ }//yrt
+ catch ( const std::exception& e )
{
std::cerr
<< "ButtonContainerSettings::AddButton( BCPSettingsStruct* info )"
<< "exception: " << e.what( ) << std::endl;
+ exit( 1 );
}//hctac
}
// ----------------------------------------------------------------------------------
{
this->AddButton( *it );
}//rof
- }
+ }//yrt
catch ( std::exception& e )
{
std::cerr