From f2510f600051196300ff0bbb6aa89f1479877f0f Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 2 Sep 2008 07:24:28 +0000 Subject: [PATCH] Fix pb with minimum and maximum values of the spin box --- src/VISUGUI/VisuGUI_CutPlanesDlg.cxx | 11 ++++------- src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx | 7 ++----- src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx | 7 ++----- src/VISUGUI/VisuGUI_VectorsDlg.cxx | 5 +---- 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx index d16325ac..879691f5 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx @@ -183,19 +183,16 @@ VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent) myVectorialFieldCombo = new QComboBox (GDeformation); GDeformationLayout->addWidget( myVectorialFieldCombo, 0, 1 ); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); + QLabel* LabelDeformation2 = new QLabel (tr("LBL_DEFROMATION_SCALE"), GDeformation); GDeformationLayout->addWidget( LabelDeformation2, 1, 0 ); - myScaleSpn = new QtxDoubleSpinBox (0.0, 1.0E+38, 0.1, GDeformation); + myScaleSpn = new QtxDoubleSpinBox (0.0, 1.0E+38, 0.1, aPrecision*(-1), 38, GDeformation); myScaleSpn->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); GDeformationLayout->addWidget( myScaleSpn, 1, 1 ); connect(myVectorialFieldCombo, SIGNAL(activated(int)), this, SLOT(onVectorialFieldChanged(int))); connect(myScaleSpn, SIGNAL(valueChanged(double)), this, SLOT(onScaleFactorChanged(double))); - - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); - - myScaleSpn->setPrecision( aPrecision*(-1) ); - myScaleSpn->setDecimals(38); myScaleSpn->setValue(0.1); myPreviewCheck = new QCheckBox(tr("LBL_SHOW_PREVIEW"), this); diff --git a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx index e3d180b9..c48a8d03 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx @@ -97,14 +97,11 @@ VisuGUI_DeformedShapeAndScalarMapDlg::VisuGUI_DeformedShapeAndScalarMapDlg (Salo QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup); TopGroupLayout->addWidget(ScaleLabel, 0, 0); - ScalFact = new QtxDoubleSpinBox (0.0, 1.0E+38, 0.1, TopGroup); - ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); - ScalFact->setPrecision( aPrecision*(-1) ); - ScalFact->setDecimals( 32 ); + ScalFact = new QtxDoubleSpinBox (1.0E-20, 1.0E+38, 0.1, aPrecision*(-1), 32, TopGroup); + ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); ScalFact->setValue(0.1); TopGroupLayout->addWidget(ScalFact, 0, 1); diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx index 6f6aa2b4..73035a80 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx @@ -89,14 +89,11 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule) QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup ); TopGroupLayout->addWidget(ScaleLabel, 0, 0); - ScalFact = new QtxDoubleSpinBox (0.0, 1.0E+38, 0.1, TopGroup); - ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); - ScalFact->setPrecision( aPrecision*(-1) ); - ScalFact->setDecimals(38); + ScalFact = new QtxDoubleSpinBox (1.0E-20, 1.0E+38, 0.1, aPrecision*(-1), 38, TopGroup); + ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); ScalFact->setValue(0.1); TopGroupLayout->addWidget(ScalFact, 0, 1); diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.cxx b/src/VISUGUI/VisuGUI_VectorsDlg.cxx index 1f624abb..91e037a6 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.cxx +++ b/src/VISUGUI/VisuGUI_VectorsDlg.cxx @@ -90,13 +90,10 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule) // Scale factor ScaleLabel = new QLabel (tr("LBL_SCALE_FACTOR"), TopGroup ); - ScalFact = new QtxDoubleSpinBox( 1e-20, 1.0E+38, 0.1, TopGroup ); - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); - ScalFact->setPrecision( aPrecision*(-1) ); - ScalFact->setDecimals( 32 ); + ScalFact = new QtxDoubleSpinBox( 1e-20, 1.0E+38, 0.1, aPrecision*(-1), 32, TopGroup ); ScalFact->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); ScalFact->setValue( 0.1 ); -- 2.39.2