]> Creatis software - bbtk.git/blob - kernel/src/bbtkQtBlackBoxDialog.cxx
06189d58395c76fb8589e0751a4c9fba1c029491
[bbtk.git] / kernel / src / bbtkQtBlackBoxDialog.cxx
1 #ifdef USE_QT
2
3 #include "bbtkQtBlackBoxDialog.h"
4 #include "bbtkQtBlackBox.h"
5
6 namespace bbtk
7 {
8
9
10   //=========================================================================
11   QtBlackBoxDialog::QtBlackBoxDialog(QtBlackBox::Pointer box,
12                                      QWidget *parent,
13                                      const std::string& title,
14                                      int width, int height)
15
16     :
17     QtBlackBoxDialogParent(box,parent)
18                                     //    QDialog( parent )
19   {
20     bbtkDebugMessage("qt",9,"QtBlackBoxDialog::QtBlackBoxDialog("<<
21                      bbGetBlackBox()->bbGetFullName()<<","<<parent<<","
22                      <<title<<","<<width<<"x"<<height<<")"<<std::endl);
23     // Sets up the GUI inherited from Ui::bbtkQtblackBoxDialog
24     setupUi(this);
25     resize ( width  , height );
26     setWindowTitle(title.c_str());
27     
28  
29    // Create the widget
30     box->bbUserCreateWidget(widget);
31
32     // Insert into the layout
33     horizontalLayout->addWidget(box->bbGetOutputWidget());
34
35  
36     //    updateGeometry();
37
38   }
39   //=========================================================================
40   
41   //=========================================================================
42   void QtBlackBoxDialog::bbShow()
43   { 
44     if (bbIsShown()) return;
45     bbtkDebugMessage("qt",5,"QtBlackBoxDialog::bbShow() ["
46                      <<bbGetBlackBox()->bbGetFullName()<<"]"<<std::endl);
47     Parent::bbShow();
48     updateGeometry();
49     exec();
50     //    Show(false);
51     //SetReturnCode( wxDialog::ShowModal() ); 
52     bbClose();
53   }
54   //=========================================================================
55
56   //=========================================================================
57   void QtBlackBoxDialog::bbHide()
58   {
59     bbtkDebugMessage("qt",9,"QtBlackBoxDialog::bbHide()"<<std::endl);
60     Parent::bbHide();
61     
62     //Hide();
63   }
64   //=========================================================================
65
66   //=========================================================================
67   void QtBlackBoxDialog::bbClose()
68   {
69     bbtkDebugMessage("qt",9,"QtBlackBoxDialog::bbClose()"<<std::endl);
70     //wxDialog::Destroy();
71   }
72   //=========================================================================
73
74   //=========================================================================
75   QtBlackBoxDialog::~QtBlackBoxDialog()
76   {
77   }
78   //=========================================================================
79
80 }
81 #endif
82