Salome HOME
Issue 0020580: improved validation in integer and double spin boxes, possibility...
authorsan <san@opencascade.com>
Mon, 5 Apr 2010 11:43:42 +0000 (11:43 +0000)
committersan <san@opencascade.com>
Mon, 5 Apr 2010 11:43:42 +0000 (11:43 +0000)
30 files changed:
resources/SalomeApp.xml
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx
src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx
src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx
src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
src/SMESHGUI/SMESHGUI_NodesDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h
src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h
src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
src/SMESHGUI/SMESHGUI_RotationDlg.cxx
src/SMESHGUI/SMESHGUI_ScaleDlg.cxx
src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
src/SMESHGUI/SMESHGUI_SpinBox.cxx
src/SMESHGUI/SMESHGUI_SpinBox.h
src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
src/SMESHGUI/SMESH_msg_en.ts
src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx
src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx
src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.h
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx

index 6908958865f8af350220444e18719fd30e76b2c5..7906feaab07b10de29968c06682c29e8c14c3026 100644 (file)
     <parameter name="quadratic_mode"               value="0"/>
     <parameter name="max_angle"                    value="2"/>
     <parameter name="documentation"                value="smesh_help"/>
+    <!-- Input field precisions -->
+    <parameter name="def_precision"                value="3"  />
+    <parameter name="length_precision"             value="-6"  />
+    <parameter name="angle_precision"              value="-3"  />
+    <parameter name="len_tol_precision"            value="-7"  />
+    <parameter name="parametric_precision"         value="-6"  />
+    <parameter name="area_precision"               value="-6"  />
+    <parameter name="vol_precision"                value="-6"  />
   </section>
   <section name="smesh_help" >
     <parameter name="sub_menu"          value="%1 module"/>
index 52c6c2ab0a04120d5ccfeb46f5aff3faedbdffc6..fcc5a1b03d5bd1e523b6c493533b156f68289fdd 100644 (file)
@@ -3822,6 +3822,32 @@ void SMESHGUI::createPreferences()
                              "SMESH", "nb_segments_per_edge" );
   setPreferenceProperty( nbSeg, "min", 1 );
   setPreferenceProperty( nbSeg, "max", 10000000 );
+  
+  // Quantities with individual precision settings
+  int precGroup = addPreference( tr( "SMESH_PREF_GROUP_PRECISION" ), genTab );
+  setPreferenceProperty( precGroup, "columns", 2 );
+  
+  const int nbQuantities = 6;
+  int precs[nbQuantities], ii = 0;
+  precs[ii++] = addPreference( tr( "SMESH_PREF_length_precision" ), precGroup,
+                            LightApp_Preferences::IntSpin, "SMESH", "length_precision" );  
+  precs[ii++] = addPreference( tr( "SMESH_PREF_angle_precision" ), precGroup,
+                            LightApp_Preferences::IntSpin, "SMESH", "angle_precision" );
+  precs[ii++] = addPreference( tr( "SMESH_PREF_len_tol_precision" ), precGroup,
+                            LightApp_Preferences::IntSpin, "SMESH", "len_tol_precision" );
+  precs[ii++] = addPreference( tr( "SMESH_PREF_parametric_precision" ), precGroup,
+                            LightApp_Preferences::IntSpin, "SMESH", "parametric_precision" );
+  precs[ii++] = addPreference( tr( "SMESH_PREF_area_precision" ), precGroup,
+                            LightApp_Preferences::IntSpin, "SMESH", "area_precision" );
+  precs[ii  ] = addPreference( tr( "SMESH_PREF_vol_precision" ), precGroup,
+                            LightApp_Preferences::IntSpin, "SMESH", "vol_precision" );  
+  
+  // Set property for precision value for spinboxes
+  for ( ii = 0; ii < nbQuantities; ii++ ){
+    setPreferenceProperty( precs[ii], "min", -10 );
+    setPreferenceProperty( precs[ii], "max", 10 );
+    setPreferenceProperty( precs[ii], "precision", 2 );
+  }   
 
   // Mesh tab ------------------------------------------------------------------------
   int meshTab = addPreference( tr( "PREF_TAB_MESH" ) );
index 1e58867d020b787d620e2ecf65bac563ffbd279d..65f30ece8883d3f4fd88c986ad514e9dfc76b2ff 100644 (file)
@@ -137,7 +137,7 @@ SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule )
   TextLabelTol = new QLabel(tr("SMESH_TOLERANCE"), GroupArgs);
   TextLabelTol->setAlignment(Qt::AlignCenter);
   SpinBoxTol = new SMESHGUI_SpinBox(GroupArgs);
-  SpinBoxTol->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, 6);
+  SpinBoxTol->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, "len_tol_precision" );
 
   GroupArgsLayout->addWidget(TextLabelMeshes, 0, 0);
   GroupArgsLayout->addWidget(SelectButton,    0, 1);
index be11acf6cd20a9c0955a1b37113c7d7c7656c18b..208434c2eca410490d8afcf7e097d1f84c45be6a 100644 (file)
@@ -343,7 +343,7 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg( SMESHGUI* theModule ):
   SMESHGUI_ClippingDlgLayout->setMargin(MARGIN);
 
   // Controls for selecting, creating, deleting planes
-  QGroupBox* GroupPlanes = new QGroupBox(tr("Clipping planes"), this);
+  QGroupBox* GroupPlanes = new QGroupBox(tr("CLIP_PLANES"), this);
   QHBoxLayout* GroupPlanesLayout = new QHBoxLayout(GroupPlanes);
   GroupPlanesLayout->setSpacing(SPACING);
   GroupPlanesLayout->setMargin(MARGIN);
@@ -373,18 +373,18 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg( SMESHGUI* theModule ):
 
   SpinBoxDistance = new SMESHGUI_SpinBox(GroupParameters);
 
-  TextLabelRot1 = new QLabel(tr("Rotation around X (Y to Z):"), GroupParameters);
+  TextLabelRot1 = new QLabel(tr("ROTATION_AROUND_X_Y2Z"), GroupParameters);
 
   SpinBoxRot1 = new SMESHGUI_SpinBox(GroupParameters);
 
-  TextLabelRot2 = new QLabel(tr("Rotation around Y (X to Z):"), GroupParameters);
+  TextLabelRot2 = new QLabel(tr("ROTATION_AROUND_Y_X2Z"), GroupParameters);
 
   SpinBoxRot2 = new SMESHGUI_SpinBox(GroupParameters);
 
-  PreviewCheckBox = new QCheckBox(tr("Show preview"), GroupParameters);
+  PreviewCheckBox = new QCheckBox(tr("SHOW_PREVIEW"), GroupParameters);
   PreviewCheckBox->setChecked(true);
 
-  AutoApplyCheckBox = new QCheckBox(tr("Auto Apply"), GroupParameters);
+  AutoApplyCheckBox = new QCheckBox(tr("AUTO_APPLY"), GroupParameters);
   AutoApplyCheckBox->setChecked(false);
 
   GroupParametersLayout->addWidget(TextLabelOrientation, 0, 0);
@@ -426,13 +426,13 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg( SMESHGUI* theModule ):
   SMESHGUI_ClippingDlgLayout->addWidget(GroupButtons);
 
   // Initial state
-  SpinBoxDistance->RangeStepAndValidator(0.0, 1.0, 0.01, 3);
-  SpinBoxRot1->RangeStepAndValidator(-180.0, 180.0, 1, 3);
-  SpinBoxRot2->RangeStepAndValidator(-180.0, 180.0, 1, 3);
+  SpinBoxDistance->RangeStepAndValidator(0.0, 1.0, 0.01, "length_precision" );
+  SpinBoxRot1->RangeStepAndValidator(-180.0, 180.0, 1, "angle_precision" );
+  SpinBoxRot2->RangeStepAndValidator(-180.0, 180.0, 1, "angle_precision" );
 
-  ComboBoxOrientation->addItem(tr("|| X-Y"));
-  ComboBoxOrientation->addItem(tr("|| Y-Z"));
-  ComboBoxOrientation->addItem(tr("|| Z-X"));
+  ComboBoxOrientation->addItem(tr("ALONG_XY"));
+  ComboBoxOrientation->addItem(tr("ALONG_YZ"));
+  ComboBoxOrientation->addItem(tr("ALONG_ZX"));
 
   SpinBoxDistance->SetValue(0.5);
 
@@ -699,16 +699,16 @@ void SMESHGUI_ClippingDlg::onSelectOrientation (int theItem)
     return;
 
   if      (theItem == 0) {
-    TextLabelRot1->setText(tr("Rotation around X (Y to Z):"));
-    TextLabelRot2->setText(tr("Rotation around Y (X to Z):"));
+    TextLabelRot1->setText(tr("ROTATION_AROUND_X_Y2Z"));
+    TextLabelRot2->setText(tr("ROTATION_AROUND_Y_X2Z"));
   }
   else if (theItem == 1) {
-    TextLabelRot1->setText(tr("Rotation around Y (Z to X):"));
-    TextLabelRot2->setText(tr("Rotation around Z (Y to X):"));
+    TextLabelRot1->setText(tr("ROTATION_AROUND_Y_Z2X"));
+    TextLabelRot2->setText(tr("ROTATION_AROUND_Z_Y2X"));
   }
   else if (theItem == 2) {
-    TextLabelRot1->setText(tr("Rotation around Z (X to Y):"));
-    TextLabelRot2->setText(tr("Rotation around X (Z to Y):"));
+    TextLabelRot1->setText(tr("ROTATION_AROUND_Z_X2Y"));
+    TextLabelRot2->setText(tr("ROTATION_AROUND_X_Z2Y"));
   }
 
   if((QComboBox*)sender() == ComboBoxOrientation)
@@ -726,7 +726,7 @@ void SMESHGUI_ClippingDlg::Sinchronize()
 
   QString aName;
   for(int i = 1; i<=aNbPlanes; i++) {
-    aName = QString(tr("Plane# %1")).arg(i);
+    aName = QString(tr("PLANE_NUM")).arg(i);
     ComboBoxPlanes->addItem(aName);
   }
 
@@ -737,7 +737,7 @@ void SMESHGUI_ClippingDlg::Sinchronize()
   if (anIsControlsEnable) {
     onSelectPlane(aPos);
   } else {
-    ComboBoxPlanes->addItem(tr("No planes"));
+    ComboBoxPlanes->addItem(tr("NO_PLANES"));
     SpinBoxRot1->SetValue(0.0);
     SpinBoxRot2->SetValue(0.0);
     SpinBoxDistance->SetValue(0.5);
index ac4ce055082a926c93c5009aadbd0251d1acc57d..643893d9ec04890857d7060c6104737fc3892c34 100644 (file)
@@ -520,7 +520,7 @@ SMESHGUI_EditMeshDlg::~SMESHGUI_EditMeshDlg()
 void SMESHGUI_EditMeshDlg::Init()
 {
   if (myAction == 0) {
-    SpinBoxTolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, 5);
+    SpinBoxTolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, "len_tol_precision");
     SpinBoxTolerance->SetValue(1e-05);
   }
 
index 2131b25e6c403ce886222b302a82541b1ecc1090..4b4a633e92ec1d3b15995d9512b0a397459f96a4 100644 (file)
@@ -307,10 +307,10 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
 
   /***************************************************************/
   // Initialisations
-  XSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  YSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  ZSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  AngleSpin->RangeStepAndValidator(-180.0, 180.0, 5.0, 3);
+  XSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  YSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  ZSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  AngleSpin->RangeStepAndValidator(-180.0, 180.0, 5.0, "angle_precision");
 
   mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
 
index 7c32fc1e24b9b94fd64d8344609f63923d715dd4..97c91c13560598862d2f1cf0e889cf104edd8cde 100644 (file)
@@ -249,16 +249,16 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
   SMESHGUI_ExtrusionDlgLayout->addWidget(GroupButtons);
 
   /* Initialisations */
-  SpinBox_Vx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, 3);
-  SpinBox_Vy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, 3);
-  SpinBox_Vz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, 3);
+  SpinBox_Vx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, "length_precision");
+  SpinBox_Vy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, "length_precision");
+  SpinBox_Vz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.01, "length_precision");
 
-  SpinBox_Dx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_Dy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_Dz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
+  SpinBox_Dx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_Dy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_Dz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
   
   SpinBox_NbSteps->setRange(1, 999999);
-  SpinBox_VDist->RangeStepAndValidator(0, COORD_MAX, 10.0, 3);
+  SpinBox_VDist->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
 
   RadioButton1->setChecked(true);
   RadioButton3->setChecked(true);
index 03cca227b3a7ada8fa409e004ad4bb7d1e8ed95c..78a64bee560658990e716bbb83ba4d041e564279 100644 (file)
@@ -124,9 +124,9 @@ QWidget* SMESHGUI_FindElemByPointDlg::createMainFrame (QWidget* theParent)
   QLabel* aZLabel = new QLabel(tr("SMESH_Z"), aCoordGrp);
   myZ = new SMESHGUI_SpinBox(aCoordGrp);
 
-  myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
-  myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
-  myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
+  myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
   myX->SetValue(0);
   myY->SetValue(0);
   myZ->SetValue(0);
index ae769c301a1f3751f07da2e509974af69008eaa7..b2b362d95dc42c5ef96541258247f2f1d046968a 100644 (file)
@@ -147,9 +147,9 @@ QWidget* SMESHGUI_MakeNodeAtPointDlg::createMainFrame (QWidget* theParent)
   QLabel* aZLabel = new QLabel(tr("SMESH_Z"), aCoordGrp);
   myZ = new SMESHGUI_SpinBox(aCoordGrp);
 
-  myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
-  myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
-  myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
+  myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
 
   aCoordGrpLayout->addWidget(myCoordBtn);
   aCoordGrpLayout->addWidget(aXLabel);
index 6243255afc44a7b7a51c87d35e5b30785cae6869..e4600ca32a1410ea810fd11cb0a5b546fb59b8f4 100644 (file)
@@ -210,9 +210,9 @@ QWidget* SMESHGUI_MoveNodesDlg::createMainFrame (QWidget* theParent)
   aCoordGrpLayout->addWidget(myZ);
 
   //------------------------------------------------------------
-  myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, DBL_DIGITS_DISPLAY);
-  myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, DBL_DIGITS_DISPLAY);
-  myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, DBL_DIGITS_DISPLAY);
+  myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, "length_precision");
+  myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, "length_precision");
+  myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, "length_precision");
 
   //------------------------------------------------------------
   QVBoxLayout* aLay = new QVBoxLayout(aFrame);
index edef76173ee9775b7f6550c6ef1a4272aeb5ef7c..27aaa8c07adabaeedb97b63f1315ff1ab9fffc8c 100755 (executable)
@@ -1163,7 +1163,7 @@ SMESHGUI_UnionOfTrianglesDlg
 
   QLabel* aLab = new QLabel (tr("MAXIMUM_ANGLE"), aMaxAngleGrp);
   myMaxAngleSpin = new SMESHGUI_SpinBox (aMaxAngleGrp);
-  myMaxAngleSpin->RangeStepAndValidator(0, 180.0, 1.0, 3);
+  myMaxAngleSpin->RangeStepAndValidator(0, 180.0, 1.0, "angle_precision");
   myMaxAngleSpin->SetValue(30.0);
 
   aMaxAngleGrpLayout->addWidget(aLab);
index ebc42b1987e9ef85dc86a42c9c178814b500a4ad..9b5c426101c8894f73610819a498a6e55e00a195 100644 (file)
@@ -350,9 +350,9 @@ void SMESHGUI_NodesDlg::Init()
   double step = 25.0;
 
   /* min, max, step and decimals for spin boxes */
-  SpinBox_X->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY );
-  SpinBox_Y->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY );
-  SpinBox_Z->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY );
+  SpinBox_X->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, "length_precision" );
+  SpinBox_Y->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, "length_precision" );
+  SpinBox_Z->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, "length_precision" );
   SpinBox_X->SetValue( 0.0 );
   SpinBox_Y->SetValue( 0.0 );
   SpinBox_Z->SetValue( 0.0 );
index 3b86bb27e0ea590f4226f6018728b9c0b81e9b6f..9a01ad34e7719e6bf154bced7de93910ee091f6d 100644 (file)
 #include "SMESHGUI_Preferences_ColorDlg.h"
 
 #include "SMESHGUI.h"
+#include "SMESHGUI_SpinBox.h"
 #include "SMESHGUI_Utils.h"
 
 // SALOME GUI includes
 #include <SUIT_Desktop.h>
 #include <QtxColorButton.h>
-#include <QtxDoubleSpinBox.h>
-#include <QtxIntSpinBox.h>
 #include <VTKViewer_MarkerWidget.h>
+#include <SalomeApp_IntSpinBox.h>
 
 // Qt includes
 #include <QGroupBox>
@@ -43,7 +43,6 @@
 #include <QVBoxLayout>
 #include <QHBoxLayout>
 #include <QGridLayout>
-#include <QSpinBox>
 #include <QCheckBox>
 
 #define SPACING 6
@@ -88,21 +87,24 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
   btn0DElementsColor = new QtxColorButton( ButtonGroup1 );
 
   QLabel* TextLabel_0DElements_Size = new QLabel( tr( "Size of 0D elements" ), ButtonGroup1 );
-  SpinBox_0DElements_Size = new QSpinBox( ButtonGroup1 );
+  SpinBox_0DElements_Size = new SalomeApp_IntSpinBox( ButtonGroup1 );
+  SpinBox_0DElements_Size->setAcceptNames( false ); // No Notebook variables allowed
   SpinBox_0DElements_Size->setRange( 1, 10 );
   SpinBox_0DElements_Size->setSingleStep( 1 );
   SpinBox_0DElements_Size->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   SpinBox_0DElements_Size->setButtonSymbols( QSpinBox::PlusMinus );
 
   QLabel* TextLabel_Width = new QLabel( tr( "Width" ), ButtonGroup1 );
-  SpinBox_Width = new QSpinBox( ButtonGroup1 );
+  SpinBox_Width = new SalomeApp_IntSpinBox( ButtonGroup1 );
+  SpinBox_Width->setAcceptNames( false ); // No Notebook variables allowed
   SpinBox_Width->setRange( 0, 5 );
   SpinBox_Width->setSingleStep( 1 );
   SpinBox_Width->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   SpinBox_Width->setButtonSymbols( QSpinBox::PlusMinus );
 
   QLabel* TextLabel_ShrinkCoeff = new QLabel( tr( "Shrink coef." ), ButtonGroup1 );
-  SpinBox_Shrink = new QtxIntSpinBox( ButtonGroup1 );
+  SpinBox_Shrink = new SalomeApp_IntSpinBox( ButtonGroup1 );
+  SpinBox_Shrink->setAcceptNames( false ); // No Notebook variables allowed
   SpinBox_Shrink->setRange( 20, 100 );
   SpinBox_Shrink->setSingleStep( 1 );
   SpinBox_Shrink->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
@@ -156,9 +158,9 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
   btnOrientationColor = new QtxColorButton( ButtonGroup3 );
 
   QLabel* TextLabel_Orientation_Scale = new QLabel( tr( "Scale" ), ButtonGroup3 );
-  SpinBox_Orientation_Scale = new QtxDoubleSpinBox( ButtonGroup3 );
-  SpinBox_Orientation_Scale->setRange( 0.05, 0.5 );
-  SpinBox_Orientation_Scale->setSingleStep( 0.05 );
+  SpinBox_Orientation_Scale = new SMESHGUI_SpinBox( ButtonGroup3 );
+  SpinBox_Orientation_Scale->setAcceptNames( false ); // No Notebook variables allowed
+  SpinBox_Orientation_Scale->RangeStepAndValidator( .05, .5, .05, "parametric_precision" );
   SpinBox_Orientation_Scale->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   SpinBox_Orientation_Scale->setButtonSymbols( QSpinBox::PlusMinus );
 
index cf899f3ad9e9d54ed2524aae9444704603c047e6..404edcf34df4c808cb112cdcf4fc6313c23307a3 100644 (file)
 #include <QDialog>
 
 class QCheckBox;
-class QSpinBox;
 class SMESHGUI;
-class QtxDoubleSpinBox;
-class QtxIntSpinBox;
+class SMESHGUI_SpinBox;
+class SalomeApp_IntSpinBox;
 class QtxColorButton;
 class VTKViewer_MarkerWidget;
 
@@ -85,13 +84,13 @@ private:
   QtxColorButton*       btnBackFaceColor;
   QtxColorButton*       btnOutlineColor;
   QtxColorButton*       btn0DElementsColor;
-  QSpinBox*             SpinBox_0DElements_Size;
-  QSpinBox*             SpinBox_Width;
-  QtxIntSpinBox*        SpinBox_Shrink;
+  SalomeApp_IntSpinBox* SpinBox_0DElements_Size;
+  SalomeApp_IntSpinBox* SpinBox_Width;
+  SalomeApp_IntSpinBox* SpinBox_Shrink;
   QtxColorButton*       btnNodeColor;
   VTKViewer_MarkerWidget* MarkerWidget;
   QtxColorButton*       btnOrientationColor;
-  QtxDoubleSpinBox*     SpinBox_Orientation_Scale;
+  SMESHGUI_SpinBox*     SpinBox_Orientation_Scale;
   QCheckBox*            CheckBox_Orientation_3DVectors;
 };
 
index 175677f536e81e467a2852b50c968e9367987664..218efdfffd5ec3df68d1a1d014b7a76077cec184 100644 (file)
@@ -27,6 +27,7 @@
 #include "SMESHGUI_Preferences_ScalarBarDlg.h"
 
 #include "SMESHGUI.h"
+#include "SMESHGUI_SpinBox.h"
 #include "SMESHGUI_VTKUtils.h"
 #include "SMESHGUI_Utils.h"
 
@@ -41,8 +42,8 @@
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 #include <SALOME_ListIO.hxx>
+#include <SalomeApp_IntSpinBox.h>
 
-#include <QtxDoubleSpinBox.h>
 #include <QtxColorButton.h>
 
 // Qt includes
@@ -54,7 +55,6 @@
 #include <QLineEdit>
 #include <QPushButton>
 #include <QRadioButton>
-#include <QSpinBox>
 #include <QHBoxLayout>
 #include <QVBoxLayout>
 #include <QGridLayout>
@@ -199,13 +199,15 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
   QHBoxLayout* myLabColorGrpLayout = new QHBoxLayout( myLabColorGrp );
   myLabColorGrpLayout->setSpacing( SPACING_SIZE ); myLabColorGrpLayout->setMargin( MARGIN_SIZE );
 
-  myColorsSpin = new QSpinBox( myLabColorGrp );
+  myColorsSpin = new SalomeApp_IntSpinBox( myLabColorGrp );
+  myColorsSpin->setAcceptNames( false ); // No Notebook variables allowed
   myColorsSpin->setRange( 2, 256 );
   myColorsSpin->setSingleStep( 1 );
   myColorsSpin->setMinimumWidth( MINIMUM_WIDTH );
   myColorsSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
 
-  myLabelsSpin = new QSpinBox( myLabColorGrp );
+  myLabelsSpin = new SalomeApp_IntSpinBox( myLabColorGrp );
+  myLabelsSpin->setAcceptNames( false ); // No Notebook variables allowed
   myLabelsSpin->setRange( 2, 65 );
   myLabelsSpin->setSingleStep( 1 );
   myLabelsSpin->setMinimumWidth( MINIMUM_WIDTH );
@@ -242,19 +244,27 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
   QGridLayout* myOriginDimGrpLayout = new QGridLayout( myOriginDimGrp );
   myOriginDimGrpLayout->setSpacing( SPACING_SIZE ); myOriginDimGrpLayout->setMargin( MARGIN_SIZE );
 
-  myXSpin = new QtxDoubleSpinBox (0.0, 1.0, 0.1, myOriginDimGrp);
+  myXSpin = new SMESHGUI_SpinBox(myOriginDimGrp);
+  myXSpin->setAcceptNames( false );
+  myXSpin->RangeStepAndValidator( 0.0, 1.0, 0.1, "parametric_precision" );
   myXSpin->setMinimumWidth( MINIMUM_WIDTH );
   myXSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
 
-  myYSpin = new QtxDoubleSpinBox(0.0, 1.0, 0.1, myOriginDimGrp);
+  myYSpin = new SMESHGUI_SpinBox(myOriginDimGrp);
+  myYSpin->setAcceptNames( false );
+  myYSpin->RangeStepAndValidator( 0.0, 1.0, 0.1, "parametric_precision" );  
   myYSpin->setMinimumWidth( MINIMUM_WIDTH );
   myYSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
 
-  myWidthSpin = new QtxDoubleSpinBox(0.0, 1.0, 0.1, myOriginDimGrp);
+  myWidthSpin = new SMESHGUI_SpinBox(myOriginDimGrp);
+  myWidthSpin->setAcceptNames( false );
+  myWidthSpin->RangeStepAndValidator( 0.0, 1.0, 0.1, "parametric_precision" );    
   myWidthSpin->setMinimumWidth( MINIMUM_WIDTH );
   myWidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
 
-  myHeightSpin = new QtxDoubleSpinBox(0.0, 1.0, 0.1, myOriginDimGrp);
+  myHeightSpin = new SMESHGUI_SpinBox(myOriginDimGrp);
+  myHeightSpin->setAcceptNames( false );
+  myHeightSpin->RangeStepAndValidator( 0.0, 1.0, 0.1, "parametric_precision" );    
   myHeightSpin->setMinimumWidth( MINIMUM_WIDTH );
   myHeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
 
index cc41262020870dceaf32ddcbea92377521d6fe36..f980ac324c684c448640ff6182055b7746a71bb7 100644 (file)
@@ -39,11 +39,11 @@ class QLineEdit;
 class QPushButton;
 class QToolButton;
 class QRadioButton;
-class QSpinBox;
 
 class SMESHGUI;
 class SMESH_Actor;
-class QtxDoubleSpinBox;
+class SMESHGUI_SpinBox;
+class SalomeApp_IntSpinBox;
 class QtxColorButton;
 class LightApp_SelectionMgr;
 
@@ -103,18 +103,18 @@ private:
   QCheckBox*               myLabelsShadowCheck;
   
   QGroupBox*               myLabColorGrp;
-  QSpinBox*                myColorsSpin;
-  QSpinBox*                myLabelsSpin;
+  SalomeApp_IntSpinBox*    myColorsSpin;
+  SalomeApp_IntSpinBox*    myLabelsSpin;
 
   QGroupBox*               myOrientationGrp;
   QRadioButton*            myVertRadioBtn;
   QRadioButton*            myHorizRadioBtn;
 
   QGroupBox*               myOriginDimGrp;
-  QtxDoubleSpinBox*        myXSpin;
-  QtxDoubleSpinBox*        myYSpin;
-  QtxDoubleSpinBox*        myWidthSpin;
-  QtxDoubleSpinBox*        myHeightSpin;
+  SMESHGUI_SpinBox*        myXSpin;
+  SMESHGUI_SpinBox*        myYSpin;
+  SMESHGUI_SpinBox*        myWidthSpin;
+  SMESHGUI_SpinBox*        myHeightSpin;
 
   QGroupBox*               myButtonGrp;
   QPushButton*             myOkBtn;
index 484989dfd1e4e8c321906ebe5d04139281b39340..cae6339b0e65cce502faec7efa5ce0084a77d45b 100644 (file)
@@ -278,20 +278,20 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
   SMESHGUI_RevolutionDlgLayout->addWidget(GroupButtons);
 
   /* Initialisations */
-  SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
+  SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
 
   RadioButton3->setChecked(true);
 
-  SpinBox_Angle->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5.0, 3);
+  SpinBox_Angle->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5.0, "angle_precision");
 
   SpinBox_NbSteps->setRange(1, 999999);
 
-  SpinBox_Tolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, 6);
+  SpinBox_Tolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, "len_tol_precision");
 
   RadioButton1->setChecked(true);
 
index d9352dbc87e1403b4c868bcf5b827023aa70526d..a34ec8c65d4441a5b3201ada7c3c363455e8be25 100644 (file)
@@ -254,14 +254,14 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule )
   SMESHGUI_RotationDlgLayout->addWidget(GroupButtons);
 
   /* Initialisations */
-  SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-
-  SpinBox_Angle->RangeStepAndValidator(-360.0, +360.0, 5.0, 3);
+  SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+
+  SpinBox_Angle->RangeStepAndValidator(-360.0, +360.0, 5.0, "angle_precision");
 
   myConstructorId = 0;
   RadioButton1->setChecked(true);
index 9968b10eb7964b6f3541575214bb4658fc830f7e..c4706505edafd4a7291132ce8759a67a2c321aaf 100644 (file)
@@ -263,17 +263,14 @@ SMESHGUI_ScaleDlg::SMESHGUI_ScaleDlg( SMESHGUI* theModule )
   SMESHGUI_ScaleDlgLayout->addWidget(GroupButtons);
 
   /* Initialisations */
-  SpinBox1_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
-  SpinBox1_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
-  SpinBox1_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
-  //SpinBox_FX->RangeStepAndValidator(0.0, COORD_MAX, 1.0, DBL_DIGITS_DISPLAY);
-  //SpinBox_FY->RangeStepAndValidator(0.0, COORD_MAX, 1.0, DBL_DIGITS_DISPLAY);
-  //SpinBox_FZ->RangeStepAndValidator(0.0, COORD_MAX, 1.0, DBL_DIGITS_DISPLAY);
-  SpinBox_FX->RangeStepAndValidator(1.e-6, 1.e+6, 1.0, DBL_DIGITS_DISPLAY);
+  SpinBox1_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox1_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox1_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_FX->RangeStepAndValidator(1.e-6, 1.e+6, 1.0, "parametric_precision");
   SpinBox_FX->SetStep(0.1);
-  SpinBox_FY->RangeStepAndValidator(1.e-6, 1.e+6, 1.0, DBL_DIGITS_DISPLAY);
+  SpinBox_FY->RangeStepAndValidator(1.e-6, 1.e+6, 1.0, "parametric_precision");
   SpinBox_FY->SetStep(0.1);
-  SpinBox_FZ->RangeStepAndValidator(1.e-6, 1.e+6, 1.0, DBL_DIGITS_DISPLAY);
+  SpinBox_FZ->RangeStepAndValidator(1.e-6, 1.e+6, 1.0, "parametric_precision");
   SpinBox_FZ->SetStep(0.1);
 
   RadioButton1->setChecked(true);
index 1cab8d3f47eadf428db66ab14cf8efdbdde1370f..d0d6365a6fea9605440f879a0f696a5a1af40b82 100644 (file)
@@ -229,7 +229,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
   
   SpinBox_IterationLimit->setRange(1, 999999);
   SpinBox_IterationLimit->setValue(20);
-  SpinBox_AspectRatio->RangeStepAndValidator(0.0, +999999.999, 0.1, 3);
+  SpinBox_AspectRatio->RangeStepAndValidator(0.0, +999999.999, 0.1, "parametric_precision");
   SpinBox_AspectRatio->SetValue(1.1);
 
   GroupArguments->show();
index c617f5ec7cc182a1e2de911854c1e723a1c07ef5..13b84b813d5f112480692a1e4591543728d3334e 100644 (file)
 //
 #include "SMESHGUI_SpinBox.h"
 
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+
 // Qt includes
-#include <QDoubleValidator>
 #include <QLineEdit>
+#include <QVariant>
 
 //=================================================================================
 // class    : SMESHGUI_SpinBox()
@@ -93,15 +96,6 @@ QLineEdit* SMESHGUI_SpinBox::editor() const
   return SalomeApp_DoubleSpinBox::lineEdit();
 } 
 
-//=================================================================================
-// function : validator()
-// purpose  : returns validator
-//=================================================================================
-QDoubleValidator* SMESHGUI_SpinBox::validator() const
-{
-  return (QDoubleValidator*)editor()->validator();
-}
-
 //=================================================================================
 // function : RangeStepAndValidator()
 // purpose  :
@@ -109,12 +103,22 @@ QDoubleValidator* SMESHGUI_SpinBox::validator() const
 void SMESHGUI_SpinBox::RangeStepAndValidator( double min,
                                               double max,
                                               double step,
-                                              unsigned short precision )
+                                              const char* quantity )
 {
-  setPrecision(precision*(-1)); // PAL8769. Minus is for using 'g' double->string conversion specifier,
-  //                               see QtxDoubleSpinBox::mapValueToText( double v )
-  setDecimals(32);
+  // Obtain precision from preferences
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  int precision = resMgr->integerValue( "SMESH", quantity, -3 );
+  
+  setPrecision(precision); // PAL8769. Minus is for using 'g' double->string conversion specifier,
+  //                          see QtxDoubleSpinBox::mapValueToText( double v )
+  //                          san: this can be achieved using preferences
+  setDecimals(qAbs(precision));
   setRange(min, max);
   setSingleStep( step );
   setDefaultValue( min );
+  
+  // Add a hint for the user saying how to tune precision
+  QString userPropName = QObject::tr( QString( "SMESH_PREF_%1" ).arg( quantity ).toLatin1().constData() );
+  setProperty( "validity_tune_hint", 
+               QVariant( QObject::tr( "SMESH_PRECISION_HINT" ).arg( userPropName ) ) );  
 }
index aa757ee632c5bd0313cbb8538c1bd9b32b890745..3b92c409f63f79e1471cb578e5b2130f03864cc7 100644 (file)
@@ -54,12 +54,11 @@ public:
   void       RangeStepAndValidator( double         = -1000000.0,
                                     double         = +1000000.0,
                                     double         = 100.0,
-                                    unsigned short = 3 );
+                                    const char*    = "length_precision" );
   void              SetValue( double );
   double            GetValue() const;
   QString           GetString() const;
   QLineEdit*        editor() const;
-  QDoubleValidator* validator() const;
 
 public slots:
   void              SetStep( double );
index 5da44a6ae52bda7c6aa7df29ebe04302d4e5f454..cf863ff4a3836ae0ab0155040f685858ab2fbced 100644 (file)
@@ -261,12 +261,12 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule )
   SMESHGUI_SymmetryDlgLayout->addWidget(GroupButtons);
 
   /* Initialisations */
-  SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
-  SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
+  SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
 
   RadioButton1->setChecked(true);
 
index 97d5ca5822b6108b98d2499b17880c2269a636cb..354176e92cc3da95950a7a9818456ae2c7219343 100644 (file)
@@ -266,12 +266,12 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule )
   SMESHGUI_TranslationDlgLayout->addWidget(GroupButtons);
 
   /* Initialisations */
-  SpinBox1_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
-  SpinBox1_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
-  SpinBox1_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
-  SpinBox2_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
-  SpinBox2_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
-  SpinBox2_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
+  SpinBox1_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox1_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox1_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox2_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox2_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+  SpinBox2_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
 
   RadioButton1->setChecked(true);
 
index ad1ab608b4f46a6a1a6dce531abb151dc9282cf6..db205dc00a6c737bea9ff81d3b4dcac9f25d5f76 100644 (file)
@@ -3162,6 +3162,40 @@ Consider saving your work before application crash</translation>
             <source>NO_MESH_SELECTED</source>
             <translation>No mesh selected</translation>
         </message>
+        <message>
+            <source>SMESH_PREF_def_precision</source>
+            <translation>Default precision</translation>
+        </message>
+        <message>
+            <source>SMESH_PREF_length_precision</source>
+            <translation>Length precision</translation>
+        </message>
+        <message>
+            <source>SMESH_PREF_angle_precision</source>
+            <translation>Angular precision</translation>
+        </message>
+        <message>
+            <source>SMESH_PREF_len_tol_precision</source>
+            <translation>Length tolerance precision</translation>
+        </message>
+        <message>
+            <source>SMESH_PREF_parametric_precision</source>
+            <translation>Parametric precision</translation>
+        </message>
+        <message>
+            <source>SMESH_PREF_area_precision</source>
+            <translation>Area precision</translation>
+        </message>
+        <message>
+            <source>SMESH_PREF_vol_precision</source>
+            <translation>Volume precision</translation>
+        </message>
+        <message>
+            <source>SMESH_PRECISION_HINT</source>
+            <translation>
+Input value precision can be adjusted using
+'%1' parameter in Mesh module preferences.</translation>
+        </message>
     </context>
     <context>
         <name>SMESHGUI</name>
@@ -3242,6 +3276,10 @@ Please, create VTK viewer and try again</translation>
             <source>PREF_NOTIFY_MODE</source>
             <translation>Show a computation result notification</translation>
         </message>
+        <message>
+            <source>SMESH_PREF_GROUP_PRECISION</source>
+            <translation>Input fields precision</translation>
+        </message>
         <message>
             <source>PREF_GROUP_ELEMENTS</source>
             <translation>Elements</translation>
@@ -5081,4 +5119,63 @@ It is impossible to read point coordinates from file</translation>
             <translation>No concurent submeshes detected</translation>
         </message>
     </context>
+    <context>
+        <name>SMESHGUI_ClippingDlg</name>
+       <message>
+            <source>CLIP_PLANES</source>
+            <translation>Clipping planes</translation>
+        </message>
+        <message>
+            <source>ROTATION_AROUND_X_Y2Z</source>
+            <translation>Rotation around X (Y to Z):</translation>
+        </message>
+        <message>
+            <source>ROTATION_AROUND_Y_X2Z</source>
+            <translation>Rotation around Y (X to Z):</translation>
+        </message>
+        <message>
+            <source>ROTATION_AROUND_Z_Y2X</source>
+            <translation>Rotation around Z (Y to X):</translation>
+        </message>
+        <message>
+            <source>ROTATION_AROUND_X_Z2Y</source>
+            <translation>Rotation around X (Z to Y):</translation>
+        </message>
+        <message>
+            <source>ROTATION_AROUND_Y_Z2X</source>
+            <translation>Rotation around Y (Z to X):</translation>
+        </message>
+        <message>
+            <source>ROTATION_AROUND_Z_X2Y</source>
+            <translation>Rotation around Z (X to Y):</translation>
+        </message>
+        <message>
+            <source>SHOW_PREVIEW</source>
+            <translation>Show preview</translation>
+        </message>
+        <message>
+            <source>AUTO_APPLY</source>
+            <translation>Auto Apply</translation>
+        </message>
+        <message>
+            <source>ALONG_XY</source>
+            <translation>|| X-Y</translation>
+        </message>
+        <message>
+            <source>ALONG_YZ</source>
+            <translation>|| Y-Z</translation>
+        </message>
+        <message>
+            <source>ALONG_ZX</source>
+            <translation>|| Z-X</translation>
+        </message>
+        <message>
+            <source>PLANE_NUM</source>
+            <translation>Plane# %1</translation>
+        </message>
+        <message>
+            <source>NO_PLANES</source>
+            <translation>No planes</translation>
+        </message>
+    </context>
 </TS>
index 18659e787a2b854a0d5c8ae4c07688cbbd97307e..f0d68a99e6975578edde86a1a355dc43104f7f9e 100644 (file)
 //
 #include "StdMeshersGUI_DistrTable.h"
 
+#include <SMESHGUI_SpinBox.h>
+
 // Qt incldues
 #include <QItemDelegate>
 #include <QTableWidget>
-#include <QDoubleSpinBox>
 #include <QPushButton>
 #include <QVBoxLayout>
 #include <QHBoxLayout>
@@ -109,7 +110,7 @@ private:
   struct EditorData
   { 
     int r, c;
-    QDoubleSpinBox* sb;
+    SMESHGUI_SpinBox* sb;
     EditorData() { reset(); }
     void reset() { r = -1; c = -1; sb = 0; }
   };
@@ -138,7 +139,7 @@ public:
   void          addRow();
   void          deleteRow();
 
-  void          setEditor( int, int, QDoubleSpinBox* );
+  void          setEditor( int, int, SMESHGUI_SpinBox* );
 
 protected:
   void          closeEditor( QWidget*, QAbstractItemDelegate::EndEditHint );
@@ -176,18 +177,22 @@ createEditor( QWidget* parent,
               const QStyleOptionViewItem& /*option*/,
               const QModelIndex& index ) const
 {
-  QDoubleSpinBox* sb = new QDoubleSpinBox( parent );
-  sb->setFrame(false);
-  sb->setMinimum( index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ? 
+  SMESHGUI_SpinBox* sb = new SMESHGUI_SpinBox( parent );
+  
+  sb->setAcceptNames(false); // No Notebook variables allowed
+  double aMin = index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ? 
                   myTable->argMinimum( index.row() ) : 
-                  myTable->funcMinimum( index.row() ) );
-  sb->setMaximum( index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ? 
+                  myTable->funcMinimum( index.row() );
+  double aMax = index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ? 
                   myTable->argMaximum( index.row() ) : 
-                  myTable->funcMaximum( index.row() ) );
-  sb->setSingleStep( index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ? 
+                  myTable->funcMaximum( index.row() );
+  double aStep = index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ? 
                      myTable->argStep( index.row() ) : 
-                     myTable->funcStep( index.row() ) );
-  myTable->setEditor( index.row(), index.column(), sb );
+                     myTable->funcStep( index.row() );
+  sb->RangeStepAndValidator( aMin, aMax, aStep, "parametric_precision" );
+  sb->setFrame(false);
+
+  myTable->setEditor( index.row(), index.column(), sb );  
   return sb;
 }
 
@@ -196,7 +201,7 @@ StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
 setEditorData( QWidget* editor, const QModelIndex& index ) const
 {
   QString value = index.model()->data(index, Qt::DisplayRole).toString();
-  QDoubleSpinBox* sb = static_cast<QDoubleSpinBox*>(editor);
+  SMESHGUI_SpinBox* sb = static_cast<SMESHGUI_SpinBox*>(editor);
 
   bool bOk = false;
   double v = value.toDouble( &bOk );
@@ -210,7 +215,7 @@ StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
 setModelData( QWidget* editor, QAbstractItemModel* model, 
               const QModelIndex& index ) const
 {
-  QDoubleSpinBox* sb = static_cast<QDoubleSpinBox*>(editor);
+  SMESHGUI_SpinBox* sb = static_cast<SMESHGUI_SpinBox*>(editor);
   model->setData( index, QString::number( sb->value() ), Qt::DisplayRole );
 }
 
@@ -247,7 +252,7 @@ Table( QWidget* parent, int rows )
 
 void
 StdMeshersGUI_DistrTableFrame::Table::
-setEditor( int r, int c, QDoubleSpinBox* sb )
+setEditor( int r, int c, SMESHGUI_SpinBox* sb )
 {
   myEditorData.r  = r;
   myEditorData.c  = c;
index 2ff99486f70888df019b99f832b7c4ad5a3d5561..496b812825e7a7d238a9fe0cbf10ab145a08bc9c 100644 (file)
@@ -25,8 +25,9 @@
 //
 #include "StdMeshersGUI_FixedPointsParamWdg.h"
 
-#include <QtxIntSpinBox.h>
-#include <QtxDoubleSpinBox.h>
+#include <SMESHGUI_SpinBox.h>
+
+#include <SalomeApp_IntSpinBox.h>
 
 // Qt includes
 #include <QPushButton>
@@ -81,7 +82,8 @@ QWidget* StdMeshersGUI_FixedPointsParamWdg::LineDelegate::createEditor( QWidget*
 {
   QWidget* w = 0;
   if ( (index.column() == 1 ) ) {
-    QtxIntSpinBox* sb = new QtxIntSpinBox( parent );
+    SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( parent );
+    sb->setAcceptNames( false ); // No Notebook variables allowed
     sb->setFrame( false );
     sb->setRange( 1, 999);
     w = sb;
@@ -94,8 +96,8 @@ void StdMeshersGUI_FixedPointsParamWdg::LineDelegate::setModelData( QWidget* edi
                                                                     QAbstractItemModel* model, 
                                                                     const QModelIndex& index ) const
 {
-  model->setData( index, qobject_cast<QtxIntSpinBox*>( editor )->value(), Qt::EditRole );
-  model->setData( index, qobject_cast<QtxIntSpinBox*>( editor )->value(), Qt::UserRole );
+  model->setData( index, qobject_cast<SalomeApp_IntSpinBox*>( editor )->value(), Qt::EditRole );
+  model->setData( index, qobject_cast<SalomeApp_IntSpinBox*>( editor )->value(), Qt::UserRole );
 }
 
 //================================================================================
@@ -114,7 +116,7 @@ StdMeshersGUI_FixedPointsParamWdg
   
   myListWidget   = new QListWidget( this );
   myTreeWidget   = new QTreeWidget( this );
-  mySpinBox      = new QtxDoubleSpinBox( this );
+  mySpinBox      = new SMESHGUI_SpinBox( this );
   myAddButton    = new QPushButton( tr( "SMESH_BUT_ADD" ),    this );
   myRemoveButton = new QPushButton( tr( "SMESH_BUT_REMOVE" ), this );      
   mySameValues   = new QCheckBox( tr("SMESH_SAME_NB_SEGMENTS"), this);
@@ -141,10 +143,8 @@ StdMeshersGUI_FixedPointsParamWdg
   myListWidget->setMinimumWidth( 80 );
   myTreeWidget->setMinimumWidth( 200 );
 
-  mySpinBox->setRange( 0, 1 );
-  mySpinBox->setSingleStep( 0.1 );
-  mySpinBox->setDecimals( 4 );
-  mySpinBox->setPrecision( 4 );
+  mySpinBox->setAcceptNames( false ); // No Notebook variables allowed
+  mySpinBox->RangeStepAndValidator( 0., 1., .1, "parametric_precision" );
   myListWidget->setMinimumWidth( 70 );
 
   connect( myAddButton,    SIGNAL( clicked() ),              SLOT( onAdd() ) );
index 273781d34aa85661e7d816d8a290a32bc372fd3e..d7cf63337a8ab9c7db76a8cd3c3226ea1519733d 100644 (file)
@@ -34,7 +34,7 @@
 #include <QStringList>
 
 class SMESHGUI;
-class QtxDoubleSpinBox;
+class SMESHGUI_SpinBox;
 class QPushButton;
 class QLineEdit;
 class QCheckBox;
@@ -84,7 +84,7 @@ private:
 private:
   QListWidget*                   myListWidget;
   QTreeWidget*                   myTreeWidget;
-  QtxDoubleSpinBox*              mySpinBox;
+  SMESHGUI_SpinBox*              mySpinBox;
   QPushButton*                   myAddButton;
   QPushButton*                   myRemoveButton;
   QCheckBox*                     mySameValues;
index 2ee5473af34992aee5ac4cc34109832b0a7490d9..8f88698c04fdf68ce87bfe6924a82d5eb192f67c 100644 (file)
@@ -149,7 +149,7 @@ QFrame* StdMeshersGUI_NbSegmentsCreator::buildFrame()
   // 3)  scale
   myGroupLayout->addWidget( myLScale = new QLabel( tr( "SMESH_NB_SEGMENTS_SCALE_PARAM" ), GroupC1 ), row, 0 );
   myScale = new SMESHGUI_SpinBox( GroupC1 );
-  myScale->RangeStepAndValidator( 1E-5, 1E+5, 0.1, 6 );
+  myScale->RangeStepAndValidator( 1E-5, 1E+5, 0.1, "parametric_precision" );
   myGroupLayout->addWidget( myScale, row, 1 );
   row++;
 
index fd9413046511bbd3fbea65a69a86affd72950a67..0ba7955c7ef04a23fa446d36c249e6e5e8e3f7bd 100644 (file)
@@ -1028,38 +1028,38 @@ void StdMeshersGUI_StdHypothesisCreator::attuneStdWidget (QWidget* w, const int)
   if( hypType()=="LocalLength" &&  sb )
   {
     if (sb->objectName() == tr("SMESH_LOCAL_LENGTH_PARAM"))
-      sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 );
+      sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
     else if (sb->objectName() == tr("SMESH_LOCAL_LENGTH_PRECISION"))
-      sb->RangeStepAndValidator( 0.0, 1.0, 0.05, 7 );
+      sb->RangeStepAndValidator( 0.0, 1.0, 0.05, "len_tol_precision" );
   }
   else if( hypType()=="Arithmetic1D" && sb )
   {
-    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 );
+    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "parametric_precision" );
   }
   else if( hypType()=="MaxLength" && sb )
   {
-    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 );
+    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
     sb->setEnabled( !widget< QCheckBox >( 1 )->isChecked() );
   }
   else if( hypType()=="MaxElementArea" && sb )
   {
-    sb->RangeStepAndValidator( VALUE_SMALL_2, VALUE_MAX_2, 1.0, 6 );
+    sb->RangeStepAndValidator( VALUE_SMALL_2, VALUE_MAX_2, 1.0, "area_precision" );
   }
   else if( hypType()=="MaxElementVolume" && sb )
   {
-    sb->RangeStepAndValidator( VALUE_SMALL_3, VALUE_MAX_3, 1.0, 6 );
+    sb->RangeStepAndValidator( VALUE_SMALL_3, VALUE_MAX_3, 1.0, "vol_precision" );
   }
   else if( hypType()=="StartEndLength" && sb )
   {
-    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 );
+    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
   }
   else if( hypType()=="Deflection1D" && sb )
   {
-    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 );
+    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "parametric_precision" );
   }
   else if ( sb ) // default validator for possible ancestors
   {
-    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 );
+    sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, "length_precision" );
   }
 }