#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
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)
#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
{
CreateWidget( wxWindow* );
private:
- BCSettingsStruct* m_BSettings;
+ BCPSettingsStruct* m_BSettings;
BCStructVectorType m_BCSettingsVector;
wxPanel* myPanel;
//=====
* @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"
}//yrt
catch ( std::exception& e )
{
- std::cerr
- << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
+ std::cerr << "ButtonContainerController::AddEvents( ) exception: "
<< e.what( ) << std::endl;
}//hctac
}
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 )
{
}//yrt
catch ( std::exception& e )
{
- std::cerr << "ButtonContainerController::AddEvents( ) exception: "
+ std::cerr
+ << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
<< e.what( ) << std::endl;
}//hctac
}
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
}
* @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_
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>
// ----------------------------------------------------------------------------------
/*! @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.
*/
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.
*/
* @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"
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 );
}
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
}
// ----------------------------------------------------------------------------------
* @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
*/
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.
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
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
* @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"
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 )
{
<< 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
* @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_
#include <list>
#include <map>
+#include <vector>
#include <iostream>
+#include "structBCSettings.h"
#include "system.h"
#include "functor.h"
*/
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( )
~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
* @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.
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.
* @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_
* @brief Override operator "()". Execute member function.
* @see TFunctor
* @param buttonName
+ * @exception std::bad_alloc
*/
virtual void
operator()( const ButtonIDType &buttonName );
* @brief Override function "Call". Execute member function
* @see TFunctor
* @param buttonName
+ * @exception std::bad_alloc
*/
virtual void
Call( const ButtonIDType &buttonName );
* @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
--- /dev/null
+/*!
+ * @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_
* @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_
* @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"
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
* @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
*/
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
~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
* @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"
{
namespace view
{
+ // ----------------------------------------------------------------------------------
ButtonContainerPanel::ButtonContainerPanel( wxWindow* parent,
ButtonGroupSettings* settings ) :
wxScrolledWindow(
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
* @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
*/
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
{
~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( );
* @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"
{
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
* @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
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:
// ----------------------------------------------------------------------------------
/*! @fn GetButtonContainer( );
* @brief This method returns the button container.
+ * @exception std::bad_alloc
* @return ButtonContainer.
*/
ButtonContainer
// ----------------------------------------------------------------------------------
/*! @fn GetButtonIdContainer( );
* @brief This method returns a list of button IDs.
+ * @exception std::bad_alloc
* @return
*/
IdButtonContainer
* @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"
{
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
* @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
{
/*! @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
public:
// ----------------------------------------------------------------------------------
/*! @fn ButtonManager( );
- * @brief This is the default construuctor.
+ * @brief This is the default constructor.
+ * @exception std::bad_alloc
*/
ButtonManager( );
// ----------------------------------------------------------------------------------
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( );
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
* @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"
{
namespace view
{
- // -------------------------------------------------------------------
+ // ----------------------------------------------------------------------------------
GroupManager::GroupManager( wxWindow* parent, ButtonGroup* buttonGroup ) :
wxFlexGridSizer( 1, 0, 0, 0 )
{
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 )
{
else
this->m_ButtonManager->ShowButtonManager( );
}
- // -------------------------------------------------------------------
+ // ----------------------------------------------------------------------------------
}//ecapseman
}//ecapseman
* @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
*/
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:
-/***************************************************************
- * 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
-/***************************************************************
- * 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_ */
-/***************************************************************
- * 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") )
{
// 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 )
{
//Updating the manager
this->m_AuiManager->Update( );
}
-
+ // ----------------------------------------------------------------------------------
void
PanelButtonContainer::GenericButtonEvent( const std::string &buttonName )
{
this->UpdatePanel( buttonName );
}
-
+// ----------------------------------------------------------------------------------
}//ecapseman
-/***************************************************************
- * 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
--- /dev/null
+/*!
+ * @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_
+++ /dev/null
-/***************************************************************
- * 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_