]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Thu, 15 May 2008 08:02:35 +0000 (08:02 +0000)
committerguigues <guigues>
Thu, 15 May 2008 08:02:35 +0000 (08:02 +0000)
17 files changed:
kernel/appli/bbCreateBlackBox/CMakeLists.txt
kernel/appli/bbCreatePackage/CMakeLists.txt
kernel/cmake/BBTKConfigurePackage_bbs.cmake
kernel/install/linux/CMakeLists.txt
kernel/src/bbtkBlackBox.cxx
kernel/src/bbtkBlackBox.h
kernel/src/bbtkInterpreter.cxx
kernel/src/bbtkInterpreter.h
kernel/src/bbtkWxBlackBox.cxx
kernel/src/bbtkWxBlackBox.h
kernel/src/bbtkWxGUIConsole.cxx
kernel/src/bbtkWxGUIScriptingInterface.cxx
packages/std/src/bbstdExecSystemCommand.cxx
packages/toolsbbtk/bbs/appli/GUICreateBlackBox.bbs [moved from packages/toolsbbtk/bbs/appli/CreateBlackBox.bbs with 100% similarity]
packages/toolsbbtk/bbs/appli/GUICreatePackage.bbs [moved from packages/toolsbbtk/bbs/appli/CreatePackage.bbs with 64% similarity]
packages/wx/src/bbwxCommandButton.cxx
packages/wxvtk/src/bbwxvtkViewer2D.cxx

index 0069e4294ab4774213d9cca6f13cb410e83f3105..ad8f60042e9398409e918849ab47d14791e3e04c 100644 (file)
@@ -56,7 +56,7 @@ IF(UNIX)
     )
   # Install tree
   INSTALL(
     )
   # Install tree
   INSTALL(
-    PROGRAMS ${BBTK_BINARY_DIR}/bin/bbCreateBlackBox
+    FILES ${BBTK_BINARY_DIR}/bin/bbCreateBlackBox
     DESTINATION bin
     PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
     )
     DESTINATION bin
     PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
     )
index 31a21b6ceedf8c58a92640e156bea2ed57001cf1..d31261ae711581a643c2aaccaaceb5d1f7cdd13c 100644 (file)
@@ -37,6 +37,7 @@ INSTALL(
 # Configure / Install the script bbCreatePackage
 SET(bbCreatePackage_DATA_REL_PATH_FROM_BIN ../${BBTK_DATA_REL_PATH}/${bbCreatePackage_DATA_REL_PATH_FROM_DATA})
 FILE(TO_NATIVE_PATH ${bbCreatePackage_DATA_REL_PATH_FROM_BIN} bbCreatePackage_DATA_REL_PATH_FROM_BIN)
 # Configure / Install the script bbCreatePackage
 SET(bbCreatePackage_DATA_REL_PATH_FROM_BIN ../${BBTK_DATA_REL_PATH}/${bbCreatePackage_DATA_REL_PATH_FROM_DATA})
 FILE(TO_NATIVE_PATH ${bbCreatePackage_DATA_REL_PATH_FROM_BIN} bbCreatePackage_DATA_REL_PATH_FROM_BIN)
+
 IF(WIN32)
   # Build tree 
   CONFIGURE_FILE(
 IF(WIN32)
   # Build tree 
   CONFIGURE_FILE(
@@ -54,10 +55,7 @@ IF(WIN32)
     PROGRAMS ${BBTK_BINARY_DIR}/Debug/bbCreatePackage.bat
     DESTINATION bin
     )
     PROGRAMS ${BBTK_BINARY_DIR}/Debug/bbCreatePackage.bat
     DESTINATION bin
     )
-ENDIF(WIN32)
-
-
-IF(UNIX)
+ELSE(WIN32)
   # Build tree 
   CONFIGURE_FILE(
     ${CMAKE_CURRENT_SOURCE_DIR}/bbCreatePackage.sh.in
   # Build tree 
   CONFIGURE_FILE(
     ${CMAKE_CURRENT_SOURCE_DIR}/bbCreatePackage.sh.in
@@ -66,10 +64,11 @@ IF(UNIX)
     )
   # Install tree
   INSTALL(
     )
   # Install tree
   INSTALL(
-    PROGRAMS ${BBTK_BINARY_DIR}/bin/bbCreatePackage
+    FILES ${BBTK_BINARY_DIR}/bin/bbCreatePackage
     DESTINATION bin
     DESTINATION bin
+    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
     )
     )
-ENDIF(UNIX)
+ENDIF(WIN32)
 
 
 
 
 
 
index 17c24d4becee9aeba26777590e2112ef556a780f..025a901a17eb5b1b85358afe14d4f1dd5a470807 100644 (file)
@@ -70,12 +70,12 @@ IF (BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_BBS_APP)
     INSTALL(
       FILES ${BBTK_BIN_PATH}/${OUTPUT}
       DESTINATION bin
     INSTALL(
       FILES ${BBTK_BIN_PATH}/${OUTPUT}
       DESTINATION bin
+      PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
       )
       )
-    ADD_CUSTOM_TARGET(${OUTPUT} ALL
+    ADD_CUSTOM_TARGET(
+      ${OUTPUT} ALL
       DEPENDS ${BBTK_BIN_PATH}/${OUTPUT} 
       )
       DEPENDS ${BBTK_BIN_PATH}/${OUTPUT} 
       )
-
-    
   ENDFOREACH(bbs)
 ENDIF (BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_BBS_APP)
 #----------------------------------------------------------------------------
   ENDFOREACH(bbs)
 ENDIF (BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_BBS_APP)
 #----------------------------------------------------------------------------
index 3c73550dd453bd989450accaf1fc862b96a6c720..853259d561fdcb2d3029f8d151ccb069459ee5ff 100644 (file)
@@ -1,4 +1,5 @@
 # Uninstall script
 # Uninstall script
-INSTALL( PROGRAMS bbtk-uninstall.sh
+INSTALL( 
+  PROGRAMS bbtk-uninstall.sh
   DESTINATION bin
 )
   DESTINATION bin
 )
index 7b3c4a8e319b0d4eac2e9d4c5c1b59eea3913776..5cffb502dad9552a427eb085437c2bc9668c7f11 100644 (file)
@@ -3,8 +3,8 @@
 Program:   bbtk
 Module:    $RCSfile: bbtkBlackBox.cxx,v $
 Language:  C++
 Program:   bbtk
 Module:    $RCSfile: bbtkBlackBox.cxx,v $
 Language:  C++
-Date:      $Date: 2008/05/07 12:59:23 $
-Version:   $Revision: 1.18 $
+Date:      $Date: 2008/05/15 08:02:36 $
+Version:   $Revision: 1.19 $
                                                                                 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
 l'Image). All rights reserved. See doc/license.txt or
                                                                                 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
 l'Image). All rights reserved. See doc/license.txt or
@@ -434,6 +434,16 @@ namespace bbtk
        this->bbSetStatus(MODIFIED); 
        return;
       }
        this->bbSetStatus(MODIFIED); 
        return;
       }
+    if ( (c==bbGetInputConnectorMap().find("WinClose")->second) )
+      //        && (bbCanReact()))
+      {
+       bbtkDebugMessage("modified",2,
+                        "-> Close triggered by WinClose input change"
+                        <<std::endl);
+       this->bbHideWindow();
+       this->bbSetStatus(MODIFIED); 
+       return;
+      }
     
     if ( ( bbBoxProcessModeIsReactive()  ||
           (c==bbGetInputConnectorMap().find("BoxExecute")->second))
     
     if ( ( bbBoxProcessModeIsReactive()  ||
           (c==bbGetInputConnectorMap().find("BoxExecute")->second))
index eb6f46c60e8e030f9ee6e9daf1578fbbda2df6f7..ba86ed664290cfeceb395a7e45c974dd2ccb588b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.h,v $
   Language:  C++
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.h,v $
   Language:  C++
-  Date:      $Date: 2008/05/06 13:45:12 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2008/05/15 08:02:36 $
+  Version:   $Revision: 1.10 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See doc/license.txt or
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See doc/license.txt or
@@ -340,6 +340,7 @@ bool reaction = true);
     virtual void bbShowWindow(Connection::Pointer caller) { }
  
     virtual void bbHideWindow() {}
     virtual void bbShowWindow(Connection::Pointer caller) { }
  
     virtual void bbHideWindow() {}
+    virtual void bbCloseWindow() { }
    //==================================================================
 
     //@}
    //==================================================================
 
     //@}
index 62f523319641ce16d9e5e447d22207fcbd2ebc81..f908f65155cf2c42396d08a64f2b98edd2a265b6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $ $
   Language:  C++
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/04/25 08:05:23 $
-  Version:   $Revision: 1.65 $
+  Date:      $Date: 2008/05/15 08:02:36 $
+  Version:   $Revision: 1.66 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -42,25 +42,48 @@ namespace bbtk
  //=======================================================================
   Interpreter::Pointer Interpreter::New(const std::string& cpp_file) 
   {
  //=======================================================================
   Interpreter::Pointer Interpreter::New(const std::string& cpp_file) 
   {
-    bbtkDebugMessage("Kernel",9,"Interpreter::New()"<<std::endl);
+    bbtkDebugMessage("Kernel",9,"Interpreter::New('"<<cpp_file<<"')"<<std::endl);
     return MakePointer(new Interpreter(cpp_file));
   }
  //=======================================================================
 
     return MakePointer(new Interpreter(cpp_file));
   }
  //=======================================================================
 
+ //=======================================================================
+  Interpreter::Pointer Interpreter::New(VirtualExec::Pointer e) 
+  {
+    bbtkDebugMessage("Kernel",9,"Interpreter::New(VirtualExec)"<<std::endl);
+    return MakePointer(new Interpreter(e));
+  }
+ //=======================================================================
+
  //=======================================================================
   Interpreter::Interpreter(const std::string& cpp_file) 
  //=======================================================================
   Interpreter::Interpreter(const std::string& cpp_file) 
-    :
-    mUser(0),
-    mCommandLine(false),
-    mThrow(false)
   {
   {
+    Init(VirtualExec::Pointer(), cpp_file);
+  }
+  //=======================================================================
+
+ //=======================================================================
+  Interpreter::Interpreter(VirtualExec::Pointer e) 
+  {
+    Init(e,"");
+  }
+  //=======================================================================
 
 
+  //=======================================================================
+  void Interpreter::Init(VirtualExec::Pointer e, const std::string& cpp_file) 
+  {
+    mUser = 0;
+    mCommandLine = false;
+    mThrow = false;
     bufferNb =0;  
     bbtk::MessageManager::RegisterMessageType("echo","Level>0 : Prints the output of the 'print' commands of the user.\n\tLevel>1 : Prints the command being interpreted",1);
     bbtk::MessageManager::RegisterMessageType("Interpreter","Messages of the interpreter",0);
     bbtkDebugMessageInc("Interpreter",9,"Interpreter::Interpreter()" <<std::endl);
     bufferNb =0;  
     bbtk::MessageManager::RegisterMessageType("echo","Level>0 : Prints the output of the 'print' commands of the user.\n\tLevel>1 : Prints the command being interpreted",1);
     bbtk::MessageManager::RegisterMessageType("Interpreter","Messages of the interpreter",0);
     bbtkDebugMessageInc("Interpreter",9,"Interpreter::Interpreter()" <<std::endl);
-    if (cpp_file.size()!=0)
+    if (e)
+      {
+       mVirtualExecuter = e;
+      }
+    else if (cpp_file.size()!=0)
       {
        mVirtualExecuter = boost::static_pointer_cast<VirtualExec>(bbtk::Transcriptor::New(cpp_file));
       }
       {
        mVirtualExecuter = boost::static_pointer_cast<VirtualExec>(bbtk::Transcriptor::New(cpp_file));
       }
@@ -72,7 +95,7 @@ namespace bbtk
       }
 
     // Lock this pointer or will auto-destruct !!
       }
 
     // Lock this pointer or will auto-destruct !!
-    mVirtualExecuter->SetInterpreter(MakePointer(this,true));
+    if (!e) mVirtualExecuter->SetInterpreter(MakePointer(this,true));
     
     // For the time being, comment out previous line, and
     // uncomment next line to check Transcriptor
     
     // For the time being, comment out previous line, and
     // uncomment next line to check Transcriptor
index 2e7ba4df6f2c0462179108c1bcf6e910f3e2d277..29708546c557602ff859f96c18050af0c6121a6f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.h,v $ $
   Language:  C++
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.h,v $ $
   Language:  C++
-  Date:      $Date: 2008/05/06 13:45:12 $
-  Version:   $Revision: 1.30 $
+  Date:      $Date: 2008/05/15 08:02:36 $
+  Version:   $Revision: 1.31 $
 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -90,6 +90,7 @@ namespace bbtk
     typedef Object Superclass;
   public:
     static Pointer New(const std::string& cpp_file = "");
     typedef Object Superclass;
   public:
     static Pointer New(const std::string& cpp_file = "");
+    static Pointer New(VirtualExec::Pointer);
 
     typedef enum 
       {
 
     typedef enum 
       {
@@ -267,6 +268,10 @@ namespace bbtk
     /// Constructor
     Interpreter(const std::string& cpp_file = "");
 
     /// Constructor
     Interpreter(const std::string& cpp_file = "");
 
+    Interpreter(VirtualExec::Pointer);
+
+    void Init(VirtualExec::Pointer, const std::string& cpp_file);
+
     /// Opens the file fullPathScriptName 
     /// includeScriptName is the name as given to the include command 
     void LoadScript( std::string fullPathScriptName,
     /// Opens the file fullPathScriptName 
     /// includeScriptName is the name as given to the include command 
     void LoadScript( std::string fullPathScriptName,
index 37bfe4d3758d12b7595d420809846126098e0045..781d025850ac84431b22e70779d299bc0e23d4ad 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.cxx,v $
   Language:  C++
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/05/14 12:32:26 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2008/05/15 08:02:36 $
+  Version:   $Revision: 1.20 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -93,6 +93,11 @@ namespace bbtk
   }
   //=========================================================================
 
   }
   //=========================================================================
 
+  //=========================================================================
+  void WxBlackBoxWindow::bbClose()
+  {
+  }
+  //=========================================================================
 
 
   //=========================================================================
 
 
   //=========================================================================
@@ -153,6 +158,13 @@ namespace bbtk
   }
   //=========================================================================
 
   }
   //=========================================================================
 
+  //=========================================================================
+  void WxBlackBoxDialog::bbClose()
+  {
+    wxDialog::Close();
+  }
+  //=========================================================================
+
   //=========================================================================
   WxBlackBoxDialog::~WxBlackBoxDialog()
   {
   //=========================================================================
   WxBlackBoxDialog::~WxBlackBoxDialog()
   {
@@ -234,6 +246,12 @@ namespace bbtk
   }
   //=========================================================================
 
   }
   //=========================================================================
 
+  //=========================================================================
+  void WxBlackBoxFrame::bbClose()
+  {
+    wxFrame::Close();
+  }
+  //=========================================================================
 
 
 
 
 
 
@@ -645,6 +663,19 @@ namespace bbtk
   //==================================================================
 
 
   //==================================================================
 
 
+  //==================================================================
+   void WxBlackBox::bbCloseWindow()
+  {
+    bbtkDebugMessageInc("wx",1,"=> WxBlackBox::bbCloseWindow() ["
+                       <<bbGetFullName()<<"]"<<std::endl);
+
+    if (bbGetWindow()!=0) bbGetWindow()->bbClose();
+
+    bbtkDebugMessageDec("wx",1,"<= WxBlackBox::bbCloseWindow() ["
+                       <<bbGetFullName()<<"]"<<std::endl);
+  }
+  //==================================================================
+
   //==================================================================
   WxBlackBox::Window* WxBlackBox::bbGetContainingWindow()
   {
   //==================================================================
   WxBlackBox::Window* WxBlackBox::bbGetContainingWindow()
   {
index dd870f95b3663bb6259e631bbe167137c1fdbeae..ddd35779880b48ef216d4b6c9a2c8d43f55f3890 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.h,v $
   Language:  C++
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.h,v $
   Language:  C++
-  Date:      $Date: 2008/04/24 10:24:58 $
-  Version:   $Revision: 1.15 $
+  Date:      $Date: 2008/05/15 08:02:36 $
+  Version:   $Revision: 1.16 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -69,6 +69,7 @@ namespace bbtk
     BBTK_DECLARE_INPUT(WinHeight,int);
     BBTK_DECLARE_INPUT(WinDialog,bool);
     BBTK_DECLARE_INPUT(WinHide,Void);
     BBTK_DECLARE_INPUT(WinHeight,int);
     BBTK_DECLARE_INPUT(WinDialog,bool);
     BBTK_DECLARE_INPUT(WinHide,Void);
+    BBTK_DECLARE_INPUT(WinClose,Void);
     BBTK_DECLARE_OUTPUT(Widget, wxWindow*);//WxBlackBoxWidget*);
 
   public:
     BBTK_DECLARE_OUTPUT(Widget, wxWindow*);//WxBlackBoxWidget*);
 
   public:
@@ -154,6 +155,8 @@ namespace bbtk
     void bbShowWindow();
     /// Hides the WxBlackBoxWindow associated to the box (if exists)
     void bbHideWindow();
     void bbShowWindow();
     /// Hides the WxBlackBoxWindow associated to the box (if exists)
     void bbHideWindow();
+    /// Closes (destroys) the WxBlackBoxWindow associated to the box (if exists)
+    void bbCloseWindow();
     //==================================================================
 
   private:
     //==================================================================
 
   private:
@@ -222,13 +225,15 @@ namespace bbtk
             "Title of the window (*)",
             std::string,"");
   BBTK_INPUT(WxBlackBox,WinWidth,
             "Title of the window (*)",
             std::string,"");
   BBTK_INPUT(WxBlackBox,WinWidth,
-            "Width of the window (* : only used if the widget is not inserted in another widget)",int,"");
+            "Width of the window (* : only used if the widget is not connected to a Layout box)",int,"");
   BBTK_INPUT(WxBlackBox,WinHeight,
             "Height of the window (*)",int,"");
   BBTK_INPUT(WxBlackBox,WinDialog,
             "Set to 'true' to create a dialog window, i.e. which blocks the pipeline until it is closed (modal) (*)",bool,"");
   BBTK_INPUT(WxBlackBox,WinHide,
   BBTK_INPUT(WxBlackBox,WinHeight,
             "Height of the window (*)",int,"");
   BBTK_INPUT(WxBlackBox,WinDialog,
             "Set to 'true' to create a dialog window, i.e. which blocks the pipeline until it is closed (modal) (*)",bool,"");
   BBTK_INPUT(WxBlackBox,WinHide,
-            "Any signal received hides the window (*)",Void,"");
+            "Any signal received hides the window (*)",Void,"signal");
+  BBTK_INPUT(WxBlackBox,WinClose,
+            "Any signal received closes the window (*)",Void,"signal");
   BBTK_OUTPUT(WxBlackBox,Widget,"Output widget",wxWindow*,"");
   BBTK_END_DESCRIBE_BLACK_BOX(WxBlackBox);
   //=================================================================
   BBTK_OUTPUT(WxBlackBox,Widget,"Output widget",wxWindow*,"");
   BBTK_END_DESCRIBE_BLACK_BOX(WxBlackBox);
   //=================================================================
@@ -250,6 +255,7 @@ namespace bbtk
     virtual ~WxBlackBoxWindow();
     virtual void bbShow();
     virtual void bbHide();
     virtual ~WxBlackBoxWindow();
     virtual void bbShow();
     virtual void bbHide();
+    virtual void bbClose();
     bool bbIsShown() { return mShown; }
     virtual WxBlackBox::Pointer bbGetBlackBox() { return mBox.lock(); }
     virtual wxDialog* bbGetDialog() { return 0; } 
     bool bbIsShown() { return mShown; }
     virtual WxBlackBox::Pointer bbGetBlackBox() { return mBox.lock(); }
     virtual wxDialog* bbGetDialog() { return 0; } 
@@ -270,6 +276,7 @@ namespace bbtk
     ~WxBlackBoxDialog();
     void bbShow();  
     void bbHide();
     ~WxBlackBoxDialog();
     void bbShow();  
     void bbHide();
+    void bbClose();
     wxDialog* bbGetDialog() { return this; } 
   };
   //==================================================================
     wxDialog* bbGetDialog() { return this; } 
   };
   //==================================================================
@@ -284,6 +291,7 @@ namespace bbtk
     ~WxBlackBoxFrame();
     void bbShow();
     void bbHide();
     ~WxBlackBoxFrame();
     void bbShow();
     void bbHide();
+    void bbClose();
     wxFrame* bbGetFrame() { return this; } 
   };
   //==================================================================
     wxFrame* bbGetFrame() { return this; } 
   };
   //==================================================================
index 53cbb2fdc4d40f0a7d0c7b88971600c71aae6309..8d04582120ac4af9cb7026d3c1aba777c7267658 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIConsole.cxx,v $
   Language:  C++
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIConsole.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/05/06 13:45:12 $
-  Version:   $Revision: 1.11 $
+  Date:      $Date: 2008/05/15 08:02:36 $
+  Version:   $Revision: 1.12 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -287,7 +287,7 @@ namespace bbtk
   //================================================================
   void WxGUIConsole::OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event))
   {
   //================================================================
   void WxGUIConsole::OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event))
   {
-    std::string command("toolsbbtk/appli/CreatePackage");
+    std::string command("toolsbbtk/appli/GUICreatePackage");
 
     bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
     Interpreter::Pointer I = Interpreter::New();    
 
     bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
     Interpreter::Pointer I = Interpreter::New();    
@@ -299,7 +299,7 @@ namespace bbtk
   //================================================================
   void WxGUIConsole::OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event))
   {
   //================================================================
   void WxGUIConsole::OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event))
   {
-    std::string command("toolsbbtk/appli/CreateBlackBox");
+    std::string command("toolsbbtk/appli/GUICreateBlackBox");
     bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
     Interpreter::Pointer I = Interpreter::New();    
     I->InterpretFile(command);
     bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
     Interpreter::Pointer I = Interpreter::New();    
     I->InterpretFile(command);
index 77a0d3ae2748adba01919358d4195222e070abe4..de7e616509cc2be990b129ad30a00113610c5698 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $
   Language:  C++
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/05/14 12:32:26 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2008/05/15 08:02:36 $
+  Version:   $Revision: 1.10 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -349,7 +349,7 @@ namespace bbtk
   void WxGUIScriptingInterface::OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event))
   {
 
   void WxGUIScriptingInterface::OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event))
   {
 
-    std::string command("toolsbbtk/appli/CreatePackage");
+    std::string command("toolsbbtk/appli/GUICreatePackage");
     bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
     
     Interpreter::Pointer I = Interpreter::New();    
     bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
     
     Interpreter::Pointer I = Interpreter::New();    
@@ -362,7 +362,7 @@ namespace bbtk
   //================================================================
   void WxGUIScriptingInterface::OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event))
   {
   //================================================================
   void WxGUIScriptingInterface::OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event))
   {
-    std::string command("toolsbbtk/appli/CreateBlackBox");
+    std::string command("toolsbbtk/appli/GUICreateBlackBox");
     bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
     
     Interpreter::Pointer I = Interpreter::New();    
     bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
     
     Interpreter::Pointer I = Interpreter::New();    
index 5dfdf6b4aadf9f994e91529c4e557e81665902e7..883a8081e18f19975c3f1a2ce4102f6a29e0575f 100755 (executable)
@@ -37,7 +37,8 @@ namespace bbstd
              {
                ccommand[i]=34;
              }
              {
                ccommand[i]=34;
              }
-         }                     
+         }     
+       std::cout << "*** Executing system command : '"<<ccommand<<"'"<<std::endl;
        system ( ccommand.c_str() );
        pos1=pos2+1;
        pos2 = bbGetInputIn().find(";",pos2+1);
        system ( ccommand.c_str() );
        pos1=pos2+1;
        pos2 = bbGetInputIn().find(";",pos2+1);
similarity index 64%
rename from packages/toolsbbtk/bbs/appli/CreatePackage.bbs
rename to packages/toolsbbtk/bbs/appli/GUICreatePackage.bbs
index 51be17ca89e602ab187b05a9380e674c163ac519..1a57bc96f5e886dc6050246a2cfb8dd7c9345b2b 100644 (file)
@@ -1,5 +1,5 @@
-description "Creates a new bbtk package file structure on disk (Graphical user interface for the script bbCreatePackage)."
-author "laurent.guigues at creatis.insa-lyon.fr"
+description "Creates a new bbtk package file structure on disk (Graphical user interface for the shell script bbCreatePackage)."
+author "laurent.guigues@creatis.insa-lyon.fr"
 category "toolsbbtk"
 
 load wx
 category "toolsbbtk"
 
 load wx
@@ -21,24 +21,25 @@ new InputText name
     set name.In "NEW_PACKAGE"
 
 new InputText author
     set name.In "NEW_PACKAGE"
 
 new InputText author
-    set author.Title "Author(s)           (caracters   '<',  '>' not accepted...)"
+    set author.Title "Author(s)           "
     set author.In "_author_"
 
 new InputText description
     set author.In "_author_"
 
 new InputText description
-    set description.Title "Description            (caracters   '<',  '>' not accepted...)"
+    set description.Title "Description            (html format)"
     set description.In "_description_"
 
     set description.In "_description_"
 
-#new CommandButton cancelButton
-#    set cancelButton.In "quit"
-#    set cancelButton.Label "Cancel"
+new CommandButton cancelButton
+    set cancelButton.In "print **CANCEL**"
+    set cancelButton.Label "Cancel"
 
 new CommandButton createButton
 
 new CommandButton createButton
-    set createButton.In "print $concatStr.Out$; exec command; "
+    set createButton.In "print $concatStr.Out$; exec command;"
     set createButton.Label "Run"
     set createButton.Label "Run"
+    
 
 new LayoutLine buttons
     set buttons.Orientation Horizontal
 
 new LayoutLine buttons
     set buttons.Orientation Horizontal
#   connect cancelButton.Widget buttons.Widget1
+    connect cancelButton.Widget buttons.Widget1
     connect createButton.Widget buttons.Widget2
 
 new LayoutLine main
     connect createButton.Widget buttons.Widget2
 
 new LayoutLine main
@@ -53,16 +54,29 @@ new LayoutLine main
     set main.WinWidth 400 
     set main.WinHeight 250 
 
     set main.WinWidth 400 
     set main.WinHeight 250 
 
-#-----------------------------------------------------------------------------
+new MultipleInputs close
+    connect close.Out main.WinClose
+    connect cancelButton.BoxChange close.In1
+    connect createButton.BoxChange close.In2
 
 
-new ASCII ascii
-  set ascii.In 34
+#-----------------------------------------------------------------------------
+new Configuration conf
+# on windows : enclose paths between double quotes 
+# if system==0 (Linux) dquote=space (ascci code 32)
+# if system==1 (Win) dquote==" (ascii code 34)
+new StringSelect onsystem
+set onsystem.In0 "32"
+set onsystem.In1 "34"
+new ASCII dquote
+connect conf.SystemType onsystem.In
+connect onsystem.Out dquote.In
+#set dquote.In 34
 
 new ConcatStrings dirStr
  set dirStr.In1 " "
 
 new ConcatStrings dirStr
  set dirStr.In1 " "
- connect ascii.Out dirStr.In2
+ connect dquote.Out dirStr.In2
  connect dir.Out dirStr.In3
  connect dir.Out dirStr.In3
- connect ascii.Out dirStr.In4
+ connect dquote.Out dirStr.In4
  set dirStr.In5 " "
 
 new ConcatStrings nameStr
  set dirStr.In5 " "
 
 new ConcatStrings nameStr
@@ -82,29 +96,36 @@ new ConcatStrings descriptionStr
 
 
 
 
 
 
-new Configuration conf
 new ConcatStrings concatStrCommand
     set concatStrCommand.In1 " "
 new ConcatStrings concatStrCommand
     set concatStrCommand.In1 " "
-    connect ascii.Out                  concatStrCommand.In2
+    connect dquote.Out                 concatStrCommand.In2
     connect conf.BinPath               concatStrCommand.In3
     connect conf.FileSeparator concatStrCommand.In4
     set                                                concatStrCommand.In5  "bbCreatePackage"
     connect conf.BinPath               concatStrCommand.In3
     connect conf.FileSeparator concatStrCommand.In4
     set                                                concatStrCommand.In5  "bbCreatePackage"
-    connect ascii.Out                  concatStrCommand.In6
+    connect dquote.Out                 concatStrCommand.In6
     set                                                concatStrCommand.In7  " "
 
 new ConcatStrings concatStr
     set                                                concatStrCommand.In7  " "
 
 new ConcatStrings concatStr
-    connect ascii.Out                          concatStr.In1
+    connect dquote.Out                         concatStr.In1
     connect  concatStrCommand.Out concatStr.In2
     connect dirStr.Out                         concatStr.In3
     connect nameStr.Out                        concatStr.In4 
     connect authorStr.Out                      concatStr.In5 
     connect descriptionStr.Out         concatStr.In6
     connect  concatStrCommand.Out concatStr.In2
     connect dirStr.Out                         concatStr.In3
     connect nameStr.Out                        concatStr.In4 
     connect authorStr.Out                      concatStr.In5 
     connect descriptionStr.Out         concatStr.In6
-    connect ascii.Out                          concatStr.In7
+    connect dquote.Out                         concatStr.In7
 
 
 new ExecSystemCommand command
     connect concatStr.Out command.In
 
 
 
 new ExecSystemCommand command
     connect concatStr.Out command.In
 
+/*
+new OutputText FinalMessage
+set FinalMessage.WinWidth 100
+set FinalMessage.WinHeight 100
+set FinalMessage.In "Done !"
+*/
+
 exec dir
 exec dir
+#message all 9
 exec main
 
 exec main
 
index e48681db7cfc3525e08e6396d5d4d36fdc2fbfb8..aeea2152e8e346e1150336ae1f39bd94faf64e61 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbwxCommandButton.cxx,v $
   Language:  C++
   Program:   bbtk
   Module:    $RCSfile: bbwxCommandButton.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:52 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2008/05/15 08:02:37 $
+  Version:   $Revision: 1.8 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 
   l'Image). All rights reserved. See Doc/License.txt or
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 
   l'Image). All rights reserved. See Doc/License.txt or
@@ -67,21 +67,32 @@ namespace bbwx
   
   void CommandButtonWidget::OnCommandButton( wxEvent& )
   {
   
   void CommandButtonWidget::OnCommandButton( wxEvent& )
   {
-    // Look for the interpreter
+    // Look for the interpreter or the executer if no interpreter
     bbtk::Interpreter::Pointer I;
     bbtk::Interpreter::Pointer I;
+    bbtk::VirtualExec::Pointer E;
       if (mBox->bbGetParent() != 0) 
        {
          bbtk::Factory::Pointer f = boost::dynamic_pointer_cast<bbtk::ComplexBlackBoxDescriptor>(mBox->bbGetParent()->bbGetDescriptor())->GetFactory();
          if ((f != 0)&&
              (f->GetExecuter()))
            {
       if (mBox->bbGetParent() != 0) 
        {
          bbtk::Factory::Pointer f = boost::dynamic_pointer_cast<bbtk::ComplexBlackBoxDescriptor>(mBox->bbGetParent()->bbGetDescriptor())->GetFactory();
          if ((f != 0)&&
              (f->GetExecuter()))
            {
-             I = f->GetExecuter()->GetInterpreter();
+             E = f->GetExecuter();
+             I = E->GetInterpreter();
            }
        }
       if (I==0) 
        {
            }
        }
       if (I==0) 
        {
-         //      bbtkError("ExecBbiCommand::DoProcess() : could not find interpreter");
-         I = bbtk::Interpreter::New();
+         //      bbtkError("CommandButton::DoProcess() : could not find interpreter");
+         if (E==0) 
+           {
+             // If no executer : create a totally independant interpreter
+             I = bbtk::Interpreter::New();
+           }
+         else 
+           {
+             // If executer : create an interpreter using E
+             I = bbtk::Interpreter::New(E);
+           }
        }
       
       std::string commandstr(mBox->bbGetInputIn());
        }
       
       std::string commandstr(mBox->bbGetInputIn());
index d36fc6dbeba96923f1997163a009599649238426..a42cff346f6fd40f38472d4151b115454d8986e9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbwxvtkViewer2D.cxx,v $
   Language:  C++
   Program:   bbtk
   Module:    $RCSfile: bbwxvtkViewer2D.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/05/14 12:32:26 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2008/05/15 08:02:37 $
+  Version:   $Revision: 1.7 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -206,12 +206,12 @@ namespace bbwxvtk
 
   void Viewer2D::Process() 
   { 
 
   void Viewer2D::Process() 
   { 
-    // LG : Bug when initial slice != 0 on first time 
+    // LG : Bug on Linux (wxGTK) when initial slice != 0 on first time 
     // (see wxvtk/appli/ExampleSimpleSlicer)
     // I think there is a problem with rendering before window 
     // has been reparented ... we have to check this 
 
     // (see wxvtk/appli/ExampleSimpleSlicer)
     // I think there is a problem with rendering before window 
     // has been reparented ... we have to check this 
 
-    // ((Viewer2DWidget*)bbGetOutputWidget())->UpdateView();
+    ((Viewer2DWidget*)bbGetOutputWidget())->UpdateView();
     bbSetOutputOut( bbGetInputSlice() );
   }
   
     bbSetOutputOut( bbGetInputSlice() );
   }