Salome HOME
Bug IPAL20689 - Problem with the Mutli-Transformation dialog
authorouv <ouv@opencascade.com>
Wed, 25 Feb 2009 08:54:44 +0000 (08:54 +0000)
committerouv <ouv@opencascade.com>
Wed, 25 Feb 2009 08:54:44 +0000 (08:54 +0000)
14 files changed:
src/BlocksGUI/BlocksGUI_TrsfDlg.cxx
src/BlocksGUI/BlocksGUI_TrsfDlg.h
src/DlgRef/DlgRef.cxx
src/DlgRef/DlgRef.h
src/DlgRef/DlgRef.pro
src/DlgRef/DlgRef_2Sel1SpinInt_QTD.ui [new file with mode: 0644]
src/DlgRef/DlgRef_2Sel2Spin1Check_QTD.ui
src/DlgRef/DlgRef_2Sel4Spin1Check_QTD.ui
src/DlgRef/DlgRef_3Sel4Spin2Check_QTD.ui
src/DlgRef/Makefile.am
src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx
src/TransformationGUI/TransformationGUI_MultiRotationDlg.h
src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx
src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h

index 9e5e91a97b83ad142dc1b246f531ec9fc583e7fa..9508f69e9f656a6165ede0f36e1463ebb6d0dcac 100644 (file)
@@ -111,11 +111,11 @@ BlocksGUI_TrsfDlg::~BlocksGUI_TrsfDlg()
 void BlocksGUI_TrsfDlg::Init()
 {
   // Set range of spinboxes
-  double SpecificStep = 1.0;
-  QMap<int, SalomeApp_DoubleSpinBox*>::iterator anIter;
+  int SpecificStep = 1;
+  QMap<int, SalomeApp_IntSpinBox*>::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<int, SalomeApp_DoubleSpinBox*>::iterator anIterSpin;
+  QMap<int, SalomeApp_IntSpinBox*>::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);
index a0f823f143975d15f490bd4ad229e0122b2dc32a..558ea75161aa35d26d8ff4e0d715e89033e16108 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <QMap>
 
-class SalomeApp_DoubleSpinBox;
+class SalomeApp_IntSpinBox;
 class QGroupBox;
 class QPushButton;
 class QLineEdit;
@@ -79,7 +79,7 @@ private:
 
   QMap<int, QPushButton*>            mySelBtn;
   QMap<int, QLineEdit*>              mySelName;
-  QMap<int, SalomeApp_DoubleSpinBox*> mySpinBox;
+  QMap<int, SalomeApp_IntSpinBox*>   mySpinBox;
 
 private slots:
   void                               ClickOnOk();
index c22828f46e1bf274c874f8b9ac9542861ac0cf48..0b0f48585454a86a320e89d41f77ab6248ab77d9 100644 (file)
@@ -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
 //////////////////////////////////////////
index d786fe841a6e0e1b1c6526f88267f732b7bf179d..69b58ca64fe929291f4ab6950aceaa6a48403be8 100644 (file)
@@ -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
 //////////////////////////////////////////
index 1abf890598656c10d0a893ddcaa73fa48cc698a3..1c01ee441a8d5b6bcb1b4564f25ff08cd8d118c6 100644 (file)
@@ -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 (file)
index 0000000..c86bf82
--- /dev/null
@@ -0,0 +1,169 @@
+<ui version="4.0" >
+ <class>DlgRef_2Sel1SpinInt_QTD</class>
+ <widget class="QWidget" name="DlgRef_2Sel1SpinInt_QTD" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>156</width>
+    <height>99</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string/>
+  </property>
+  <layout class="QGridLayout" >
+   <property name="leftMargin" >
+    <number>0</number>
+   </property>
+   <property name="topMargin" >
+    <number>0</number>
+   </property>
+   <property name="rightMargin" >
+    <number>0</number>
+   </property>
+   <property name="bottomMargin" >
+    <number>0</number>
+   </property>
+   <property name="horizontalSpacing" >
+    <number>0</number>
+   </property>
+   <property name="verticalSpacing" >
+    <number>0</number>
+   </property>
+   <item row="0" column="0" >
+    <widget class="QGroupBox" name="GroupBox1" >
+     <property name="title" >
+      <string/>
+     </property>
+     <layout class="QGridLayout" >
+      <property name="leftMargin" >
+       <number>9</number>
+      </property>
+      <property name="topMargin" >
+       <number>9</number>
+      </property>
+      <property name="rightMargin" >
+       <number>9</number>
+      </property>
+      <property name="bottomMargin" >
+       <number>9</number>
+      </property>
+      <property name="horizontalSpacing" >
+       <number>6</number>
+      </property>
+      <property name="verticalSpacing" >
+       <number>6</number>
+      </property>
+      <item row="2" column="1" colspan="2" >
+       <widget class="SalomeApp_IntSpinBox" name="SpinBox_DX" />
+      </item>
+      <item row="2" column="0" >
+       <widget class="QLabel" name="TextLabel3" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="text" >
+         <string>TL3</string>
+        </property>
+        <property name="wordWrap" >
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0" >
+       <widget class="QLabel" name="TextLabel2" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="frameShape" >
+         <enum>QFrame::NoFrame</enum>
+        </property>
+        <property name="frameShadow" >
+         <enum>QFrame::Plain</enum>
+        </property>
+        <property name="text" >
+         <string>TL2</string>
+        </property>
+        <property name="wordWrap" >
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1" >
+       <widget class="QPushButton" name="PushButton1" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="text" >
+         <string/>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="2" >
+       <widget class="QLineEdit" name="LineEdit2" />
+      </item>
+      <item row="0" column="0" >
+       <widget class="QLabel" name="TextLabel1" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="text" >
+         <string>TL1</string>
+        </property>
+        <property name="wordWrap" >
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1" >
+       <widget class="QPushButton" name="PushButton2" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="text" >
+         <string/>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="2" >
+       <widget class="QLineEdit" name="LineEdit1" />
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11" />
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+  <customwidget>
+   <class>SalomeApp_IntSpinBox</class>
+   <extends>QSpinBox</extends>
+   <header location="global" >SalomeApp_IntSpinBox.h</header>
+  </customwidget>
+ </customwidgets>
+ <tabstops>
+  <tabstop>PushButton1</tabstop>
+  <tabstop>LineEdit1</tabstop>
+  <tabstop>PushButton2</tabstop>
+  <tabstop>LineEdit2</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
index 07800a567be5ac9ae43ced24a3f2c1f3119fca00..6a0b63ac2e706ec229e79630eb1b17c0838cf96e 100644 (file)
@@ -63,7 +63,7 @@
        </widget>
       </item>
       <item row="3" column="1" colspan="2" >
-       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
+       <widget class="SalomeApp_IntSpinBox" name="SpinBox_DY" />
       </item>
       <item row="2" column="1" colspan="2" >
        <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
    <extends>QDoubleSpinBox</extends>
    <header location="global" >SalomeApp_DoubleSpinBox.h</header>
   </customwidget>
+  <customwidget>
+   <class>SalomeApp_IntSpinBox</class>
+   <extends>QSpinBox</extends>
+   <header location="global" >SalomeApp_IntSpinBox.h</header>
+  </customwidget>
  </customwidgets>
  <tabstops>
   <tabstop>PushButton1</tabstop>
index 27e0b7e5640bfc69efea47f3406d54c4992aad5c..5d0afce71327ad053428abc00c80cd331985cea7 100644 (file)
        </widget>
       </item>
       <item row="6" column="1" colspan="2" >
-       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY2" />
+       <widget class="SalomeApp_IntSpinBox" name="SpinBox_DY2" />
       </item>
       <item row="5" column="1" colspan="2" >
        <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX2" />
       </item>
       <item row="3" column="1" colspan="2" >
-       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY1" />
+       <widget class="SalomeApp_IntSpinBox" name="SpinBox_DY1" />
       </item>
       <item row="2" column="1" colspan="2" >
        <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX1" />
    <extends>QDoubleSpinBox</extends>
    <header location="global" >SalomeApp_DoubleSpinBox.h</header>
   </customwidget>
+  <customwidget>
+   <class>SalomeApp_IntSpinBox</class>
+   <extends>QSpinBox</extends>
+   <header location="global" >SalomeApp_IntSpinBox.h</header>
+  </customwidget>
  </customwidgets>
  <tabstops>
   <tabstop>PushButton1</tabstop>
index 41fcdd0d0f169e971af3e115ad3e86093fd029ac..27e9963dd44476acd08f4cd3ea2b4f882624bde7 100644 (file)
        <number>6</number>
       </property>
       <item row="7" column="1" colspan="2" >
-       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY2" />
+       <widget class="SalomeApp_IntSpinBox" name="SpinBox_DY2" />
       </item>
       <item row="6" column="1" colspan="2" >
        <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX2" />
       </item>
       <item row="4" column="1" colspan="2" >
-       <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY1" />
+       <widget class="SalomeApp_IntSpinBox" name="SpinBox_DY1" />
       </item>
       <item row="3" column="1" colspan="2" >
        <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX1" />
    <extends>QDoubleSpinBox</extends>
    <header location="global" >SalomeApp_DoubleSpinBox.h</header>
   </customwidget>
+  <customwidget>
+   <class>SalomeApp_IntSpinBox</class>
+   <extends>QSpinBox</extends>
+   <header location="global" >SalomeApp_IntSpinBox.h</header>
+  </customwidget>
  </customwidgets>
  <tabstops>
   <tabstop>PushButton1</tabstop>
index 4d3a1e05e308ebd910d24af05eefb57247674bba..cbd156bb1dc1060c7ebcb7c1ef3c25dc95f755d0 100644 (file)
@@ -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               \
index 80d028e25d36d829edc69fff1cca0fb6e71d9224..72648767abcb2a7503fd109d5f2b86451559b105 100644 (file)
@@ -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();
index 1134f7cfc6d3fbe6dab8b638bb945e0b59ddae4b..6e2c319df26076cd82c8717e691d39c8143bc659 100644 (file)
@@ -29,7 +29,7 @@
 #include <GEOMBase_Skeleton.h>
 
 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 );
index e4c81518b93c8e3a4799f741adc95d19a15c71f0..9d6bc29ef1e0945a0379ad2f2dad371309c9c89e 100644 (file)
@@ -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;
   }
 
index ab7d67b6ac266f189c8a660544c88d3cd75da124..112147caabdd39dbbd12a27ceef098879ffca0fc 100644 (file)
@@ -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 );