// ----------------------------------------------------------------------------------
ButtonContainerController::~ButtonContainerController( )
{
- delete this->m_BCPanel;
}
// ----------------------------------------------------------------------------------
void
}//rof
}//rof
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr << "ButtonContainerController::AddEvents( ) exception: "
<< e.what( ) << std::endl;
}//fi esle
this->m_BCPanel->FitSizer( );
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr
<< "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
this->m_BCPanel->m_ButtonGroupList.begin( ); it
!= this->m_BCPanel->m_ButtonGroupList.end( ); ++it )
{
- ( *it )->GetButton( event.GetId( ) )->Execute( );
+ if ( ( *it )->GetButton( event.GetId( ) ) != NULL )
+ ( *it )->GetButton( event.GetId( ) )->Execute( );
}//rof
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr
<< "ButtonContainerController::ButtonEvent( wxCommandEvent& event ) exception: "
ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent,
ButtonGroupModel* settings )
{
- ButtonGroupContainer groupView;
try
{
+ ButtonGroupContainer groupView;
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
+ }
+ return ( groupView );
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr
<< "ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent, ButtonGroupModel* settings )"
<< " exception: " << e.what( ) << std::endl;
}//chtac
- return ( groupView );
}
// ----------------------------------------------------------------------------------
ButtonGroupFactory::ButtonContainer
ButtonContainer buttonList;
try
{
+ ButtonContainer buttonList;
for( ButtonList::iterator it = buttonModel.begin( ); it
!= buttonModel.end( ); ++it )
{
}
return ( buttonList );
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr
<< "ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel )"
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
<< "ContainerSettings::AddButton( const std::string & groupName,"
this->m_GroupNameList.push_back( info->groupName );
this->m_ButtonGroupContainer[ info->groupName ].push_back( pair );
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr
<< "void ContainerSettings::AddButton( BCSettingsStruct* info ) "
this->AddButton( *it );
}//rof
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr
<< "ContainerSettings::AddButtons( BCStructVectorType infoList ) "
#include <map>
#include <vector>
#include <iostream>
+#include <exception>
#include "structBCSettings.h"
#include "system.h"
#include "functor.h"
#define TFUNCTOR_H_
#include <string>
+#include <exception>
/*! @namespace <creaButtonContainer>
* @brief Contains the creaButtonContainer library included in creaMaracasVisu.
{
( *pt2Object.*fpt )( buttonName );
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr<< "TConcreteFunctor< TClass >::operator()( const ButtonIDType &buttonName )"
<<" exception: " << e.what( ) << std::endl;
{
( *pt2Object.*fpt )( buttonName );
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr<< "TConcreteFunctor< TClass >::Call( const ButtonIDType &buttonName )"
<<" exception: " << e.what( ) << std::endl;
#include <list>
#include <map>
#include <iostream>
+#include <exception>
#include "functor.h"
/*! @namespace <creaButtonContainer>
{ this->m_ButtonPair->second->second };
vTable[ 0 ]->Call( this->m_ButtonPair->first->first );
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr << "Button::Execute( ) exception: " << e.what( ) << std::endl;
}//hctac
#include <wx/string.h>
#include <string>
#include <iostream>
+#include <exception>
#include "functor.h"
#include "system.h"
+
/*! @namespace <creaButtonContainer>
* @brief Contains the creaButtonContainer library included in creaMaracasVisu.
*/
this->SetSizer( this->m_Sizer );
this->FitSizer( );
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr << "ButtonContainerPanel::PanelInit( ) " << "exception: "
<< e.what( ) << std::endl;
#include <wx/sizer.h>
#include <list>
#include <map>
+#include <exception>
#include "buttonGroup.h"
#include "groupManager.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.
+ * @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
#include <map>
#include <list>
#include <wx/stattext.h>
+#include <exception>
#include "button.h"
this->SetGroupName( buttonGroup->GetGroupName( ) );
this->SetButtonManager( buttonGroup->GetButtonContainer( ) );
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr << "Button::Execute( ) exception: " << e.what( ) << std::endl;
}//hctac
this->Add( m_GridSizer, -1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5 );
}
}//yrt
- catch ( std::exception& e )
+ catch ( const std::exception& e )
{
std::cerr
<< "ButtonManager::SetButtonManager( ButtonContainer buttonContainer )"
#include <wx/stattext.h>
#include <wx/string.h>
#include <map>
+#include <exception>
#include "button.h"
#include "buttonGroup.h"
#include <wx/event.h>
#include <list>
#include <iostream>
+#include <exception>
#include "buttonManager.h"
#include "buttonGroup.h"
#include <wx/event.h>
*/
#include "buttonContainerSettings.h"
-#include <iostream>
namespace creaPanelButtonContainer
{
std::cerr
<< "ButtonContainerSettings::GetPanelButton( const std::string &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 )
{
std::cerr
<< "ButtonContainerSettings::GetPanelButton( const std::string &buttonName ) "
<< "exception: " << e.what( ) << std::endl;
- return ( NULL );
}//hctac
}
// ----------------------------------------------------------------------------------
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,"
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
#include <map>
#include <wx/panel.h>
#include <vector>
+#include <iostream>
#include "structBCPSettings.h"
#include "containerSettings.h"
{
this->m_ButtonContainerSettings = bcSettings;
this->m_ButtonPanel = new wxPanel( this );
+
//Class that manages the cartobutton event!!!
TConcreteFunctor* functor = new TConcreteFunctor( this,
&PanelButtonContainer::GenericButtonEvent );
//end of the event definition
+
this->m_ButtonContainerPanel = new ButtonContainerPanel( this,
this->m_ButtonContainerSettings->GetButtonGroupSettings( functor ) );
+
//Using AuiManager to Manage the Panels
this->m_AuiManager = new wxAuiManager( this, wxAUI_MGR_DEFAULT );
+
// CartoSettingsPanel Management
this->m_AuiManager->AddPane(
this->m_ButtonPanel,
wxAuiPaneInfo( ).Name( _T("ButtonPanel") ).Caption( _("Panel") ). CaptionVisible( ).CloseButton(
false ).Left( ).MinSize( wxSize( 300, 300 ) ) );
+
//CartoButtonPanel Management
this->m_AuiManager->AddPane(
this->m_ButtonContainerPanel,
_("creaButtonContainer") ). CaptionVisible( ).CloseButton( false ).Left( ) .MinSize(
wxSize( 300, 300 ) ) );
this->m_AuiManager->Update( );
- //this->createGimmick();
}
// ----------------------------------------------------------------------------------
PanelButtonContainer::~PanelButtonContainer( )
void
PanelButtonContainer::UpdatePanel( const std::string &buttonName )
{
- //Hiding the last CartoSettingsPanel
- this->m_ButtonPanel->Show( false );
- //Finding the CartoSettingsPanel of the ButtonClicket
- this->m_ButtonPanel = this->m_ButtonContainerSettings->GetPanelButton(
- buttonName );
- //CartoSettingsPanel Management
- this->m_AuiManager->GetPane( _T("ButtonPanel") ).window
- = this->m_ButtonPanel;
- //Updating the manager
- this->m_AuiManager->Update( );
+ try
+ {
+ //Hiding the last CartoSettingsPanel
+ this->m_ButtonPanel->Show( false );
+ //Finding the CartoSettingsPanel of the ButtonClicket
+ this->m_ButtonPanel = this->m_ButtonContainerSettings->GetPanelButton(
+ buttonName );
+ //CartoSettingsPanel Management
+ this->m_AuiManager->GetPane( _T("ButtonPanel") ).window
+ = this->m_ButtonPanel;
+ //Updating the manager
+ this->m_AuiManager->Update( );
+ }//yrt
+ catch ( const std::exception& e )
+ {
+ std::cerr
+ << "PanelButtonContainer::UpdatePanel( const std::string &buttonName )"
+ << "exception: " << e.what( ) << std::endl;
+ std::cout<<"Maybe the panel of the button is NULL"<<std::endl;
+ exit(1);
+ }//hctac
}
// ----------------------------------------------------------------------------------
void