From 71fb4900e6fb34f8ba84bc0b6d36cac77206b0bf Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 13 Aug 2007 07:36:18 +0000 Subject: [PATCH] NPAL16690: EDF532: 'Add Node' and 'Move Node' coordinates are limited to 3 digits. --- src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx | 12 +++++++----- src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx | 12 +++++++----- src/SMESHGUI/SMESHGUI_NodesDlg.cxx | 14 +++++++++----- src/SMESHGUI/SMESHGUI_SpinBox.h | 1 + src/SMESHGUI/SMESHGUI_TranslationDlg.cxx | 12 ++++++------ 5 files changed, 30 insertions(+), 21 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx index b21ad3260..22cbb7293 100644 --- a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx @@ -138,16 +138,18 @@ QFrame* SMESHGUI_MakeNodeAtPointDlg::createMainFrame (QWidget* theParent) myX = new SMESHGUI_SpinBox(aCoordGrp); QLabel* aYLabel = new QLabel(tr("SMESH_Y"), aCoordGrp); - aYLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs ); + //aYLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs ); + aYLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); myY = new SMESHGUI_SpinBox(aCoordGrp); QLabel* aZLabel = new QLabel(tr("SMESH_Z"), aCoordGrp); - aZLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs ); + //aZLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs ); + aZLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); myZ = new SMESHGUI_SpinBox(aCoordGrp); - myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); + 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); // Method selection diff --git a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx index deb0d6c56..1606f47ff 100644 --- a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx @@ -184,16 +184,18 @@ QFrame* SMESHGUI_MoveNodesDlg::createMainFrame (QWidget* theParent) myX = new SMESHGUI_SpinBox(aCoordGrp); QLabel* aYLabel = new QLabel(tr("SMESH_Y"), aCoordGrp); - aYLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs ); + //aYLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs ); + aYLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); myY = new SMESHGUI_SpinBox(aCoordGrp); QLabel* aZLabel = new QLabel(tr("SMESH_Z"), aCoordGrp); - aZLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs ); + //aZLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs ); + aZLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); myZ = new SMESHGUI_SpinBox(aCoordGrp); - myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, 3); - myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, 3); - myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, 3); + 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); QVBoxLayout* aLay = new QVBoxLayout(aFrame); aLay->addWidget(aPixGrp); diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx index f8a2c82ed..31b427e79 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx @@ -310,17 +310,21 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg (SMESHGUI* theModule, GroupCoordinatesLayout->setAlignment(Qt::AlignTop); GroupCoordinatesLayout->setSpacing(6); GroupCoordinatesLayout->setMargin(11); + TextLabel_X = new QLabel(GroupCoordinates, "TextLabel_X"); TextLabel_X->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); TextLabel_X->setText(tr("SMESH_X" )); GroupCoordinatesLayout->addWidget(TextLabel_X, 0, 0); + TextLabel_Y = new QLabel(GroupCoordinates, "TextLabel_Y"); - TextLabel_Y->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs ); + //TextLabel_Y->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs ); + TextLabel_Y->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); TextLabel_Y->setText(tr("SMESH_Y" )); GroupCoordinatesLayout->addWidget(TextLabel_Y, 0, 2); TextLabel_Z = new QLabel(GroupCoordinates, "TextLabel_Z"); - TextLabel_Z->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs ); + //TextLabel_Z->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs ); + TextLabel_Z->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); TextLabel_Z->setText(tr("SMESH_Z" )); GroupCoordinatesLayout->addWidget(TextLabel_Z, 0, 4); @@ -363,9 +367,9 @@ void SMESHGUI_NodesDlg::Init () step = 25.0; /* min, max, step and decimals for spin boxes */ - SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); - SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); - SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + 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->SetValue(0.0); SpinBox_Y->SetValue(0.0); SpinBox_Z->SetValue(0.0); diff --git a/src/SMESHGUI/SMESHGUI_SpinBox.h b/src/SMESHGUI/SMESHGUI_SpinBox.h index 576db9221..9bb8c51c5 100644 --- a/src/SMESHGUI/SMESHGUI_SpinBox.h +++ b/src/SMESHGUI/SMESHGUI_SpinBox.h @@ -34,6 +34,7 @@ // like in GEOM_SRC/src/DlgRef/DlgRef_SpinBox.h #define COORD_MIN -1e+15 #define COORD_MAX +1e+15 +#define DBL_DIGITS_DISPLAY 14 //================================================================================= // class : SMESHGUI_SpinBox diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index f5e3819bc..9711cdc47 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -264,12 +264,12 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha SMESHGUI_TranslationDlgLayout->addWidget(GroupArguments, 1, 0); /* Initialisations */ - SpinBox1_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - SpinBox1_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - SpinBox1_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - SpinBox2_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - SpinBox2_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); - SpinBox2_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); + 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); GroupArguments->show(); RadioButton1->setChecked(TRUE); -- 2.39.2