Salome HOME
NPAL16559: EDF507: Implementation of a more advanced system of measurement.
[modules/geom.git] / src / BlocksGUI / BlocksGUI_QuadFaceDlg.cxx
index c9529620792bff3d5aab3693232c6e7a97bd6736..0f1b9747f374ecae807374e386e466908042be5d 100644 (file)
@@ -16,7 +16,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 //  $Header$
 
 #include "BlocksGUI_QuadFaceDlg.h"
-
-#include "QAD_Desktop.h"
-
 #include "GEOMImpl_Types.hxx"
 
-//using namespace std;
+#include "SUIT_Session.h"
+#include "SalomeApp_Application.h"
+#include "LightApp_SelectionMgr.h"
+
+#include <qlabel.h>
 
 //=================================================================================
 // class    : BlocksGUI_QuadFaceDlg()
 // purpose  : Constructs a BlocksGUI_QuadFaceDlg which is a child of 'parent'.
 //=================================================================================
-BlocksGUI_QuadFaceDlg::BlocksGUI_QuadFaceDlg (QWidget* parent,
-                                        SALOME_Selection* Sel,
-                                        bool modal)
-     : GEOMBase_Skeleton(parent, "QuadFaceDlg", Sel, modal,
+BlocksGUI_QuadFaceDlg::BlocksGUI_QuadFaceDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal)
+     : GEOMBase_Skeleton(theGeometryGUI, parent, "QuadFaceDlg", modal,
                          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
 {
-  QPixmap image1 (QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_4_VERT")));
-  QPixmap image2 (QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_2_EDGE")));
-  QPixmap image3 (QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_4_EDGE")));
-  QPixmap imageS (QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+  SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
+  QPixmap image1 (aResMgr->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_4_VERT")));
+  QPixmap image2 (aResMgr->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_2_EDGE")));
+  QPixmap image3 (aResMgr->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_4_EDGE")));
+  QPixmap imageS (aResMgr->loadPixmap("GEOM",tr("ICON_SELECT")));
 
   setCaption(tr("GEOM_QUAD_FACE_TITLE"));
 
@@ -100,6 +100,8 @@ BlocksGUI_QuadFaceDlg::BlocksGUI_QuadFaceDlg (QWidget* parent,
   Layout1->addWidget(myGrp3, 2, 0);
   /***************************************************************/
 
+  setHelpFileName("newentity_blocks.htm#QuadrangleFace");
+
   Init();
 }
 
@@ -127,7 +129,8 @@ void BlocksGUI_QuadFaceDlg::Init()
   for (anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn)
     connect(anIterBtn.data(), SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
 
-  connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 
+         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
 
   // init controls and fields
   initName(tr("GEOM_QUAD_FACE"));
@@ -226,8 +229,8 @@ void BlocksGUI_QuadFaceDlg::SelectionIntoArgument()
 
   GEOM::GEOM_Object_var anObj;
   Standard_Boolean aResult = Standard_False;
-  if (mySelection->IObjectCount() == 1) {
-    anObj = GEOMBase::ConvertIOinGEOMObject(mySelection->firstIObject(), aResult);
+  if (IObjectCount() == 1) {
+    anObj = GEOMBase::ConvertIOinGEOMObject(firstIObject(), aResult);
     if (aResult) {
       if (anObj->_is_nil()) {
         aResult = Standard_False;
@@ -280,7 +283,8 @@ void BlocksGUI_QuadFaceDlg::SetEditCurrentArgument()
 void BlocksGUI_QuadFaceDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 
+         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
 
   activateSelection();
   displayPreview();