]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
NPAL16010 (Sketcher Apply non available if only one line is modified)
authoreap <eap@opencascade.com>
Tue, 22 May 2007 09:06:05 +0000 (09:06 +0000)
committereap <eap@opencascade.com>
Tue, 22 May 2007 09:06:05 +0000 (09:06 +0000)
      call ValueChangedInSpinBox() as soon as value text changes

src/EntityGUI/EntityGUI_SketcherDlg.cxx

index 6a22a9cc955dce7ff778098494610784b3dc961f..1e6343cd24b1c6df600aad500e33e2e4fbea5888 100644 (file)
@@ -253,7 +253,6 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent,
   Init();
 }
 
-
 //=================================================================================
 // function : ~EntityGUI_SketcherDlg()
 // purpose  : Destroys the object and frees any allocated resources
@@ -263,7 +262,6 @@ EntityGUI_SketcherDlg::~EntityGUI_SketcherDlg()
   myGeometryGUI->SetActiveDialogBox( 0 );
 }
 
-
 //=================================================================================
 // function : eventFilter()
 // purpose  : event filter for spin-boxes to provide Apply action on Return pressed
@@ -295,6 +293,16 @@ bool EntityGUI_SketcherDlg::eventFilter (QObject* object, QEvent* event)
     }
   }
 
+  if (event->type() == QEvent::KeyRelease) {
+    // NPAL16010 (Sketcher Apply non available if only one line is modified)
+    // To have Apply active as soon as value text changed
+    QString s = ((QtxDblSpinBox*) object)->text();
+    bool ok;
+    double newVal = s.toDouble( &ok );
+    if ( ok )
+      ValueChangedInSpinBox( newVal );
+  }
+
   return EntityGUI_Skeleton_QTD::eventFilter(object, event);
 }
 
@@ -1096,6 +1104,68 @@ void EntityGUI_SketcherDlg::ValueChangedInSpinBox(double newValue)
     vz = Group4Spin->SpinBox_DZ->GetValue();
     vs = newValue;
   }
+  // NPAL16010 (Sketcher Apply non available if only one line is modified)
+  // if ValueChangedInSpinBox() called from eventFilter()
+  else if ( Group1Spin->SpinBox_DX->hasFocus() )
+  {
+    vx = newValue;
+  }
+  else if ( Group2Spin->SpinBox_DX ->hasFocus() )
+  {
+    vx = newValue;
+    vy = Group2Spin->SpinBox_DY->GetValue();
+  }
+  else if ( Group2Spin->SpinBox_DY->hasFocus() )
+  {
+    vx = Group2Spin->SpinBox_DX->GetValue();
+    vy = newValue;
+  }
+  else if ( Group3Spin->SpinBox_DX->hasFocus() )
+  {
+    vx = newValue;
+    vy = Group3Spin->SpinBox_DY->GetValue();
+    vz = Group3Spin->SpinBox_DZ->GetValue();
+  }
+  else if ( Group3Spin->SpinBox_DY->hasFocus() )
+  {
+    vx = Group3Spin->SpinBox_DX->GetValue();
+    vy = newValue;
+    vz = Group3Spin->SpinBox_DZ->GetValue();
+  }
+  else if ( Group3Spin->SpinBox_DZ->hasFocus() )
+  {
+    vx = Group3Spin->SpinBox_DX->GetValue();
+    vy = Group3Spin->SpinBox_DY->GetValue();
+    vz = newValue;
+  }
+  else if ( Group4Spin->SpinBox_DX->hasFocus() )
+  {
+    vx = newValue;
+    vy = Group4Spin->SpinBox_DY->GetValue();
+    vz = Group4Spin->SpinBox_DZ->GetValue();
+    vs = Group4Spin->SpinBox_DS->GetValue();
+  }
+  else if ( Group4Spin->SpinBox_DY->hasFocus() )
+  {
+    vx = Group4Spin->SpinBox_DX->GetValue();
+    vy = newValue;
+    vz = Group4Spin->SpinBox_DZ->GetValue();
+    vs = Group4Spin->SpinBox_DS->GetValue();
+  }
+  else if ( Group4Spin->SpinBox_DZ->hasFocus() )
+  {
+    vx = Group4Spin->SpinBox_DX->GetValue();
+    vy = Group4Spin->SpinBox_DY->GetValue();
+    vz = newValue;
+    vs = Group4Spin->SpinBox_DS->GetValue();
+  }
+  else if ( Group4Spin->SpinBox_DS->hasFocus() )
+  {
+    vx = Group4Spin->SpinBox_DX->GetValue();
+    vy = Group4Spin->SpinBox_DY->GetValue();
+    vz = Group4Spin->SpinBox_DZ->GetValue();
+    vs = newValue;
+  }
 
   if ( myConstructorId == 0 )
   {  // SEGMENT