& ButtonContainerController::ButtonEvent );
}//rof
}//rof
- }
+ }//yrt
catch ( std::exception& e )
{
std::cerr
<< "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
<< e.what( ) << std::endl;
- }
+ }//hctac
}
// ----------------------------------------------------------------------------------
void
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( );
- }
+ }//yrt
catch ( std::exception& e )
{
std::cerr << "ButtonContainerController::AddEvents( ) 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
+ for( ButtonGroupList::iterator it =
+ this->m_BCPanel->m_ButtonGroupList.begin( ); it
+ != this->m_BCPanel->m_ButtonGroupList.end( ); ++it )
{
+
( *it )->GetButton( event.GetId( ) )->Execute( );
- }
- catch ( std::exception& e )
- {
- std::cerr
- << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
- << e.what( ) << std::endl;
- }
- }
+
+ }//rof
+ }//yrt
+ catch ( std::exception& e )
+ {
+ std::cerr
+ << "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
+ << e.what( ) << std::endl;
+ }//hctac
}
// ----------------------------------------------------------------------------------
}//ecapsename
* Name: @file buttonGroupFactory.cxx
* Purpose: @brief This contains the ButtonGroupFactory class implementation
* Author: @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified: 2011-05-17
+ * Modified: 2011-05-18
* Copyright:
* License:
***************************************************************************************/
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.
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 )
{
std::cerr
<< "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
<< e.what( ) << std::endl;
- }
+ }//chtac
return ( groupView );
}
// ----------------------------------------------------------------------------------
buttonList[ id ] = new Button( parent, id, *it );
}
return ( buttonList );
- }
+ }//yrt
catch ( std::exception& e )
{
std::cerr
<< "ButtonContainerController::ButtonExpEvent( wxCommandEvent& event ) exception: "
<< e.what( ) << std::endl;
- }
+ }//chtac
}
// ----------------------------------------------------------------------------------
}//ecapseman
//! @namespace <model>
namespace model
{
- //! @class ButtonGroupFactory
- //! @brief This class is the factory of a group of wxButtons.
/*! @class ButtonGroupFactory buttonGroupFactory.h "buttonGroupFactory.h"
* @brief This class contains the ButtonContainer factory.
-/***************************************************************
- * Name: ButtonGroupSettings.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/)
+/************************************************************************************//*!
+ * 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-18
+ * Copyright:
* License:
- **************************************************************/
+ ***************************************************************************************/
+
+//! @include "containerSettings.h"
#include "containerSettings.h"
+//! @namespace<creaButtonContainer>
namespace creaButtonContainer
{
+ //! @namespace<model>
namespace model
{
-
+ // ----------------------------------------------------------------------------------
ContainerSettings::ContainerSettings( )
{
}
-
+ // ----------------------------------------------------------------------------------
ContainerSettings::~ContainerSettings( )
{
}
-
+ // ----------------------------------------------------------------------------------
ButtonGroupMap
ContainerSettings::GetButtonGroupContainer( )
{
- return m_ButtonGroupContainer;
+ return this->m_ButtonGroupContainer;
}
-
+ // ----------------------------------------------------------------------------------
KeyMapList
ContainerSettings::GetGroupNameList( )
{
- return m_GroupNameList;
+ return this->m_GroupNameList;
}
-
+ // ----------------------------------------------------------------------------------
void
ContainerSettings::SetButtonGroupContainer(
- ButtonGroupMap m_ButtonGroupContainer )
+ ButtonGroupMap bgContainer )
{
- this->m_ButtonGroupContainer = m_ButtonGroupContainer;
+ this->m_ButtonGroupContainer = bgContainer;
}
-
+ // ----------------------------------------------------------------------------------
void
- ContainerSettings::SetGroupNameList( KeyMapList m_GroupNameList )
+ ContainerSettings::SetGroupNameList( KeyMapList gNameList )
{
- this->m_GroupNameList = m_GroupNameList;
+ this->m_GroupNameList = gNameList;
}
-
+ // ----------------------------------------------------------------------------------
void
ContainerSettings::AddButton( const std::string & groupName,
const std::string buttonName, const std::string iconpath,
{
ButtonPair* pair = new ButtonPair(
new ButtonInfo( buttonName, iconpath ),
- new ActionButton( buttonDescription, event ) );
- for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it
- != this->m_GroupNameList.end( ); ++it )
- if ( ( *it ).compare( groupName ) == 0 )
+ new ButtonAction( buttonDescription, event ) );
+ try
+ {
+ 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
+ << "ContainerSettings::AddButton( const std::string & groupName,"
+ << "const std::string buttonName, const std::string iconpath,"
+ << "const std::string buttonDescription, FunctionEventType event ) exception: "
+ << e.what( ) << std::endl;
+ }//hctac
}
-
- }
-}
+ // ----------------------------------------------------------------------------------
+ }//ecapseman
+}//ecapseman
-/***************************************************************
+/************************************************************************************//*!
* Name: @file containerSettings.h
- * Purpose: @brief This contains ContainerSettings class
+ * Purpose: @brief This contains the ContainerSettings class
* Author: @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified: 2011-05-09
- * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
+ * Modified: 2011-05-18
+ * Copyright:
* License:
- **************************************************************/
+ ***************************************************************************************/
#ifndef BUTTONGROUPSETTINGS_H_
#define BUTTONGROUPSETTINGS_H_
+//! @include <list>
#include <list>
+//! @include <map>
#include <map>
+//! @include <iostream>
#include <iostream>
+//! @include "system.h"
#include "system.h"
-
+//! @include "functor"
#include "functor.h"
-///@namespace <creaButtonContainer>
+//! @namespace <creaButtonContainer>
namespace creaButtonContainer
{
- ///@namespace <model>
+ //! @namespace <model>
namespace model
{
- /*!
- * @class ContainerSettings
- * @brief This class contains all information of groups and its buttons
+ /*! @class ContainerSettings containerSettings.h "containerSettings.h"
+ * @brief This class contains the settings of the button container.
+ * This class describes how to add new buttons to the container.
*/
class ContainerSettings
{
public:
- /*!
- * @brief This is the default constructor
+ // ----------------------------------------------------------------------------------
+ /*! @fn void ContainerSettings::ContainerSettings( )
+ * @brief This is the constructor.
*/
ContainerSettings( );
+ // ----------------------------------------------------------------------------------
+ /*! @fn ContainerSettings::~ContainerSettings( )
+ * @brief This is the destructor.
+ */
virtual
~ContainerSettings( );
- /*!
- * @brief This function allows to create the ButtonGroupContainer.
- * @param the wxWindow* parent to be attached.
- * @param The Container settings.
- * @return The wx button group container.
+ // ----------------------------------------------------------------------------------
+ /*! @fn ButtonGroupMap ContainerSettings::GetButtonGroupContainer( )
+ * @brief This function returns a container of buttons ordered by group.
+ * @return ButtonGroupMap A container with buttons
*/
ButtonGroupMap
GetButtonGroupContainer( );
- /*!
- * @brief This function allows to create the ButtonGroupContainer.
- * @param the wxWindow* parent to be attached.
- * @param The Container settings.
- * @return The wx button group container.
+ // ----------------------------------------------------------------------------------
+ /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
+ * @brief This function returns a container with the name of the groups.
+ * @return KeyMapList A list with the name of the button groups.
*/
KeyMapList
GetGroupNameList( );
- /*!
- * @brief This function allows to create the ButtonGroupContainer.
- * @param the wxWindow* parent to be attached.
- * @param The Container settings.
- * @return The wx button group container.
+ // ----------------------------------------------------------------------------------
+ /*! void ContainerSettings::SetButtonGroupContainer( ButtonGroupMap m_ButtonGroupContainer )
+ * @brief This function allows to create the ButtonGroupContainer.
+ * @param bgContainer The ButtonGroupMap with all buttons.
*/
void
- SetButtonGroupContainer( ButtonGroupMap m_ButtonGroupContainer );
- /*!
- * @brief This function allows to create the ButtonGroupContainer.
- * @param the wxWindow* parent to be attached.
- * @param The Container settings.
- * @return The wx button group container.
+ SetButtonGroupContainer( ButtonGroupMap bgContainer );
+ // ----------------------------------------------------------------------------------
+ /*! void ContainerSettings::SetGroupNameList( KeyMapList gNameList )
+ * @brief This function sets a container with the name of the groups.
+ * @param gNameList the KeyMapList with all groupNames.
*/
void
- SetGroupNameList( KeyMapList m_GroupNameList );
+ SetGroupNameList( KeyMapList gNameList );
+ // ----------------------------------------------------------------------------------
/*!
- * @brief This function allows to create the ButtonGroupContainer.
- * @param the wxWindow* parent to be attached.
- * @param The Container settings.
- * @return The wx button group container.
+ * @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.
+ * @param groupName The name of the group of buttons.
+ * @param buttonName The ID of the button.
+ * @param iconpath The path of the button icon.
+ * @param buttonDescription The description of the button.
+ * @param event The event associated to the button.
+ * @see class Functor, ConcreteFunctor for add an event for a button.
+ * @exception std::bad_alloc
*/
void
AddButton( const std::string & groupName, const std::string buttonName,
const std::string iconpath, const std::string buttonDescription,
FunctionEventType event );
+ // ----------------------------------------------------------------------------------
private:
- ButtonGroupMap m_ButtonGroupContainer;
- KeyMapList m_GroupNameList;
+ ButtonGroupMap m_ButtonGroupContainer; //! <std::map< std::string, ButtonList > View pointer.
+ KeyMapList m_GroupNameList; //! <ButtonContainerPanel View pointer.
};
}
}
-/***************************************************************
- * Name: TFunctor
- * Purpose: Call_Back Functions
- * Author: Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified: 2011-05-09
- * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
+/************************************************************************************//*!
+ * Name: @file functor.h
+ * Purpose: @brief defines TFunctor class
+ * Author: @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * Modified: 2011-05-18
+ * Copyright:
* License:
- **************************************************************/
+ ***************************************************************************************/
#ifndef TFUNCTOR_H_
#define TFUNCTOR_H_
+//! @include <string>
#include <string>
+//! @namespace <creaButtonContainer>
namespace creaButtonContainer
{
+ //! @namespace <model>
namespace model
{
+ /*! @typedef std::string ButtonIDType;
+ * @brief Defines the ButtonIDType type.
+ */
typedef std::string ButtonIDType;
- // abstract base class
+
+ /*! @class TFunctor functor.h "functor.h"
+ * @brief This is an abstract class for call_back functions.
+ */
class TFunctor
{
public:
// two possible functions to call member function. virtual cause derived
// classes will use a pointer to an object and a pointer to a member function
- // to make the function call
+ /*! @fn virtual void TFunctor::operator()( const ButtonIDType &buttonName )
+ * @brief To make the function call.
+ * Call_Back function.
+ * @param buttonName
+ */
virtual void
operator()( const ButtonIDType &buttonName )=0; // call using operator
+ /*! @fn
+ * @brief Call using function.
+ * Call_Back function.
+ * @param buttonName
+ */
virtual void
Call( const ButtonIDType &buttonName )=0;
- // call using function
};
// derived template class
+ /*! @tparam <typename TClass>
+ * @brief It makes TConcreteFunctor usable for all Classes.
+ */
template< typename TClass >
+ /*! @class TConcreteFunctor: public TFunctor functor.h "functor.h"
+ * @brief This class contains the ButtonContainer factory.
+ * This class describes the factory of the ButtonContainer using design patterns.
+ */
class TConcreteFunctor : public TFunctor
{
public:
- // constructor - takes pointer to an object and pointer to a member and stores
- // them in two private variables
+ /*! @fn TConcreteFunctor::TConcreteFunctor( TClass* _pt2Object, void
+ (TClass::*_fpt)( const ButtonIDType &buttonName ) );
+ * @brief This is the parameterized constructor.
+ * Takes pointer to an object and pointer to a member and stores them in two private variables
+ * @param _pt2Object Pointer to object.
+ * @param _fpt Pointer to the function.
+ * @param buttonName The ID of the button (ButtonName).
+ */
TConcreteFunctor( TClass* _pt2Object, void
(TClass::*_fpt)( const ButtonIDType &buttonName ) );
- // override operator "()" // execute member function
+ // -------------------------------------------------------------------------------
+ /*! @fn virtual void TConcreteFunctor::operator()( const ButtonIDType &buttonName );
+ * @brief Override operator "()". Execute member function.
+ * @see TFunctor
+ * @param buttonName
+ */
virtual void
operator()( const ButtonIDType &buttonName );
- // override function "Call" // execute member function
+ // -------------------------------------------------------------------------------
+ /*! @fn virtual void TConcreteFunctor::Call( const ButtonIDType &buttonName );
+ * @brief Override function "Call". Execute member function
+ * @see TFunctor
+ * @param buttonName
+ */
virtual void
Call( const ButtonIDType &buttonName );
+ // -------------------------------------------------------------------------------
private:
- void
- (TClass::*fpt)( const ButtonIDType &buttonName );
- // pointer to member function
- TClass* pt2Object;
- // pointer to object
+ void (TClass::*fpt)( const ButtonIDType &buttonName ); //! <void (TClass::*fpt) Pointer to member function.
+ TClass* pt2Object; //! <TClass* pointer to object.
};
}//ecapseman
}//ecapseman
+//! @include "functor.txx"
#include "functor.txx"
#endif /* TFUNCTOR_H_ */
-/***************************************************************
- * Name: TFunctor
- * Purpose: Call_Back Functions
- * Author: Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified: 2011-05-09
- * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
+/************************************************************************************//*!
+ * Name: @file functor.cxx
+ * Purpose: @brief implements TFunctor class and it propose is Call_Back Functions
+ * Author: @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * Modified: 2011-05-18
+ * Copyright:
* License:
- **************************************************************/
+ ***************************************************************************************/
namespace creaButtonContainer
{
{
// 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 ) )
{
- pt2Object = _pt2Object;
- fpt = _fpt;
+ this->pt2Object = _pt2Object;
+ this->fpt = _fpt;
}
+ // -------------------------------------------------------------------------------
// override operator "()" // execute member functions
template< typename TClass >
void
{
( *pt2Object.*fpt )( buttonName );
}
+ // -------------------------------------------------------------------------------
// override function "Call" // execute member function
template< typename TClass >
void
-/***************************************************************
- * Name: TFunctor
- * Purpose: Call_Back Functions
- * Author: Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified: 2011-05-09
- * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
+/************************************************************************************//*!
+ * Name: @file system.h
+ * Purpose: @brief contains a system typedefs used to reuse code.
+ * Author: @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * Modified: 2011-05-18
+ * Copyright:
* License:
- **************************************************************/
+ ***************************************************************************************/
#ifndef SYSTEM_H_
#define SYSTEM_H_
+//! @include <list>
#include <list>
+//! @include <map>
#include <map>
+//! @include <iostream>
#include <iostream>
+//! @include "functor.h"
#include "functor.h"
///@namespace <creaButtonContainer>
namespace creaButtonContainer
{
- typedef model::TFunctor* FunctionEventType;
- //First is the button description, Second FunctionEventType
- typedef std::pair< std::string, FunctionEventType > 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 model::TFunctor* FunctionEventType;
+ * @brief Defines the FunctionEventType type.
+ *
+ */
+ typedef model::TFunctor* FunctionEventType;
+ // ----------------------------------------------------------------------------------
+ /*! @typedef creaButtonContainer::view::Button Button;
+ * @brief Defines the ActionButton type.
+ * First is the button description, Second FunctionEventType
+ */
+ typedef std::pair< std::string, FunctionEventType > ButtonAction;
+ // ----------------------------------------------------------------------------------
+ /*! @typedef std::pair< std::string, std::string > ButtonInfo;
+ * @brief Defines the ButtonInfo type.
+ * First is the ButtonName and Second is the IconPath
+ */
+ typedef std::pair< std::string, std::string > ButtonInfo;
+ // ----------------------------------------------------------------------------------
+ /*! @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
+ * @brief Defines the ButtonPair type.
+ */
+ typedef std::pair< ButtonInfo*, ButtonAction* > 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;
+// ----------------------------------------------------------------------------------
}
#endif /* SYSTEM_H_ */
* License:
**************************************************************/
+//! @include "button.h"
#include "button.h"
-#include <iostream>
+//! @namespace <creaButtonContainer>
namespace creaButtonContainer
{
+ //! @namespace <view>
namespace view
{
- //--------------------------------------------------------------------
+ // ----------------------------------------------------------------------------------
Button::Button( wxWindow* parent, long id, ButtonPair* pair )
{
this->m_ButtonPair = pair;
wxString buttonName( wXbuttonName.c_str( ), wxConvUTF8 );
wxString imageIcon( wXiconPath.c_str( ), wxConvUTF8 );
wxString description( wXdescription.c_str( ), wxConvUTF8 );
+ //creating the button.
this->Create( parent, id,
wxBitmap( wxImage( imageIcon, wxBITMAP_TYPE_ANY, -1 ) ),
wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator,
buttonName );
this->SetToolTip( description );
}
- //--------------------------------------------------------------------
+ // ----------------------------------------------------------------------------------
Button::~Button( )
{
}
- //--------------------------------------------------------------------
- //--------------------------------------------------------------------
- string
+ // ----------------------------------------------------------------------------------
+ std::string
Button::GetButtonName( )
{
- return( this->m_ButtonPair->first->first );
+ return ( this->m_ButtonPair->first->first );
}
- //--------------------------------------------------------------------
- string
+ // ----------------------------------------------------------------------------------
+ std::string
Button::GetIconPath( )
{
- return( this->m_ButtonPair->first->second );
+ return ( this->m_ButtonPair->first->second );
}
- //--------------------------------------------------------------------
- string
+ // ----------------------------------------------------------------------------------
+ std::string
Button::GetDescription( )
{
- return( this->m_ButtonPair->second->first );
+ return ( this->m_ButtonPair->second->first );
}
- //--------------------------------------------------------------------
+ // ----------------------------------------------------------------------------------
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 );
+ 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 );
}
-
+ // ----------------------------------------------------------------------------------
}//ecapseman
}//ecapseman
-/***************************************************************
- * Name: Button.h
- * Purpose: Defines a Button
- * Author: Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified: 2011-05-09
- * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
+/************************************************************************************//*!
+ * Name: @file button.h
+ * Purpose: @brief This contains the Button class
+ * Author: @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
+ * Modified: 2011-05-18
+ * Copyright:
* License:
- **************************************************************/
+ ***************************************************************************************/
#ifndef BUTTON_H
#define BUTTON_H
+//! @include <wx/bmpbuttn.h>
#include <wx/bmpbuttn.h>
+//! @include <<wx/image.h>
#include <wx/image.h>
+//! @include <wx/string.h>
#include <wx/string.h>
+//! @include <string>
#include <string>
+//! @include <iostream>
+#include <iostream>
+//! @include "functor.h"
#include "functor.h"
+//! @include "system.h"
#include "system.h"
-using std::string;
-
+//! @namespace <creaButtonContainer>
namespace creaButtonContainer
{
+ //! @namespace <view>
namespace view
{
- /**
- Class Description: This class defines a wxBitmapButton.
- **/
- class Button : public wxBitmapButton
- {
- public:
- //Typedef definition
- typedef creaButtonContainer::model::TFunctor TFunctor;
- public:
- //--------------------------------------------------------------------
- Button( wxWindow* parent, long id, ButtonPair* pair );
- virtual
- ~Button( );
- //--------------------------------------------------------------------
- long
- GetID( );
- string
- GetButtonName( );
- string
- GetIconPath( );
- string
- GetDescription( );
- //--------------------------------------------------------------------
- void
- Execute( );
- private:
- ButtonPair* m_ButtonPair;
- };
+ /*! @class ContainerSettings containerSettings.h "containerSettings.h"
+ * @brief This class contains the settings of the button container.
+ * This class describes how to add new buttons to the container.
+ */
+ class Button : public wxBitmapButton
+ {
+ public:
+ /*! @typedef creaButtonContainer::model::ContainerSettings ButtonGroupModel;
+ * @brief Defines the ButtonGroupModel type.
+ */
+ typedef creaButtonContainer::model::TFunctor TFunctor;
+ public:
+ // ----------------------------------------------------------------------------------
+ /*! @fn void ContainerSettings::ContainerSettings( )
+ * @brief This is the constructor.
+ */
+ Button( wxWindow* parent, long id, ButtonPair* pair );
+ // ----------------------------------------------------------------------------------
+ /*! @fn void ContainerSettings::ContainerSettings( )
+ * @brief This is the constructor.
+ */
+ virtual
+ ~Button( );
+ // ----------------------------------------------------------------------------------
+ /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
+ * @brief This function returns a container with the name of the groups.
+ * @return KeyMapList A list with the name of the button groups.
+ */
+ long
+ GetID( );
+ // ----------------------------------------------------------------------------------
+ /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
+ * @brief This function returns a container with the name of the groups.
+ * @return long A list with the name of the button groups.
+ */
+ std::string
+ GetButtonName( );
+ // ----------------------------------------------------------------------------------
+ /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
+ * @brief This function returns a container with the name of the groups.
+ * @return std::string A list with the name of the button groups.
+ */
+ std::string
+ GetIconPath( );
+ // ----------------------------------------------------------------------------------
+ /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
+ * @brief This function returns a container with the name of the groups.
+ * @return std::string A list with the name of the button groups.
+ */
+ std::string
+ GetDescription( );
+ // ----------------------------------------------------------------------------------
+ /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
+ * @brief This function returns a container with the name of the groups.
+ * @return std::string A list with the name of the button groups.
+ */
+ void
+ Execute( );
+ // ----------------------------------------------------------------------------------
+ private:
+ ButtonPair* m_ButtonPair; //! <ButtonPair* ButtonPail pointer.
+ };
}//ecapseman
}//ecapseman
{
}
//--------------------------------------------------
- ButtonContainer
+ ButtonGroup::ButtonContainer
ButtonGroup::GetButtonContainer( )
{
return ( this->m_Buttons );
return ( this->m_GroupName );
}
//--------------------------------------------------
- IdButtonContainer
+ ButtonGroup::IdButtonContainer
ButtonGroup::GetButtonIdContainer( )
{
IdButtonContainer idContainer;
{
namespace view
{
- //Typedef definition
- typedef creaButtonContainer::view::Button Button;
- typedef std::map< long, Button* > ButtonContainer;
- typedef std::list< long > IdButtonContainer;
-
/**
Class Description: This class defines a ButtonGroup.
**/
class ButtonGroup
{
+ public:
+ //Typedef definition
+ typedef creaButtonContainer::view::Button Button;
+ typedef std::map< long, Button* > ButtonContainer;
+ typedef std::list< long > IdButtonContainer;
public:
ButtonGroup( wxStaticText* groupName, ButtonContainer buttons );
virtual
return ( this->m_IDExpButton );
}
// -------------------------------------------------------------------
- ExpansionButton*
+ GroupManager::ExpansionButton*
GroupManager::GetButton( )
{
return ( this->m_ExpansionButton );
{
namespace view
{
- typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
- typedef wxButton ExpansionButton;
/**
Class Description:
**/
class GroupManager : public wxFlexGridSizer
{
+ public:
+ typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
+ typedef wxButton ExpansionButton;
public:
GroupManager( wxWindow* parent, ButtonGroup* buttonGroup );
virtual