]> Creatis software - creaMaracasVisu.git/commitdiff
CreaPanelButtonContainer boxes
authorDiego Caceres <Diego.Caceres@creatis.insa-lyon.fr>
Fri, 13 May 2011 16:45:27 +0000 (16:45 +0000)
committerDiego Caceres <Diego.Caceres@creatis.insa-lyon.fr>
Fri, 13 May 2011 16:45:27 +0000 (16:45 +0000)
bbtk/src/bbcreaMaracasVisuPanelButtonContainer.cxx [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuPanelButtonContainer.h [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.cxx [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuPanelButtonContainerSettings.h [new file with mode: 0644]
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h

diff --git a/bbtk/src/bbcreaMaracasVisuPanelButtonContainer.cxx b/bbtk/src/bbcreaMaracasVisuPanelButtonContainer.cxx
new file mode 100644 (file)
index 0000000..2d771f9
--- /dev/null
@@ -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 (file)
index 0000000..1534987
--- /dev/null
@@ -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 <structButtonContainerSettings.h>
+#include <buttonContainerSettings.h>
+#include <creaPanelButtonContainer.h>
+
+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 (file)
index 0000000..7498673
--- /dev/null
@@ -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 (file)
index 0000000..9db1bd9
--- /dev/null
@@ -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 <string>
+#include <vector>
+
+#include <structButtonContainerSettings.h>
+
+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_
index 4a685f4173df78a8f3a214263862704f493ae8cb..40701a9e678685155563d53bd59eb501b980efaf 100644 (file)
@@ -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
        }
 
index e568683caf874eadf01905c80899f70c4be37a3b..55b6e2c1183e52c4c7db1d859b58201227a26848 100644 (file)
@@ -13,6 +13,7 @@
 #include <list>
 #include <map>
 #include <wx/panel.h>
+#include <vector>
 
 #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;