Salome HOME
Porting to Qt4.
[modules/geom.git] / src / PrimitiveGUI / PrimitiveGUI_CylinderDlg.cxx
index 503211cf2f394004b5b25256ec6df16bf2145c22..da8009761e596ddebe0899e8aa36367dbc107d32 100644 (file)
 //  $Header$
 
 #include "PrimitiveGUI_CylinderDlg.h"
+#include "DlgRef_2Sel2Spin.h"
+#include "DlgRef_2Spin.h"
+#include "DlgRef_SpinBox.h"
 
-#include "SUIT_Desktop.h"
+#include "GeometryGUI.h"
+#include "GEOMBase.h"
+
+#include "SUIT_ResourceMgr.h"
 #include "SUIT_Session.h"
 #include "SalomeApp_Application.h"
 #include "LightApp_SelectionMgr.h"
 
-#include <qlabel.h>
-
 #include "GEOMImpl_Types.hxx"
 
-#include "utilities.h"
-
 using namespace std;
 
 //=================================================================================
@@ -49,21 +51,21 @@ using namespace std;
 //            TRUE to construct a modal dialog.
 //=================================================================================
 PrimitiveGUI_CylinderDlg::PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
-                                                   const char* name, bool modal, WFlags fl)
-  :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
-                     WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+                                                   const char* name, bool modal, Qt::WindowFlags fl)
+  :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
 {
   QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CYLINDER_PV")));
   QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CYLINDER_DXYZ")));
   QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
 
-  setCaption(tr("GEOM_CYLINDER_TITLE"));
+  setWindowTitle(tr("GEOM_CYLINDER_TITLE"));
 
   /***************************************************************/
   GroupConstructors->setTitle(tr("GEOM_CYLINDER"));
-  RadioButton1->setPixmap(image0);
-  RadioButton2->setPixmap(image1);
-  RadioButton3->close(TRUE);
+  RadioButton1->setIcon(image0);
+  RadioButton2->setIcon(image1);
+  RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+  RadioButton3->close();
 
   GroupPoints = new DlgRef_2Sel2Spin(this, "GroupPoints");
   GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
@@ -71,16 +73,16 @@ PrimitiveGUI_CylinderDlg::PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI,
   GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
   GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS"));
   GroupPoints->TextLabel4->setText(tr("GEOM_HEIGHT"));
-  GroupPoints->PushButton1->setPixmap(image2);
-  GroupPoints->PushButton2->setPixmap(image2);
+  GroupPoints->PushButton1->setIcon(image2);
+  GroupPoints->PushButton2->setIcon(image2);
 
   GroupDimensions = new DlgRef_2Spin(this, "GroupDimensions");
   GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
   GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS"));
   GroupDimensions->TextLabel2->setText(tr("GEOM_HEIGHT"));
 
-  Layout1->addWidget(GroupPoints, 2, 0);
-  Layout1->addWidget(GroupDimensions, 2, 0);
+  gridLayout1->addWidget(GroupPoints, 2, 0);
+  gridLayout1->addWidget(GroupDimensions, 2, 0);
   /***************************************************************/
 
   setHelpFileName("cylinder.htm");
@@ -155,7 +157,7 @@ void PrimitiveGUI_CylinderDlg::Init()
   connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 
          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
   
-  initName( tr( "GEOM_CYLINDER" ) );
+  initName( tr( "GEOM_CYLINDER" ).toStdString().c_str() );
   ConstructorsClicked(0);
 }