From: ctorres Date: Fri, 27 Jun 2014 12:36:51 +0000 (+0200) Subject: 2413 creaMaracasVisu Feature New Normal New blackBox BitmapButtonIcon and fix the... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=352ae750b47650f57bc952705f184995a2486468;p=creaMaracasVisu.git 2413 creaMaracasVisu Feature New Normal New blackBox BitmapButtonIcon and fix the icons in panelButtonContainterSettings 2014-06-27 14:35 --- diff --git a/bbtk/src/bbcreaMaracasVisuBitmapButtonIcon.cxx b/bbtk/src/bbcreaMaracasVisuBitmapButtonIcon.cxx new file mode 100644 index 0000000..b02d67c --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuBitmapButtonIcon.cxx @@ -0,0 +1,54 @@ +//===== +// 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 "bbcreaMaracasVisuBitmapButtonIcon.h" +#include "bbcreaMaracasVisuPackage.h" +namespace bbcreaMaracasVisu +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,BitmapButtonIcon) +BBTK_BLACK_BOX_IMPLEMENTATION(BitmapButtonIcon,bbtk::AtomicBlackBox); +//===== +// 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) +//===== +void BitmapButtonIcon::Process() +{ + int index = bbGetInputIndex(); + + wxBitmap icon1(one_xpm); + wxBitmap icon2(two_xpm); + wxBitmap icon3(three_xpm); + wxBitmap icon4(four_xpm); + wxBitmap icon5(five_xpm); + + if(index==1){ bbSetOutputIcon( icon1 );} + if(index==2){ bbSetOutputIcon( icon2 );} + if(index==3){ bbSetOutputIcon( icon3 );} + if(index==4){ bbSetOutputIcon( icon4 );} + if(index==5){ bbSetOutputIcon( icon5 );} +} +//===== +// 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) +//===== +void BitmapButtonIcon::bbUserSetDefaultValues() +{ + +} +//===== +// 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) +//===== +void BitmapButtonIcon::bbUserInitializeProcessing() +{ + +} +//===== +// 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) +//===== +void BitmapButtonIcon::bbUserFinalizeProcessing() +{ + +} +} +// EO namespace bbcreaMaracasVisu + + diff --git a/bbtk/src/bbcreaMaracasVisuBitmapButtonIcon.h b/bbtk/src/bbcreaMaracasVisuBitmapButtonIcon.h new file mode 100644 index 0000000..dbe4950 --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuBitmapButtonIcon.h @@ -0,0 +1,52 @@ +//===== +// 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) +//===== +#ifndef __bbcreaMaracasVisuBitmapButtonIcon_h_INCLUDED__ +#define __bbcreaMaracasVisuBitmapButtonIcon_h_INCLUDED__ +#include "bbcreaMaracasVisu_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" +#include "wx/bitmap.h" + +#include "one.xpm" +#include "two.xpm" +#include "three.xpm" +#include "four.xpm" +#include "five.xpm" + +namespace bbcreaMaracasVisu +{ + +class bbcreaMaracasVisu_EXPORT BitmapButtonIcon + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(BitmapButtonIcon,bbtk::AtomicBlackBox); +//===== +// 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) +//===== + BBTK_DECLARE_INPUT(Index,int); + BBTK_DECLARE_OUTPUT(Icon,wxBitmap); + BBTK_PROCESS(Process); + void Process(); +//===== +// 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) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(BitmapButtonIcon,bbtk::AtomicBlackBox); +BBTK_NAME("BitmapButtonIcon"); +BBTK_AUTHOR("Carlos torres"); +BBTK_DESCRIPTION("No Description."); +BBTK_CATEGORY("empty"); +BBTK_INPUT(BitmapButtonIcon,Index,"Index btw 1-5",int,""); +BBTK_OUTPUT(BitmapButtonIcon,Icon,"Bitmap Icon",wxBitmap,""); +BBTK_END_DESCRIBE_BLACK_BOX(BitmapButtonIcon); +//===== +// 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) +//===== +} +// EO namespace bbcreaMaracasVisu + +#endif // __bbcreaMaracasVisuBitmapButtonIcon_h_INCLUDED__ + diff --git a/bbtk/src/bbcreaMaracasVisuPanelButtonContainer.cxx b/bbtk/src/bbcreaMaracasVisuPanelButtonContainer.cxx index 3695464..fc31b69 100644 --- a/bbtk/src/bbcreaMaracasVisuPanelButtonContainer.cxx +++ b/bbtk/src/bbcreaMaracasVisuPanelButtonContainer.cxx @@ -43,7 +43,6 @@ PanelButtonContainer::Process( ) ButtonContainerSettings* settings = new ButtonContainerSettings( ); printf("EED PanelButtonContainer::Process %d\n", bbGetInputIn( ).size() ); settings->AddButtons( bbGetInputIn( ) ); - PBContainer* panel = new PBContainer( myPanel, settings ); wxBoxSizer* sizer = new wxBoxSizer( wxHORIZONTAL ); sizer->Add( panel, 1, wxEXPAND, 0 ); diff --git a/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.cxx b/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.cxx index ecc5b70..3e8df9f 100644 --- a/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.cxx +++ b/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.cxx @@ -44,7 +44,8 @@ PanelButtonContainerSettings::Process( ) this->m_BSettings->groupName = bbGetInputGroupName( ); this->m_BSettings->buttonName = bbGetInputButtonName( ); this->m_BSettings->buttonDescription = bbGetInputButtonDescription( ); - this->m_BSettings->iconpath = bbGetInputIconpath( ); + //this->m_BSettings->iconpath = bbGetInputIconpath( ); + this->m_BSettings->icon = bbGetInputIcon( ); this->m_BSettings->panel = this->myPanel; this->m_BCSettingsVector = bbGetInputIn(); this->m_BCSettingsVector.push_back( this->m_BSettings ); diff --git a/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.h b/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.h index 69ac1f4..cb449d5 100644 --- a/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.h +++ b/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.h @@ -31,6 +31,7 @@ #define __bbcreaMaracasVisuPanelButtonContainerSettings_h_INCLUDED__ #include "bbcreaMaracasVisu_EXPORT.h" #include "bbtkWxBlackBox.h" +#include "wx/bitmap.h" #include #include @@ -53,6 +54,7 @@ namespace bbcreaMaracasVisu BBTK_DECLARE_INPUT(GroupName,std::string); BBTK_DECLARE_INPUT(ButtonName,std::string); BBTK_DECLARE_INPUT(Iconpath,std::string); + BBTK_DECLARE_INPUT(Icon,wxBitmap); BBTK_DECLARE_INPUT(ButtonDescription,std::string); BBTK_DECLARE_INPUT(Widget,wxWindow*); BBTK_DECLARE_OUTPUT(Out,BCStructVectorType); @@ -82,6 +84,7 @@ namespace bbcreaMaracasVisu BBTK_INPUT(PanelButtonContainerSettings,GroupName,"Group Name",std::string,""); BBTK_INPUT(PanelButtonContainerSettings,ButtonName,"Button Name",std::string,""); BBTK_INPUT(PanelButtonContainerSettings,Iconpath,"The path of the Icon",std::string,""); + BBTK_INPUT(PanelButtonContainerSettings,Icon,"The Icon",wxBitmap,""); BBTK_INPUT(PanelButtonContainerSettings,ButtonDescription,"Full description of the button",std::string,""); BBTK_INPUT(PanelButtonContainerSettings,Widget,"Panel associated to the button",wxWindow*,""); BBTK_OUTPUT(PanelButtonContainerSettings,Out,"ButtonContainerSettings List",BCStructVectorType,""); diff --git a/data/Icons/five.xpm b/data/Icons/five.xpm new file mode 100644 index 0000000..f79d4b6 --- /dev/null +++ b/data/Icons/five.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * five_xpm[] = { +"17 17 2 1", +" c None", +". c #000000", +" ............ ", +" ........... ", +" .......... ", +" ... ", +" ... ", +" ... .. ", +" ........... ", +" ............ ", +" ........... ", +" ... .... ", +" ... ", +" ... ", +" ... ", +" ... .... ", +" ........... ", +" .......... ", +" ........ "}; diff --git a/data/Icons/four.xpm b/data/Icons/four.xpm new file mode 100644 index 0000000..2926516 --- /dev/null +++ b/data/Icons/four.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * four_xpm[] = { +"17 17 2 1", +" c None", +". c #000000", +" .. ", +" ... ", +" ... ", +" .... .. ", +" .... .. ", +" .... .. ", +" .... .... ", +" .......... ", +" .......... ", +" ......... ", +" ... ", +" .. ", +" .. ", +" .. ", +" .. ", +" .. ", +" "}; diff --git a/data/Icons/one.xpm b/data/Icons/one.xpm new file mode 100644 index 0000000..74ba208 --- /dev/null +++ b/data/Icons/one.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char * one_xpm[] = { +"17 17 5 1", +" c None", +". c #000000", +"+ c #010201", +"@ c #010100", +"# c #020201", +" ... ", +" .... ", +" .....+ ", +" ....... ", +" ........ ", +" ......... ", +" ..... ...@ ", +" .... ...# ", +" .... .... ", +" .. .... ", +" .... ", +" .... ", +" .... ", +" .... ", +" .... ", +" ... ", +" "}; diff --git a/data/Icons/three.xpm b/data/Icons/three.xpm new file mode 100644 index 0000000..e5a3a99 --- /dev/null +++ b/data/Icons/three.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * three_xpm[] = { +"17 17 2 1", +" c None", +". c #000000", +" .... ", +" ....... ", +" ......... ", +" ........... ", +" ...... ..... ", +" ... .... ", +" .. ... ", +" ... ", +" ..... ", +" ...... ", +" ...... ", +" .... ", +" ... ", +" .... ", +" .. .... ", +" .............. ", +" ............ "}; diff --git a/data/Icons/two.xpm b/data/Icons/two.xpm new file mode 100644 index 0000000..124fc4e --- /dev/null +++ b/data/Icons/two.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * two_xpm[] = { +"17 17 2 1", +" c None", +". c #000000", +" ", +" ....... ", +" .......... ", +" ............ ", +" ..... .... ", +".... ... ", +"... ... ", +"... ... ", +" .... ", +" .... ", +" ..... ", +" ..... ", +" ..... ", +" ..... ", +" ............. ", +" ............. ", +" ............. "}; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.cxx index dfc9956..759faa3 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.cxx @@ -69,6 +69,7 @@ namespace creaButtonContainer return ( groupView ); } + // ---------------------------------------------------------------------------------- ButtonGroupFactory::ButtonContainer ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel ) { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.h index f0d96f9..a349df6 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/buttonGroupFactory.h @@ -98,6 +98,7 @@ namespace creaButtonContainer */ virtual ~ButtonGroupFactory( ); + /*! @fn ButtonGroupContainer ButtonGroupFactory::CreateButtonGroupContainer( wxWindow* parent, ButtonGroupModel* settings ); * @brief This method creates the ButtonGroupContainer. * @param parent the wxWindow* parent to be attached. @@ -109,6 +110,8 @@ namespace creaButtonContainer CreateButtonGroupContainer( wxWindow* parent, ButtonGroupModel* settings ); private: + + /*! @fn ButtonContainer ButtonGroupFactory::GetButtons( wxWindow* parent, ButtonList buttonModel ); * @brief This method creates a wx button container for a group. * @param parent the wxWindow* parent to be attached. diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.cxx index 7acfd8a..d3f4269 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.cxx @@ -44,6 +44,7 @@ namespace creaButtonContainer ContainerSettings::~ContainerSettings( ) { } + // ---------------------------------------------------------------------------------- ButtonGroupMap ContainerSettings::GetButtonGroupContainer( ) @@ -56,6 +57,7 @@ namespace creaButtonContainer { return ( this->m_GroupNameList ); } + // ---------------------------------------------------------------------------------- void ContainerSettings::SetButtonGroupContainer( ButtonGroupMap bgContainer ) @@ -68,14 +70,15 @@ namespace creaButtonContainer { this->m_GroupNameList = gNameList; } + // ---------------------------------------------------------------------------------- void ContainerSettings::AddButton( const StringType & groupName, - const StringType &buttonName, const StringType &iconpath, + const StringType &buttonName, const wxBitmap &icon, const StringType &buttonDescription, FunctionEventType event ) { ButtonPair* pair = new ButtonPair( - new ButtonInfo( buttonName, iconpath ), + new ButtonInfo( buttonName, icon ), new ButtonAction( buttonDescription, event ) ); try { @@ -105,7 +108,7 @@ namespace creaButtonContainer ContainerSettings::AddButton( BCSettingsStruct* info ) { ButtonPair* pair = new ButtonPair( - new ButtonInfo( info->buttonName, info->iconpath ), + new ButtonInfo( info->buttonName, info->icon ), new ButtonAction( info->buttonDescription, info->eventFunction ) ); try { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.h index 4d6ddb9..cb5a4f5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.h @@ -34,6 +34,7 @@ #define BUTTONGROUPSETTINGS_H_ #include +#include #include "structBCSettings.h" #include "system.h" @@ -80,6 +81,7 @@ namespace creaButtonContainer */ virtual ~ContainerSettings( ); + // ---------------------------------------------------------------------------------- /*! @fn ButtonGroupMap ContainerSettings::GetButtonGroupContainer( ) * @brief This method returns a container of buttons ordered by group. @@ -94,6 +96,7 @@ namespace creaButtonContainer */ KeyMapList GetGroupNameList( ); + // ---------------------------------------------------------------------------------- /*! void ContainerSettings::SetButtonGroupContainer( ButtonGroupMap m_ButtonGroupContainer ) * @brief This method allows to create the ButtonGroupContainer. @@ -108,6 +111,7 @@ namespace creaButtonContainer */ void SetGroupNameList( KeyMapList gNameList ); + // ---------------------------------------------------------------------------------- /*! * @fn ContainerSettings::AddButton( const std::string & groupName, const std::string buttonName, @@ -124,7 +128,7 @@ namespace creaButtonContainer */ void AddButton( const StringType & groupName, const StringType &buttonName, - const StringType &iconpath, const StringType &buttonDescription, + const wxBitmap &icon, const StringType &buttonDescription, FunctionEventType event ); // ---------------------------------------------------------------------------------- /*! @fn void AddButton( BCSettingsStruct* info ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/structBCSettings.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/structBCSettings.h index c7b015d..80cda32 100755 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/structBCSettings.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/structBCSettings.h @@ -54,6 +54,7 @@ namespace creaButtonContainer StringType groupName; //! #include #include "functor.h" +#include "wx/bitmap.h" /*! @namespace * @brief Contains the creaButtonContainer library included in creaMaracasVisu. @@ -51,6 +52,11 @@ namespace creaButtonContainer */ typedef std::string StringType; // ---------------------------------------------------------------------------------- + /*! @typedef std::string* BitmapType; + * @brief Defines the BitmapType type. + */ + typedef wxBitmap BitmapType; + // ---------------------------------------------------------------------------------- /*! @typedef model::TFunctor* FunctionEventType; * @brief Defines the FunctionEventType type. */ @@ -61,12 +67,14 @@ namespace creaButtonContainer * First is the button description, Second FunctionEventType */ typedef std::pair< StringType, FunctionEventType > ButtonAction; + // ---------------------------------------------------------------------------------- - /*! @typedef std::pair< std::string, std::string > ButtonInfo; + /*! @typedef std::pair< std::string, BitmapType > ButtonInfo; * @brief Defines the ButtonInfo type. * First is the ButtonName and Second is the IconPath */ - typedef std::pair< StringType, StringType > ButtonInfo; + typedef std::pair< StringType, BitmapType > ButtonInfo; + // ---------------------------------------------------------------------------------- /*! @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair; * @brief Defines the ButtonPair type. @@ -77,11 +85,13 @@ namespace creaButtonContainer * @brief Defines the KeyMapList type. */ typedef std::list< StringType > 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. diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.cxx index 4795f77..39a30e3 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.cxx @@ -41,19 +41,18 @@ namespace creaButtonContainer { this->m_ButtonPair = pair; StringType wXbuttonName = this->m_ButtonPair->first->first; - StringType wXiconPath = this->m_ButtonPair->first->second; + BitmapType wXicon = this->m_ButtonPair->first->second; StringType wXdescription = this->m_ButtonPair->second->first; 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 ) ), + wXicon, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator, buttonName ); this->SetToolTip( description ); } - + // ---------------------------------------------------------------------------------- Button::~Button( ) { @@ -65,13 +64,20 @@ namespace creaButtonContainer { return ( this->m_ButtonPair->first->first ); } - + // ---------------------------------------------------------------------------------- - StringType + BitmapType + Button::GetIcon( ) + { + return ( this->m_ButtonPair->first->second ); + } + + // ---------------------------------------------------------------------------------- + /*StringType Button::GetIconPath( ) { return ( this->m_ButtonPair->first->second ); - } + }*/ // ---------------------------------------------------------------------------------- StringType diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h index e8024bb..b7a8fb6 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h @@ -36,6 +36,7 @@ #include #include #include +#include #include "system.h" @@ -67,6 +68,7 @@ namespace creaButtonContainer // ---------------------------------------------------------------------------------- //end of typedef definition public: + // ---------------------------------------------------------------------------------- /*! @fn Button::Button( wxWindow* parent, long id, ButtonPair* pair ); * @brief This is the constructor. @@ -95,13 +97,22 @@ namespace creaButtonContainer */ StringType GetButtonName( ); + // ---------------------------------------------------------------------------------- /*! @fn std::string Button::GetIconPath( ); * @brief This method returns the iconPath of the button. * @return std::string The path of the icon. */ - StringType - GetIconPath( ); + BitmapType + GetIcon( ); + + // ---------------------------------------------------------------------------------- + /*! @fn std::string Button::GetIconPath( ); + * @brief This method returns the iconPath of the button. + * @return std::string The path of the icon. + */ + //StringType + //GetIconPath( ); // ---------------------------------------------------------------------------------- /*! @fn std::string Button::GetDescription( ); * @brief This method returns a the description of the button. @@ -122,6 +133,7 @@ namespace creaButtonContainer // ---------------------------------------------------------------------------------- private: ButtonPair* m_ButtonPair; //! 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 ); + settings->AddButton( ( *it ), ( *it1 )->first->first, ( *it1 )->first->second, ( *it1 )->second->first, functor ); }//rof }//rof }//yrt @@ -122,10 +122,11 @@ namespace creaPanelButtonContainer { this->m_GroupNameList = m_GroupNameList; } + // ---------------------------------------------------------------------------------- void ButtonContainerSettings::AddButton( const StringType & groupName, - const StringType &buttonName, const StringType &iconpath, + const StringType &buttonName, const wxBitmap &icon, const StringType &buttonDescription, PanelButton panel ) { try @@ -140,7 +141,7 @@ namespace creaPanelButtonContainer } panel->Show( false ); ButtonPair* pair = new ButtonPair( - new ButtonInfo( buttonName, iconpath ), + new ButtonInfo( buttonName, icon ), new ActionButton( buttonDescription, panel ) ); for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it != this->m_GroupNameList.end( ); ++it ) @@ -163,6 +164,7 @@ namespace creaPanelButtonContainer << "exception: " << e.what( ) << std::endl; }//hctac } + // ---------------------------------------------------------------------------------- void ButtonContainerSettings::AddButton( BCPSettingsStruct* info ) @@ -179,7 +181,7 @@ namespace creaPanelButtonContainer } info->panel->Show( false ); ButtonPair* pair = new ButtonPair( - new ButtonInfo( info->buttonName, info->iconpath ), + new ButtonInfo( info->buttonName, info->icon ), new ActionButton( info->buttonDescription, info->panel ) ); for( KeyMapList::iterator it = this->m_GroupNameList.begin( ); it != this->m_GroupNameList.end( ); ++it ) @@ -201,6 +203,7 @@ namespace creaPanelButtonContainer exit( 1 ); }//hctac } + // ---------------------------------------------------------------------------------- void ButtonContainerSettings::AddButtons( BCStructVectorType infoList ) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h index ef48196..a502b9a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h @@ -34,6 +34,7 @@ #define BUTTONCONTAINERSETTINGS_H_ #include +#include #include #include @@ -82,12 +83,14 @@ namespace creaPanelButtonContainer * First is the button description, Second FunctionEventType */ typedef std::pair< std::string, PanelButton > ActionButton; + // ---------------------------------------------------------------------------------- - /*! @typedef std::pair< std::string, std::string > ButtonInfo; + /*! @typedef std::pair< std::string, wxBitmap > ButtonInfo; * @brief Defines the ButtonInfo type. - * First is the ButtonName, Second is the ImageIconPath + * First is the ButtonName, Second is the ImageIcon */ - typedef std::pair< std::string, std::string > ButtonInfo; + typedef std::pair< std::string, wxBitmap > ButtonInfo; + // ---------------------------------------------------------------------------------- /*! @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair; * @brief Defines the ButtonPair type. @@ -98,11 +101,13 @@ namespace creaPanelButtonContainer * @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::list< ButtonPair* > ButtonList; + // ---------------------------------------------------------------------------------- /*! @typedef std::map< std::string, ButtonList > ButtonGroupMap; * @brief Defines the ButtonGroupMap type. @@ -130,6 +135,7 @@ namespace creaPanelButtonContainer */ virtual ~ButtonContainerSettings( ); + // ---------------------------------------------------------------------------------- /*! @fn ButtonGroupMap GetButtonGroupContainer( ); * @brief This method returns ButtonGroupMap with all buttons. @@ -176,6 +182,7 @@ namespace creaPanelButtonContainer */ void SetGroupNameList( KeyMapList gNameList ); + // ---------------------------------------------------------------------------------- /*! @fn void AddButton( const std::string &groupName, const std::string &buttonName, const std::string &iconpath, const std::string &buttonDescription, @@ -190,8 +197,9 @@ namespace creaPanelButtonContainer */ void AddButton( const std::string &groupName, const std::string &buttonName, - const std::string &iconpath, const std::string &buttonDescription, + const wxBitmap &icon, const std::string &buttonDescription, PanelButton panel ); + // ---------------------------------------------------------------------------------- /*! @fn void AddButton( BCPSettingsStruct* info ); * @brief This method adds a new button into a group of buttons. @@ -200,6 +208,7 @@ namespace creaPanelButtonContainer */ void AddButton( BCPSettingsStruct* info ); + // ---------------------------------------------------------------------------------- /*! @fn void AddButtons( BCStructVectorType infoList ); * @brief This method adds new buttons into the container. diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/structBCPSettings.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/structBCPSettings.h index 1c74cf3..6802a24 100755 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/structBCPSettings.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/structBCPSettings.h @@ -35,6 +35,7 @@ #include #include +#include /*! @namespace * @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu. @@ -49,6 +50,7 @@ namespace creaPanelButtonContainer std::string groupName; //!