Salome HOME
Revert "Synchronize adm files"
[modules/hexablock.git] / src / HEXABLOCKGUI / MyBasicGUI_PointDlg.cxx
index f2007d9bfdff22af0380184ddab7f0d2c866fb49..1d5786a7672f60e5ad7284933070b51f4ecd8c40 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2009-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2014  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -115,15 +115,19 @@ MyBasicGUI_PointDlg::MyBasicGUI_PointDlg(QWidget* parent, Qt::WindowFlags fl)
     myParamCoord = new QButtonGroup(myParamGroup);
     QHBoxLayout* boxLayout = new QHBoxLayout(myParamGroup);
     boxLayout->setMargin(MARGIN); boxLayout->setSpacing(SPACING);
+
     QRadioButton* btn = new QRadioButton(tr("By Param"), myParamGroup);
     myParamCoord->addButton(btn, PARAM_VALUE);
     boxLayout->addWidget(btn);
+
     btn = new QRadioButton(tr("By Length"), myParamGroup);
     myParamCoord->addButton(btn, LENGTH_VALUE);
     boxLayout->addWidget(btn);
+
     btn = new QRadioButton(tr("By Coords"), myParamGroup);
     myParamCoord->addButton(btn, COORD_VALUE);
     boxLayout->addWidget(btn);
+
     myParamCoord->setExclusive(true);
     myParamCoord->button(PARAM_VALUE)->setChecked(true);
 
@@ -1058,9 +1062,20 @@ void MyBasicGUI_PointDlg::clear()
 void MyBasicGUI_PointDlg::onWindowActivated(SUIT_ViewManager* vm)
 {
     QString vmType = vm->getType();
-    if ( (vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type()) ){
+    if ( ((vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type())) &&
+            !mainFrame()->RadioButton4->isChecked() &&
+            !myParamCoord->button(LENGTH_VALUE)->isChecked() )
         mainFrame()->_vertex_le->setFocus();
-    } else if ( vmType == OCCViewer_Viewer::Type() ){
-        // ...
+    else if ( vmType == OCCViewer_Viewer::Type() ){
+        if (mainFrame()->RadioButton1->isChecked())
+            // Make the field "Vertex of the model" lose the focus
+            mainFrame()->RadioButton1->click();
+        else if (mainFrame()->RadioButton2->isChecked())
+            GroupRefPoint->LineEdit1->setFocus();
+        else if (mainFrame()->RadioButton3->isChecked() &&
+                !myParamCoord->button(LENGTH_VALUE)->isChecked())
+            GroupOnCurve->LineEdit1->setFocus();
+        else if (mainFrame()->RadioButton5->isChecked())
+            GroupOnSurface->LineEdit1->setFocus();
     }
 }