]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkWxBlackBox.cxx
*** empty log message ***
[bbtk.git] / kernel / src / bbtkWxBlackBox.cxx
index a66ecc617eb28f3c0c1c00c4c115505f2fd830fb..401ac4130637bbde28941572f8f28ab7a03b47bc 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/24 10:11:28 $
-  Version:   $Revision: 1.16 $
+  Date:      $Date: 2008/06/27 08:12:46 $
+  Version:   $Revision: 1.23 $
                                                                                 
   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()
+  {
+  }
+  //=========================================================================
 
 
   //=========================================================================
@@ -140,6 +145,7 @@ namespace bbtk
                     <<bbGetBlackBox()->bbGetFullName()<<"]"<<std::endl);
     WxBlackBoxWindow::bbShow();
     SetReturnCode( wxDialog::ShowModal() ); 
+    bbHide();
   }
   //=========================================================================
 
@@ -152,6 +158,13 @@ namespace bbtk
   }
   //=========================================================================
 
+  //=========================================================================
+  void WxBlackBoxDialog::bbClose()
+  {
+    wxDialog::Close();
+  }
+  //=========================================================================
+
   //=========================================================================
   WxBlackBoxDialog::~WxBlackBoxDialog()
   {
@@ -213,13 +226,19 @@ namespace bbtk
     bbtkDebugMessage("wx",5,"WxBlackBoxFrame::bbShow("
                     <<bbGetBlackBox()->bbGetFullName()<<")"<<std::endl);
     WxBlackBoxWindow::bbShow();
-    wxFrame::Show();
+  wxFrame::Show();
     // This Update is ** MANDATORY ** 
     // to synchronize wxvtkRenderWindowInteractor objects
     // (force wx objects creation **NOW**)
-    wxFrame::Update();
+
+
+#if defined(_WIN32)
+      wxFrame::Refresh();
+#endif
+
+      wxFrame::Update();
+      wxFrame::SetFocus();
     if (bbGetBlackBox()) bbGetBlackBox()->bbUserOnShow();
-    //    wxFrame::SetFocus();
   }
   //=========================================================================
 
@@ -233,6 +252,12 @@ namespace bbtk
   }
   //=========================================================================
 
+  //=========================================================================
+  void WxBlackBoxFrame::bbClose()
+  {
+    wxFrame::Close();
+  }
+  //=========================================================================
 
 
 
@@ -457,7 +482,8 @@ namespace bbtk
        if ((caller==0) ||
            ((caller!=0) && 
             (caller->GetBlackBoxTo() != to))&&
-           (!bbGetUpdateTransferedToParent()))
+           (!bbGetUpdateTransferedToParent())&&
+           (to->bbGetStatus()!=UPDATING))
          {
            bbtkDebugMessage("process",3,
                             "   ... Transfering update order to parent"
@@ -491,13 +517,16 @@ namespace bbtk
     // call 'standard' BlackBox execution method
     if (!bbGetUpdateTransferedToParent()) 
       { 
-       AtomicBlackBox::bbBackwardUpdate(caller);
+         AtomicBlackBox::bbBackwardUpdate(caller);
       }
     
     bbtkDebugMessageDec("process",3,
                        "<= WxBlackBox::bbBackwardUpdate() ["
                        <<bbGetFullName()<<"]"<<std::endl);
     
+   return bbGetStatus();
+     
+
   }
 
   //=========================================================================
@@ -506,6 +535,7 @@ namespace bbtk
     if (bbGetOutputWidget()==0) this->bbUserCreateWidget();
     this->bbUserProcess(); 
     bbShowWindow();
+    //    this->bbUserOnShow();
   }
   //=========================================================================
   
@@ -640,6 +670,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()
   {