]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkQtBlackBoxDialog.cxx
Qt black boxes updated
[bbtk.git] / kernel / src / bbtkQtBlackBoxDialog.cxx
index 36b7834f80fd110212adfcd6a9c45d7fadab89f0..71eeb0a01ec57f6dd64504b4066e33f61f3495ac 100644 (file)
@@ -14,18 +14,21 @@ namespace bbtk
                                     int width, int height)
 
     :
-    QtBlackBoxDialogParent(box,parent)
+    QDialog(parent),
+    mBox(box)
                                    //    QDialog( parent )
   {
-    bbtkDebugMessage("qt",9,"QtBlackBoxDialog::QtBlackBoxDialog("<<
-                    bbGetBlackBox()->bbGetFullName()<<","<<parent<<","
-                    <<title<<","<<width<<"x"<<height<<")"<<std::endl);
+    bbtkDebugMessage("widget",9,"["<<
+                    box->bbGetName()<<"] QtBlackBoxDialog("<<parent<<",\""
+                    <<title<<"\","<<width<<"x"<<height<<")"<<std::endl);
+    Qt::IncNbWindowsAlive();
     // Sets up the GUI inherited from Ui::bbtkQtblackBoxDialog
     setupUi(this);
     resize ( width  , height );
     setWindowTitle(title.c_str());
     
+    ///
+    box->bbSetWindow(this);
    // Create the widget
     box->bbUserCreateWidget(widget);
 
@@ -38,44 +41,19 @@ namespace bbtk
   }
   //=========================================================================
   
-  //=========================================================================
-  void QtBlackBoxDialog::bbShow()
-  { 
-    if (bbIsShown()) return;
-    bbtkDebugMessage("qt",5,"QtBlackBoxDialog::bbShow() ["
-                    <<bbGetBlackBox()->bbGetFullName()<<"]"<<std::endl);
-    Parent::bbShow();
-    updateGeometry();
-    exec();
-    //    Show(false);
-    //SetReturnCode( wxDialog::ShowModal() ); 
-    bbDestroy();
-  }
-  //=========================================================================
-
-  //=========================================================================
-  void QtBlackBoxDialog::bbHide()
-  {
-    bbtkDebugMessage("qt",9,"QtBlackBoxDialog::bbHide()"<<std::endl);
-    Parent::bbHide();
-    
-    //Hide();
-  }
-  //=========================================================================
-
-  //=========================================================================
-  void QtBlackBoxDialog::bbDestroy()
-  {
-    bbtkDebugMessage("qt",9,"QtBlackBoxDialog::bbDestroy()"<<std::endl);
-    Parent::bbDestroy();
-    //wxDialog::Destroy();
-    
-  }
-  //=========================================================================
-
   //=========================================================================
   QtBlackBoxDialog::~QtBlackBoxDialog()
   {
+    if (mBox.lock())
+      bbtkDebugMessage("widget",9,"["<<mBox.lock()->bbGetName()
+                      <<"] $$$$$$$$$$$$$$$$$$$ ~QtBlackBoxDialog()"
+                      <<std::endl);
+    else 
+      bbtkDebugMessage("widget",9,"[DEAD] $$$$$$$$$$$$$$$$$$$$$ ~QtBlackBoxDialog()"<<std::endl);
+    //bbtkDebugMessage("widget",9,"WxFrame::~WxFrame()"<<std::endl);
+    if (mBox.lock()) mBox.lock()->bbSetWindow(0); 
+    Qt::DecNbWindowsAlive();
   }
   //=========================================================================