From b147d12523ffc8fb7708597e0110a504b2cedb43 Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 25 Feb 2009 08:54:44 +0000 Subject: [PATCH] Bug IPAL20689 - Problem with the Mutli-Transformation dialog --- src/BlocksGUI/BlocksGUI_TrsfDlg.cxx | 15 +- src/BlocksGUI/BlocksGUI_TrsfDlg.h | 4 +- src/DlgRef/DlgRef.cxx | 14 ++ src/DlgRef/DlgRef.h | 16 ++ src/DlgRef/DlgRef.pro | 1 + src/DlgRef/DlgRef_2Sel1SpinInt_QTD.ui | 169 ++++++++++++++++++ src/DlgRef/DlgRef_2Sel2Spin1Check_QTD.ui | 7 +- src/DlgRef/DlgRef_2Sel4Spin1Check_QTD.ui | 9 +- src/DlgRef/DlgRef_3Sel4Spin2Check_QTD.ui | 9 +- src/DlgRef/Makefile.am | 1 + .../TransformationGUI_MultiRotationDlg.cxx | 52 +++--- .../TransformationGUI_MultiRotationDlg.h | 5 +- .../TransformationGUI_MultiTranslationDlg.cxx | 50 ++++-- .../TransformationGUI_MultiTranslationDlg.h | 1 + 14 files changed, 295 insertions(+), 58 deletions(-) create mode 100644 src/DlgRef/DlgRef_2Sel1SpinInt_QTD.ui diff --git a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx index 9e5e91a97..9508f69e9 100644 --- a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx @@ -111,11 +111,11 @@ BlocksGUI_TrsfDlg::~BlocksGUI_TrsfDlg() void BlocksGUI_TrsfDlg::Init() { // Set range of spinboxes - double SpecificStep = 1.0; - QMap::iterator anIter; + int SpecificStep = 1; + QMap::iterator anIter; for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) { - //anIter.data()->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3); - initSpinBox(anIter.value(), 1.0, 999, SpecificStep, 3); + //anIter.data()->RangeStepAndValidator(1, 999, SpecificStep); + initSpinBox(anIter.value(), 1, 999, SpecificStep); } // signals and slots connections @@ -128,7 +128,7 @@ void BlocksGUI_TrsfDlg::Init() for (anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn) connect(anIterBtn.value(), SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - QMap::iterator anIterSpin; + QMap::iterator anIterSpin; for (anIterSpin = mySpinBox.begin(); anIterSpin != mySpinBox.end(); ++anIterSpin) connect(anIterSpin.value(), SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int))); @@ -166,16 +166,13 @@ void BlocksGUI_TrsfDlg::ConstructorsClicked (int constructorId) myGrp2->hide(); myGrp1->show(); mySpinBox[SpinBox1]->setValue(2); - mySpinBox[SpinBox1]->setDecimals(0); mySelBtn[MainObj1]->click(); break; case 1: myGrp1->hide(); myGrp2->show(); mySpinBox[SpinBox2U]->setValue(2); - mySpinBox[SpinBox2U]->setDecimals(0); mySpinBox[SpinBox2V]->setValue(2); - mySpinBox[SpinBox2V]->setDecimals(0); mySelBtn[MainObj2]->click(); break; default: @@ -453,7 +450,7 @@ void BlocksGUI_TrsfDlg::createSpinWg (const QString& theLbl, const int theId) { QLabel* lab = new QLabel(theLbl, theParent); - mySpinBox[theId] = new SalomeApp_DoubleSpinBox(theParent); + mySpinBox[theId] = new SalomeApp_IntSpinBox(theParent); QGridLayout* l = 0; if (!theParent->layout()) { l = new QGridLayout(theParent); diff --git a/src/BlocksGUI/BlocksGUI_TrsfDlg.h b/src/BlocksGUI/BlocksGUI_TrsfDlg.h index a0f823f14..558ea7516 100644 --- a/src/BlocksGUI/BlocksGUI_TrsfDlg.h +++ b/src/BlocksGUI/BlocksGUI_TrsfDlg.h @@ -30,7 +30,7 @@ #include -class SalomeApp_DoubleSpinBox; +class SalomeApp_IntSpinBox; class QGroupBox; class QPushButton; class QLineEdit; @@ -79,7 +79,7 @@ private: QMap mySelBtn; QMap mySelName; - QMap mySpinBox; + QMap mySpinBox; private slots: void ClickOnOk(); diff --git a/src/DlgRef/DlgRef.cxx b/src/DlgRef/DlgRef.cxx index c22828f46..0b0f48585 100644 --- a/src/DlgRef/DlgRef.cxx +++ b/src/DlgRef/DlgRef.cxx @@ -332,6 +332,20 @@ DlgRef_2Sel1Spin::~DlgRef_2Sel1Spin() { } +////////////////////////////////////////// +// DlgRef_2Sel1SpinInt +////////////////////////////////////////// + +DlgRef_2Sel1SpinInt::DlgRef_2Sel1SpinInt( QWidget* parent, Qt::WindowFlags f ) +: QWidget( parent, f ) +{ + setupUi( this ); +} + +DlgRef_2Sel1SpinInt::~DlgRef_2Sel1SpinInt() +{ +} + ////////////////////////////////////////// // DlgRef_2Sel2List ////////////////////////////////////////// diff --git a/src/DlgRef/DlgRef.h b/src/DlgRef/DlgRef.h index d786fe841..69b58ca64 100644 --- a/src/DlgRef/DlgRef.h +++ b/src/DlgRef/DlgRef.h @@ -389,6 +389,22 @@ public: ~DlgRef_2Sel1Spin(); }; +////////////////////////////////////////// +// DlgRef_2Sel1SpinInt +////////////////////////////////////////// + +#include "ui_DlgRef_2Sel1SpinInt_QTD.h" + +class DLGREF_EXPORT DlgRef_2Sel1SpinInt : public QWidget, + public Ui::DlgRef_2Sel1SpinInt_QTD +{ + Q_OBJECT + +public: + DlgRef_2Sel1SpinInt( QWidget* = 0, Qt::WindowFlags = 0 ); + ~DlgRef_2Sel1SpinInt(); +}; + ////////////////////////////////////////// // DlgRef_2Sel2List ////////////////////////////////////////// diff --git a/src/DlgRef/DlgRef.pro b/src/DlgRef/DlgRef.pro index 1abf89059..1c01ee441 100644 --- a/src/DlgRef/DlgRef.pro +++ b/src/DlgRef/DlgRef.pro @@ -60,6 +60,7 @@ HEADERS += DlgRef_1Sel3Spin_QTD.h HEADERS += DlgRef_1Sel4Spin_QTD.h HEADERS += DlgRef_1Sel5Spin_QTD.h HEADERS += DlgRef_2Sel1Spin_QTD.h +HEADERS += DlgRef_2Sel1SpinInt_QTD.h HEADERS += DlgRef_2Sel2Spin_QTD.h HEADERS += DlgRef_2Sel3Spin_QTD.h HEADERS += DlgRef_1Sel1Spin1Check_QTD.h diff --git a/src/DlgRef/DlgRef_2Sel1SpinInt_QTD.ui b/src/DlgRef/DlgRef_2Sel1SpinInt_QTD.ui new file mode 100644 index 000000000..c86bf826b --- /dev/null +++ b/src/DlgRef/DlgRef_2Sel1SpinInt_QTD.ui @@ -0,0 +1,169 @@ + + DlgRef_2Sel1SpinInt_QTD + + + + 0 + 0 + 156 + 99 + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + + 6 + + + + + + + + + 0 + 0 + + + + TL3 + + + false + + + + + + + + 0 + 0 + + + + QFrame::NoFrame + + + QFrame::Plain + + + TL2 + + + false + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + 0 + 0 + + + + TL1 + + + false + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + qPixmapFromMimeSource + + + SalomeApp_IntSpinBox + QSpinBox +
SalomeApp_IntSpinBox.h
+
+
+ + PushButton1 + LineEdit1 + PushButton2 + LineEdit2 + + + +
diff --git a/src/DlgRef/DlgRef_2Sel2Spin1Check_QTD.ui b/src/DlgRef/DlgRef_2Sel2Spin1Check_QTD.ui index 07800a567..6a0b63ac2 100644 --- a/src/DlgRef/DlgRef_2Sel2Spin1Check_QTD.ui +++ b/src/DlgRef/DlgRef_2Sel2Spin1Check_QTD.ui @@ -63,7 +63,7 @@ - + @@ -177,6 +177,11 @@ QDoubleSpinBox
SalomeApp_DoubleSpinBox.h
+ + SalomeApp_IntSpinBox + QSpinBox +
SalomeApp_IntSpinBox.h
+
PushButton1 diff --git a/src/DlgRef/DlgRef_2Sel4Spin1Check_QTD.ui b/src/DlgRef/DlgRef_2Sel4Spin1Check_QTD.ui index 27e0b7e56..5d0afce71 100644 --- a/src/DlgRef/DlgRef_2Sel4Spin1Check_QTD.ui +++ b/src/DlgRef/DlgRef_2Sel4Spin1Check_QTD.ui @@ -63,13 +63,13 @@
- + - + @@ -215,6 +215,11 @@ QDoubleSpinBox
SalomeApp_DoubleSpinBox.h
+ + SalomeApp_IntSpinBox + QSpinBox +
SalomeApp_IntSpinBox.h
+
PushButton1 diff --git a/src/DlgRef/DlgRef_3Sel4Spin2Check_QTD.ui b/src/DlgRef/DlgRef_3Sel4Spin2Check_QTD.ui index 41fcdd0d0..27e9963dd 100644 --- a/src/DlgRef/DlgRef_3Sel4Spin2Check_QTD.ui +++ b/src/DlgRef/DlgRef_3Sel4Spin2Check_QTD.ui @@ -56,13 +56,13 @@ 6 - + - + @@ -254,6 +254,11 @@ QDoubleSpinBox
SalomeApp_DoubleSpinBox.h
+ + SalomeApp_IntSpinBox + QSpinBox +
SalomeApp_IntSpinBox.h
+
PushButton1 diff --git a/src/DlgRef/Makefile.am b/src/DlgRef/Makefile.am index 4d3a1e05e..cbd156bb1 100644 --- a/src/DlgRef/Makefile.am +++ b/src/DlgRef/Makefile.am @@ -60,6 +60,7 @@ UIC_FILES = \ ui_DlgRef_2Sel1List_QTD.h \ ui_DlgRef_2Sel1Spin2Check_QTD.h \ ui_DlgRef_2Sel1Spin_QTD.h \ + ui_DlgRef_2Sel1SpinInt_QTD.h \ ui_DlgRef_2Sel2List_QTD.h \ ui_DlgRef_2Sel2Spin1Check_QTD.h \ ui_DlgRef_2Sel2Spin_QTD.h \ diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx index 80d028e25..72648767a 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx @@ -70,7 +70,7 @@ TransformationGUI_MultiRotationDlg::TransformationGUI_MultiRotationDlg mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose); mainFrame()->RadioButton3->close(); - GroupPoints = new DlgRef_2Sel1Spin(centralWidget()); + GroupPoints = new DlgRef_2Sel1SpinInt(centralWidget()); GroupPoints->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_SIMPLE")); GroupPoints->TextLabel1->setText(tr("GEOM_MAIN_OBJECT")); GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR")); @@ -124,23 +124,20 @@ void TransformationGUI_MultiRotationDlg::Init() SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100); - double SpecificStep1 = 5; - double SpecificStep2 = 1; + int SpecificStep1 = 5; + int SpecificStep2 = 1; // min, max, step and decimals for spin boxes & initial values - initSpinBox(GroupPoints->SpinBox_DX, 1.0, 999, SpecificStep2, 10); + initSpinBox(GroupPoints->SpinBox_DX, 1, 999, SpecificStep2); GroupPoints->SpinBox_DX->setValue(myNbTimes1); - GroupPoints->SpinBox_DX->setDecimals(0); initSpinBox(GroupDimensions->SpinBox_DX1, COORD_MIN, COORD_MAX, SpecificStep1, 10); // VSR: TODO: DBL_DIGITS_DISPLAY - initSpinBox(GroupDimensions->SpinBox_DY1, 1.0, 999, SpecificStep2, 10); + initSpinBox(GroupDimensions->SpinBox_DY1, 1, 999, SpecificStep2); initSpinBox(GroupDimensions->SpinBox_DX2, COORD_MIN, COORD_MAX, step, 10); // VSR: TODO: DBL_DIGITS_DISPLAY - initSpinBox(GroupDimensions->SpinBox_DY2, 1.0, 999, SpecificStep2, 10); + initSpinBox(GroupDimensions->SpinBox_DY2, 1, 999, SpecificStep2); GroupDimensions->SpinBox_DX1->setValue(myAng); GroupDimensions->SpinBox_DY1->setValue(myNbTimes1); GroupDimensions->SpinBox_DX2->setValue(myStep); GroupDimensions->SpinBox_DY2->setValue(myNbTimes2); - GroupDimensions->SpinBox_DY1->setDecimals(0); - GroupDimensions->SpinBox_DY2->setDecimals(0); // init variables myAng = 45.0; @@ -171,11 +168,11 @@ void TransformationGUI_MultiRotationDlg::Init() connect(GroupDimensions->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(GroupDimensions->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int))); connect(GroupDimensions->SpinBox_DX1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupDimensions->SpinBox_DY1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(GroupDimensions->SpinBox_DY1, SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int))); connect(GroupDimensions->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int))); connect(GroupDimensions->SpinBox_DX1,SIGNAL(textChanged( const QString& )), this, SLOT(TextValueChangedInSpinBox( const QString& ))); @@ -195,11 +192,11 @@ void TransformationGUI_MultiRotationDlg::Init() //================================================================================= void TransformationGUI_MultiRotationDlg::SetDoubleSpinBoxStep (double step) { - GroupPoints->SpinBox_DX->setSingleStep(step); + GroupPoints->SpinBox_DX->setSingleStep((int)step); GroupDimensions->SpinBox_DX1->setSingleStep(step); - GroupDimensions->SpinBox_DY1->setSingleStep(step); + GroupDimensions->SpinBox_DY1->setSingleStep((int)step); GroupDimensions->SpinBox_DX2->setSingleStep(step); - GroupDimensions->SpinBox_DY2->setSingleStep(step); + GroupDimensions->SpinBox_DY2->setSingleStep((int)step); } //================================================================================= @@ -478,6 +475,7 @@ void TransformationGUI_MultiRotationDlg::TextValueChangedInSpinBox(const QString GroupDimensions->CheckButton1->setChecked(false); GroupDimensions->CheckButton1->setEnabled(isDigit); } + //================================================================================= // function : ValueChangedInSpinBox() // purpose : @@ -486,14 +484,26 @@ void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox (double newValue) { QObject* send = (QObject*)sender(); - if (send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DY1) - myNbTimes1 = (int)newValue; - else if (send == GroupDimensions->SpinBox_DX1) + if (send == GroupDimensions->SpinBox_DX1) myAng = newValue; else if (send == GroupDimensions->SpinBox_DX2) myStep = newValue; + + displayPreview(); +} + +//================================================================================= +// function : ValueChangedInSpinBox() +// purpose : +//================================================================================= +void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox (int newValue) +{ + QObject* send = (QObject*)sender(); + + if (send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DY1) + myNbTimes1 = newValue; else if (send == GroupDimensions->SpinBox_DY2) - myNbTimes2 = (int)newValue; + myNbTimes2 = newValue; displayPreview(); } @@ -508,9 +518,7 @@ void TransformationGUI_MultiRotationDlg::ReverseAngle() int aConstructorId = getConstructorId(); - if (aConstructorId == 0) - GroupPoints->SpinBox_DX->setValue(myAng); - else if (aConstructorId == 1) + if (aConstructorId == 1) GroupDimensions->SpinBox_DX1->setValue(myAng); displayPreview(); diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h index 1134f7cfc..6e2c319df 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h @@ -29,7 +29,7 @@ #include class DlgRef_2Sel4Spin1Check; -class DlgRef_2Sel1Spin; +class DlgRef_2Sel1SpinInt; //================================================================================= // class : TransformationGUI_MultiRotationDlg @@ -65,7 +65,7 @@ private: // to initialize the first selection field with a selected object on the dialog creation bool myInitial; - DlgRef_2Sel1Spin* GroupPoints; + DlgRef_2Sel1SpinInt* GroupPoints; DlgRef_2Sel4Spin1Check* GroupDimensions; private slots: @@ -77,6 +77,7 @@ private slots: void SetEditCurrentArgument(); void ReverseAngle(); void ValueChangedInSpinBox( double ); + void ValueChangedInSpinBox( int ); void TextValueChangedInSpinBox( const QString& ); void ConstructorsClicked( int ); void SetDoubleSpinBoxStep( double ); diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx index e4c81518b..9d6bc29ef 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx @@ -130,24 +130,21 @@ void TransformationGUI_MultiTranslationDlg::Init() SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100); - double SpecificStep = 1; + int SpecificStep = 1; // min, max, step and decimals for spin boxes & initial values initSpinBox(GroupPoints->SpinBox_DX, COORD_MIN, COORD_MAX, step, 10); // VSR: TODO: DBL_DIGITS_DISPLAY - initSpinBox(GroupPoints->SpinBox_DY, 1, 999, SpecificStep, 10); + initSpinBox(GroupPoints->SpinBox_DY, 1, 999, SpecificStep); GroupPoints->SpinBox_DX->setValue(myStepU); GroupPoints->SpinBox_DY->setValue(myNbTimesU); - GroupPoints->SpinBox_DY->setDecimals(0); initSpinBox(GroupDimensions->SpinBox_DX1, COORD_MIN, COORD_MAX, step, 10); // VSR: TODO: DBL_DIGITS_DISPLAY - initSpinBox(GroupDimensions->SpinBox_DY1, 1, 999, SpecificStep, 10); + initSpinBox(GroupDimensions->SpinBox_DY1, 1, 999, SpecificStep); initSpinBox(GroupDimensions->SpinBox_DX2, COORD_MIN, COORD_MAX, step, 10); // VSR: TODO: DBL_DIGITS_DISPLAY - initSpinBox(GroupDimensions->SpinBox_DY2, 1, 999, SpecificStep, 10); + initSpinBox(GroupDimensions->SpinBox_DY2, 1, 999, SpecificStep); GroupDimensions->SpinBox_DX1->setValue(myStepU); GroupDimensions->SpinBox_DY1->setValue(myNbTimesU); GroupDimensions->SpinBox_DX2->setValue(myStepV); GroupDimensions->SpinBox_DY2->setValue(myNbTimesV); - GroupDimensions->SpinBox_DY1->setDecimals(0); - GroupDimensions->SpinBox_DY2->setDecimals(0); // init variables myStepU = myStepV = 50.0; @@ -181,11 +178,11 @@ void TransformationGUI_MultiTranslationDlg::Init() connect(GroupDimensions->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int))); connect(GroupDimensions->SpinBox_DX1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupDimensions->SpinBox_DY1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(GroupDimensions->SpinBox_DY1, SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int))); connect(GroupDimensions->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); + connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int))); connect(GroupPoints->SpinBox_DX, SIGNAL(textChanged(const QString& )), this, SLOT(TextValueChangedInSpinBox(const QString& ))); @@ -212,11 +209,11 @@ void TransformationGUI_MultiTranslationDlg::Init() void TransformationGUI_MultiTranslationDlg::SetDoubleSpinBoxStep (double step) { GroupPoints->SpinBox_DX->setSingleStep(step); - GroupPoints->SpinBox_DY->setSingleStep(step); + GroupPoints->SpinBox_DY->setSingleStep((int)step); GroupDimensions->SpinBox_DX1->setSingleStep(step); - GroupDimensions->SpinBox_DY1->setSingleStep(step); + GroupDimensions->SpinBox_DY1->setSingleStep((int)step); GroupDimensions->SpinBox_DX2->setSingleStep(step); - GroupDimensions->SpinBox_DY2->setSingleStep(step); + GroupDimensions->SpinBox_DY2->setSingleStep((int)step); } //================================================================================= @@ -561,18 +558,35 @@ void TransformationGUI_MultiTranslationDlg::ValueChangedInSpinBox (double newVal case 0: if (send == GroupPoints->SpinBox_DX) myStepU = newValue; - else if (send == GroupPoints->SpinBox_DY) - myNbTimesU = (int)newValue; break; case 1: if (send == GroupDimensions->SpinBox_DX1) myStepU = newValue; - else if (send == GroupDimensions->SpinBox_DY1) - myNbTimesU = (int)newValue; else if (send == GroupDimensions->SpinBox_DX2) myStepV = newValue; + break; + } + + displayPreview(); +} + +//================================================================================= +// function : ValueChangedInSpinBox() +// purpose : +//================================================================================= +void TransformationGUI_MultiTranslationDlg::ValueChangedInSpinBox (int newValue) +{ + QObject* send = (QObject*)sender(); + switch (getConstructorId()) { + case 0: + if (send == GroupPoints->SpinBox_DY) + myNbTimesU = newValue; + break; + case 1: + if (send == GroupDimensions->SpinBox_DY1) + myNbTimesU = newValue; else if (send == GroupDimensions->SpinBox_DY2) - myNbTimesV = (int)newValue; + myNbTimesV = newValue; break; } diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h index ab7d67b6a..112147caa 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h @@ -78,6 +78,7 @@ private slots: void ReverseStepU(); void ReverseStepV(); void ValueChangedInSpinBox( double ); + void ValueChangedInSpinBox( int ); void TextValueChangedInSpinBox( const QString& ); void ConstructorsClicked( int ); void SetDoubleSpinBoxStep( double ); -- 2.39.2