-/************************************************************************************//*!
- * Name: @file buttonContainerController.cxx
- * Purpose: @brief This contains the ButtonContainerController class implementation
- * Author: @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified: 2011-05-17
- * Copyright:
- * License:
- ***************************************************************************************/
+/*!
+ * @file buttonContainerController.cxx
+ * @brief This contains the ButtonContainerController class implementation
+ * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * @date 2011-06-02
+ */
-//! @include "buttonContainerController.h"
#include "buttonContainerController.h"
-//! @namespace<creaButtonContainer>
namespace creaButtonContainer
{
- //! @namespace<controller>
namespace controller
{
// ----------------------------------------------------------------------------------
this->Connect(
( *it ).first,
wxEVT_COMMAND_BUTTON_CLICKED,
- ( wxObjectEventFunction )
- & ButtonContainerController::ButtonExpEvent );
+ (wxObjectEventFunction) &ButtonContainerController::ButtonExpEvent );
}//rof
//Adding ButtonEvents
KeyList keylist = ( *it )->GetButtonIdContainer( );
for( KeyList::iterator it2 = keylist.begin( ); it2 != keylist.end( ); ++it2 )
{
- this->Connect(
- ( *it2 ),
- wxEVT_COMMAND_BUTTON_CLICKED,
- ( wxObjectEventFunction )
- & ButtonContainerController::ButtonEvent );
+ this->Connect( ( *it2 ), wxEVT_COMMAND_BUTTON_CLICKED,
+ (wxObjectEventFunction) &ButtonContainerController::ButtonEvent );
}//rof
}//rof
- }
- catch ( std::exception& e )
+ }//yrt
+ catch ( const std::exception& e )
{
- std::cerr
- << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
+ std::cerr << "ButtonContainerController::AddEvents( ) exception: "
<< e.what( ) << std::endl;
- }
+ }//hctac
}
// ----------------------------------------------------------------------------------
void
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 )
{
this->m_BCPanel->m_GroupManagerList[ id ]->GetButton( )->SetLabel(
_( "-" ) );
this->m_BCPanel->m_GroupManagerList[ id ]->HideSubPanel( false );
- }
+ }//fi
else if ( this->m_BCPanel->m_GroupManagerList[ id ]->GetButton( )->GetLabel( ).Cmp(
_( "-" ) ) == 0 )
{
this->m_BCPanel->m_GroupManagerList[ id ]->GetButton( )->SetLabel(
_( "+" ) );
this->m_BCPanel->m_GroupManagerList[ id ]->HideSubPanel( true );
- }
+ }//fi esle
this->m_BCPanel->FitSizer( );
- }
- catch ( std::exception& e )
+ }//yrt
+ catch ( const std::exception& e )
{
- std::cerr << "ButtonContainerController::AddEvents( ) exception: "
+ std::cerr
+ << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
<< e.what( ) << std::endl;
- }
+ }//hctac
}
// ----------------------------------------------------------------------------------
void
ButtonContainerController::ButtonEvent( wxCommandEvent& event )
{
- for( ButtonGroupList::iterator it =
- this->m_BCPanel->m_ButtonGroupList.begin( ); it
- != this->m_BCPanel->m_ButtonGroupList.end( ); ++it )
+ try
{
- try
- {
- ( *it )->GetButton( event.GetId( ) )->Execute( );
- }
- catch ( std::exception& e )
+ for( ButtonGroupList::iterator it =
+ this->m_BCPanel->m_ButtonGroupList.begin( ); it
+ != this->m_BCPanel->m_ButtonGroupList.end( ); ++it )
{
- std::cerr
- << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
- << e.what( ) << std::endl;
- }
- }
+ if ( ( *it )->GetButton( event.GetId( ) ) != NULL )
+ {
+ ( *it )->GetButton( event.GetId( ) )->Execute( );
+ }//fi
+ }//rof
+ }//yrt
+ catch ( const std::exception& e )
+ {
+ std::cerr
+ << "ButtonContainerController::ButtonEvent( wxCommandEvent& event ) exception: "
+ << e.what( ) << std::endl;
+ }//hctac
}
// ----------------------------------------------------------------------------------
}//ecapsename