bbtkQtBlackBox.cxx
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00035 #ifdef USE_QT
00036
00037
00038 #include "bbtkQtBlackBox.h"
00039
00040
00041 #include "bbtkQtBlackBoxDialog.h"
00042
00043
00044 namespace bbtk
00045 {
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 BBTK_BLACK_BOX_IMPLEMENTATION(QtBlackBox,WidgetBlackBox<QWidget>);
00058
00059
00060
00062 void QtBlackBox::bbCreateDialogWindow()
00063 {
00064 Qt::CreateQtAppIfNeeded();
00065 QtBlackBoxDialog* w = 0;
00066 w = new QtBlackBoxDialog( GetThisPointer<QtBlackBox>(),
00067 0,
00068 bbGetInputWinTitle()
00069 + " - bbtk (c) CREATIS LRMN",
00070 bbGetInputWinWidth() ,
00071 bbGetInputWinHeight() );
00072 }
00073
00074
00075
00077 void QtBlackBox::bbCreateFrameWindow()
00078 {
00079
00080 this->bbCreateDialogWindow();
00081
00082 }
00083
00084
00085
00086 void QtBlackBox::bbUserSetDefaultValues()
00087 {
00088 bbtkBlackBoxDebugMessage("widget",5,"QtBlackBox::bbUserSetDefaultValues()"<<std::endl);
00089 bbmWindow = 0;
00090 }
00091
00092
00093
00094 void QtBlackBox::bbUserInitializeProcessing()
00095 {
00096 }
00097
00098
00099
00100 void QtBlackBox::bbUserFinalizeProcessing()
00101 {
00102 bbtkBlackBoxDebugMessage("widget",5,"==> QtBlackBox::bbUserFinalizeProcessing()"<<std::endl);
00103 bbDestroyWindow();
00104 bbtkBlackBoxDebugMessage("widget",5,"<== QtBlackBox::bbUserFinalizeProcessing()"<<std::endl);
00105 }
00106
00107
00108
00109 void QtBlackBox::bbSetWindow(QWidget* w)
00110 {
00111 bbtkBlackBoxDebugMessage("widget",9,"==> QtBlackBox::bbSetWindow("<<w<<")"<<std::endl);
00112 if ((bbmWindow != 0)&&(w!=0))
00113 {
00114 std::cout << "ERRRRRRRROOOOR"<<std::endl;
00115 }
00116 bbmWindow = w;
00117 }
00118
00119
00120
00121 void QtBlackBox::bbShowWindow()
00122 {
00123 if ((bbmWindow) && (!bbIsShown()))
00124 {
00125 bbtkBlackBoxDebugMessage("widget",3,"==> QtBlackBox::bbShowWindow()"
00126 <<std::endl);
00127 if (bbGetInputWinDialog())
00128 {
00129 bbmWindow->updateGeometry();
00130 ((QDialog*)bbmWindow)->exec();
00131 bbDestroyWindow();
00132 }
00133 else
00134 {
00135 bbmWindow->updateGeometry();
00136 ((QDialog*)bbmWindow)->exec();
00137 bbSetShown(true);
00138 }
00139 }
00140 }
00141
00142
00143
00144 void QtBlackBox::bbDestroyWindow()
00145 {
00146 bbtkBlackBoxDebugMessage("widget",3,"==> QtBlackBox::bbDestroyWindow("<<bbmWindow<<")"<<std::endl);
00147 if (bbGetWindow()!=NULL)
00148 {
00149
00150
00151
00152
00153
00154
00155 delete bbGetWindow();
00156 bbSetShown(false);
00157 }
00158 bbtkBlackBoxDebugMessage("widget",3,"<== QtBlackBox::bbDestroyWindow("<<bbmWindow<<")"<<std::endl);
00159
00160 }
00161
00162
00163
00164
00165 void QtBlackBox::IncNbWindowsAlive() { Qt::IncNbWindowsAlive(); }
00166 void QtBlackBox::DecNbWindowsAlive() { Qt::DecNbWindowsAlive(); }
00167 int QtBlackBox::GetNbWindowsAlive() { return Qt::GetNbWindowsAlive(); }
00168 bool QtBlackBox::IsSomeWindowAlive() { return Qt::IsSomeWindowAlive(); }
00169
00170 void QtBlackBox::IncNbWindowsShown() { Qt::IncNbWindowsShown(); }
00171 void QtBlackBox::DecNbWindowsShown() { Qt::DecNbWindowsShown(); }
00172 int QtBlackBox::GetNbWindowsShown() { return Qt::GetNbWindowsShown(); }
00173 bool QtBlackBox::IsSomeWindowShown() { return Qt::GetNbWindowsShown(); }
00174
00175
00176
00177
00178
00179 }
00180
00181
00182 #endif
00183