From: Diego Caceres Date: Fri, 13 May 2011 16:45:27 +0000 (+0000) Subject: CreaPanelButtonContainer boxes X-Git-Tag: v1.0.4~121 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=42ab109aa8896b41a401e00e8595acf2bd1d3a92;p=creaMaracasVisu.git CreaPanelButtonContainer boxes --- diff --git a/bbtk/src/bbcreaMaracasVisuPanelButtonContainer.cxx b/bbtk/src/bbcreaMaracasVisuPanelButtonContainer.cxx new file mode 100644 index 0000000..2d771f9 --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuPanelButtonContainer.cxx @@ -0,0 +1,65 @@ +//===== +// 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 "bbcreaMaracasVisuPanelButtonContainer.h" +#include "bbcreaMaracasVisuPackage.h" +namespace bbcreaMaracasVisu +{ + + BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,PanelButtonContainer) + BBTK_BLACK_BOX_IMPLEMENTATION(PanelButtonContainer,bbtk::WxBlackBox) +; +//===== +// 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 +PanelButtonContainer::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) +//===== +void +PanelButtonContainer::CreateWidget( wxWindow* parent ) +{ + this->myPanel = new wxPanel( parent, -1 ); + wxWindow* ww = bbCreateWidgetOfInput( "In", this->myPanel ); + ButtonContainerSettings* settings = new ButtonContainerSettings( ); + settings->AddButtons( bbGetInputIn( ) ); + PBContainer* panel = new PBContainer( myPanel, + settings ); + wxBoxSizer* sizer = new wxBoxSizer( wxHORIZONTAL ); + sizer->Add( panel, 1, wxEXPAND, 0 ); + this->myPanel->SetSizer(sizer); + bbSetOutputWidget( myPanel); + +} +//===== +// 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 +PanelButtonContainer::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 +PanelButtonContainer::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 +PanelButtonContainer::bbUserFinalizeProcessing( ) +{ + +} +} +// EO namespace bbcreaMaracasVisu + + diff --git a/bbtk/src/bbcreaMaracasVisuPanelButtonContainer.h b/bbtk/src/bbcreaMaracasVisuPanelButtonContainer.h new file mode 100644 index 0000000..1534987 --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuPanelButtonContainer.h @@ -0,0 +1,55 @@ +//===== +// 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) +//===== +#ifdef _USE_WXWIDGETS_ +#ifndef __bbcreaMaracasVisuPanelButtonContainer_h_INCLUDED__ +#define __bbcreaMaracasVisuPanelButtonContainer_h_INCLUDED__ +#include "bbcreaMaracasVisu_EXPORT.h" +#include "bbtkWxBlackBox.h" +#include +#include +#include + +namespace bbcreaMaracasVisu +{ + typedef creaPanelButtonContainer::ButtonContainerSettings ButtonContainerSettings; + typedef creaPanelButtonContainer::PanelButtonContainer PBContainer; + typedef std::vector< BCSettingsStruct* > BCStructVectorType; +class bbcreaMaracasVisu_EXPORT PanelButtonContainer + : + public bbtk::WxBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(PanelButtonContainer,bbtk::WxBlackBox); +//===== +// 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(Title,std::string); + BBTK_DECLARE_INPUT(In,BCStructVectorType); + BBTK_PROCESS(Process); + void Process(); + BBTK_CREATE_WIDGET(CreateWidget); + void CreateWidget(wxWindow*); + private: + wxPanel* myPanel; +//===== +// 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(PanelButtonContainer,bbtk::WxBlackBox); +BBTK_NAME("PanelButtonContainer"); +BBTK_AUTHOR("caceres@creatis.insa-lyon.fr"); +BBTK_DESCRIPTION("This blackbox creates a Widget of creaButtonContainerPanel"); +BBTK_CATEGORY("__CategoryBlackBox__"); +BBTK_INPUT(PanelButtonContainer,Title,"Title prepended to the text",std::string,""); +BBTK_INPUT(PanelButtonContainer,In,"ButtonContainerSettings List",BCStructVectorType,""); +BBTK_END_DESCRIBE_BLACK_BOX(PanelButtonContainer); +//===== +// 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 // __bbcreaMaracasVisuPanelButtonContainer_h_INCLUDED__ +#endif // _USE_WXWIDGETS_ + diff --git a/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.cxx b/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.cxx new file mode 100644 index 0000000..7498673 --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.cxx @@ -0,0 +1,82 @@ +//===== +// 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 "bbcreaMaracasVisuPanelButtonContainerSettings.h" +#include "bbcreaMaracasVisuPackage.h" +namespace bbcreaMaracasVisu +{ + + BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,PanelButtonContainerSettings) + BBTK_BLACK_BOX_IMPLEMENTATION(PanelButtonContainerSettings,bbtk::WxBlackBox) +; +//===== +// 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 +PanelButtonContainerSettings::Process( ) +{ + + // std::string msg; + // if (bbGetInputTitle()!="") + // { + // msg = bbGetInputTitle()+": " + bbGetInputIn(); + // } + // else + // { + // msg = bbGetInputIn(); + // } + // ((wxStaticText*)bbGetOutputWidget())->SetLabel( bbtk::std2wx( msg ) ); + + this->m_BSettings->groupName = bbGetInputGroupName( ); + this->m_BSettings->buttonName = bbGetInputButtonName( ); + this->m_BSettings->buttonDescription = bbGetInputButtonDescription( ); + this->m_BSettings->iconpath = bbGetInputIconpath( ); + this->m_BSettings->panel = this->myPanel; + this->m_BCSettingsVector = bbGetInputIn(); + this->m_BCSettingsVector.push_back( this->m_BSettings ); + bbSetOutputOut( bbGetInputIn() ); + +} +//===== +// 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 +PanelButtonContainerSettings::CreateWidget( wxWindow* parent ) +{ + this->myPanel = new wxPanel( parent, -1 ); + wxWindow* w = bbCreateWidgetOfInput("Widget", myPanel); + wxWindow* ww = bbCreateWidgetOfInput("In", parent); + + wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL); + sizer->Add(w,1,wxEXPAND, 0); + this->myPanel->SetSizer(sizer); + bbSetOutputWidget( myPanel ); +} +//===== +// 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 +PanelButtonContainerSettings::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 +PanelButtonContainerSettings::bbUserInitializeProcessing( ) +{ + this->m_BSettings = new BCSettingsStruct(); +} +//===== +// 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 +PanelButtonContainerSettings::bbUserFinalizeProcessing( ) +{ + +} +} +// EO namespace bbcreaMaracasVisu + + diff --git a/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.h b/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.h new file mode 100644 index 0000000..9db1bd9 --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.h @@ -0,0 +1,70 @@ +//===== +// 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) +//===== +#ifdef _USE_WXWIDGETS_ +#ifndef __bbcreaMaracasVisuPanelButtonContainerSettings_h_INCLUDED__ +#define __bbcreaMaracasVisuPanelButtonContainerSettings_h_INCLUDED__ +#include "bbcreaMaracasVisu_EXPORT.h" +#include "bbtkWxBlackBox.h" + +#include +#include + +#include + +namespace bbcreaMaracasVisu +{ + typedef std::vector< BCSettingsStruct* > BCStructVectorType; + class bbcreaMaracasVisu_EXPORT PanelButtonContainerSettings : + public bbtk::WxBlackBox + { + BBTK_BLACK_BOX_INTERFACE(PanelButtonContainerSettings,bbtk::WxBlackBox); + //===== + // 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(Title,std::string); + BBTK_DECLARE_INPUT(In,BCStructVectorType); + BBTK_DECLARE_INPUT(GroupName,std::string); + BBTK_DECLARE_INPUT(ButtonName,std::string); + BBTK_DECLARE_INPUT(Iconpath,std::string); + BBTK_DECLARE_INPUT(ButtonDescription,std::string); + BBTK_DECLARE_INPUT(Widget,wxWindow*); + BBTK_DECLARE_OUTPUT(Out,BCStructVectorType); + BBTK_PROCESS(Process); + + void + Process( );BBTK_CREATE_WIDGET(CreateWidget); + void + CreateWidget( wxWindow* ); + + private: + BCSettingsStruct* m_BSettings; + BCStructVectorType m_BCSettingsVector; + wxPanel* myPanel; + //===== + // 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(PanelButtonContainerSettings,bbtk::WxBlackBox); + BBTK_NAME("PanelButtonContainerSettings"); + BBTK_AUTHOR("Info-Dev"); + BBTK_DESCRIPTION("_description_"); + BBTK_CATEGORY("__CategoryBlackBox__"); + BBTK_INPUT(PanelButtonContainerSettings,Title,"Title prepended to the text",std::string,""); + BBTK_INPUT(PanelButtonContainerSettings,In,"ButtonContainerSettings List",BCStructVectorType,""); + 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,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,""); + BBTK_END_DESCRIBE_BLACK_BOX(PanelButtonContainerSettings); + //===== + // 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 // __bbcreaMaracasVisuPanelButtonContainerSettings_h_INCLUDED__ +#endif // _USE_WXWIDGETS_ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.cxx index 4a685f4..40701a9 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.cxx @@ -121,13 +121,12 @@ namespace creaPanelButtonContainer } void - ButtonContainerSettings::AddButtons( BCSetListType infoList ) + ButtonContainerSettings::AddButtons( BCStructVectorType infoList ) { - for( BCSetListType::iterator it = infoList.begin( ); it + for( BCStructVectorType::iterator it = infoList.begin( ); it != infoList.end( ); ++it ) { - BCSettingsStruct* info = *it; - this->AddButton( info ); + this->AddButton( *it ); }//rof } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h index e568683..55b6e2c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h @@ -13,6 +13,7 @@ #include #include #include +#include #include "structButtonContainerSettings.h" #include "containerSettings.h" @@ -31,7 +32,7 @@ namespace creaPanelButtonContainer typedef std::list< std::string > KeyMapList; typedef std::list< ButtonPair* > ButtonList; typedef std::map< std::string, ButtonList > ButtonGroupMap; - typedef std::list< BCSettingsStruct* > BCSetListType; + typedef std::vector< BCSettingsStruct* > BCStructVectorType; class ButtonContainerSettings { public: @@ -58,7 +59,7 @@ namespace creaPanelButtonContainer AddButton( BCSettingsStruct* info ); void - AddButtons( BCSetListType infoList ); + AddButtons( BCStructVectorType infoList ); private: ButtonGroupMap m_ButtonGroupContainer;