From 6db71a9f9dd207f4f425770134799baad8104a73 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 22 May 2007 09:06:05 +0000 Subject: [PATCH] NPAL16010 (Sketcher Apply non available if only one line is modified) call ValueChangedInSpinBox() as soon as value text changes --- src/EntityGUI/EntityGUI_SketcherDlg.cxx | 74 ++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx index 6a22a9cc9..1e6343cd2 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx @@ -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 -- 2.39.2