]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkWxBlackBox.cxx
Fix a big bug. Consider the script :
[bbtk.git] / kernel / src / bbtkWxBlackBox.cxx
index 1cea747459170fe233e9acec99b57b89f49ce3f1..06ec96786de00233ec26424bfb22e6ce7055455e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/02/08 10:05:38 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2008/03/06 09:23:43 $
+  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
@@ -75,6 +75,7 @@ namespace bbtk
   }
   //========================================================================= 
 
+
   //=========================================================================
   void WxBlackBoxWindow::bbShow()
   {
@@ -486,6 +487,41 @@ namespace bbtk
   }
   //=========================================================================
 
+  //=========================================================================
+  /// Main processing method of the box.
+  void WxBlackBox::bbExecute(bool force)
+  {
+    bbtkDebugMessageInc("Process",1,
+                       "=> WxBlackBox::bbExecute() ["
+                       <<bbGetFullName()<<"]"<<std::endl);
+
+    // If the output 'Widget' is connected then 
+    // we must execute the parent box
+    BlackBox::OutputConnectorMapType::const_iterator i 
+      = bbGetOutputConnectorMap().find("Widget");
+
+    if ( i->second->GetConnectionVector().size() != 0 ) 
+      {
+       bbtkDebugMessage("Process",2,
+                        "-> Output 'Widget' connected : transfering execution to parent"
+                        <<std::endl);
+       
+       i->second->GetConnectionVector().front()
+         ->GetBlackBoxTo()->bbExecute(force);
+
+      }
+    // else call 'standard' BlackBox execution method
+    else 
+      {
+       BlackBox::bbExecute(force);
+      }
+    //
+
+    bbtkDebugMessageDec("Process",1,
+                       "<= WxBlackBox::bbExecute() ["
+                       <<bbGetFullName()<<"]"<<std::endl);
+  }
+  //=========================================================================
 
 
   //==================================================================