]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkWidgetBlackBox.txx
*** MAJOR CHANGE *** NOT WORKING YET !!!
[bbtk.git] / kernel / src / bbtkWidgetBlackBox.txx
index 39738cf6b3032aaebe8689488fb17d7204ac3a5b..1abdaad92f81ad694410b80c9fc9ccd974c94137 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWidgetBlackBox.txx,v $
   Language:  C++
-  Date:      $Date: 2009/04/21 14:36:51 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2009/05/14 14:43:34 $
+  Version:   $Revision: 1.3 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -54,56 +54,42 @@ namespace bbtk
   
 //=========================================================================
   template <class T>  
-  void WidgetBlackBox<T>::bbUserConstructor()
+  void WidgetBlackBox<T>::bbUserSetDefaultValues()
   {
-    bbtkDebugMessage("widget",9,"WidgetBlackBox::bbUserConstructor()"<<std::endl);
-    bbInitAttributes();
+    bbtkDebugMessage("widget",9,"WidgetBlackBox::bbUserSetDefaultValues()"<<std::endl);
+    bbmWindow = 0;
+    bbSetInputWinTitle(bbGetName());
+    bbSetInputWinWidth(800);
+    bbSetInputWinHeight(800);
+    bbSetInputWinDialog(false);
+    bbSetOutputWidget(0);
   }
   //=========================================================================
 
   //=========================================================================
   template <class T>  
-  void WidgetBlackBox<T>::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
+  void WidgetBlackBox<T>::bbUserInitializeProcessing()
   {
-    bbtkDebugMessage("widget",9,"WidgetBlackBox::bbUserCopyConstructor()"
-                    <<std::endl);
-    bbInitAttributes();
   }
   //=========================================================================
 
-
   //=========================================================================
   template <class T>  
-  void WidgetBlackBox<T>::bbUserDestructor()
+  void WidgetBlackBox<T>::bbUserFinalizeProcessing()
   {
-    bbtkDebugMessage("widget",9,"==> WidgetBlackBox::bbUserDestructor() ["<<bbGetFullName()<<"]"<<std::endl);
+    bbtkDebugMessage("widget",9,"==> WidgetBlackBox::bbUserFinalizeProcessing() ["<<bbGetFullName()<<"]"<<std::endl);
     if (bbGetWindow()) {
       bbGetWindow()->bbClose();
       bbSetWindow(0);
     }
-    bbtkDebugMessage("widget",9,"<== WidgetBlackBox::bbUserDestructor() ["<<bbGetFullName()<<"]"<<std::endl);
+    bbtkDebugMessage("widget",9,"<== WidgetBlackBox::bbUserFinalizeProcessing() ["<<bbGetFullName()<<"]"<<std::endl);
   }
   //=========================================================================
   
 
 
-  //=========================================================================
-  /**
-   * \brief Initialize the attributes of the class
-   *
-   */
-  template <class T>  
-  void WidgetBlackBox<T>::bbInitAttributes()
-  {
-    bbmWindow = 0;
-    bbSetInputWinTitle(bbGetName());
-    bbSetInputWinWidth(800);
-    bbSetInputWinHeight(800);
-    bbSetInputWinDialog(false);
-    bbSetOutputWidget(0);
-  }
-  //=========================================================================
-
 
   //=========================================================================
   template <class T>  
@@ -181,7 +167,10 @@ namespace bbtk
        // Cast it into a WidgetBlackBox
        typename WidgetBlackBox<T>::Pointer wfrom 
          = boost::dynamic_pointer_cast<WidgetBlackBox<T> >(from);
-       // Call bbCreateWidget
+       // If the black box from construction is not done yet : do it
+        // If not constructed do it 
+       wfrom->bbInitializeProcessing();
+       // Call bbUserCreateWidget
        wfrom->bbUserCreateWidget(parent);
        // Get the widget created
        w = wfrom->bbGetOutputWidget();