X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMToolsGUI%2FGEOMToolsGUI_DeflectionDlg.cxx;h=bc9e9ea6329446958692ce19a2928f215a33adef;hb=882dc8f6ee23cedf50cf3c718fb864dec115b35e;hp=715c22dee0c042eb5ab2713268f3ba82cabf905c;hpb=b7e3214ee58788f68c17e2552d3c4be3aff322bd;p=modules%2Fgeom.git diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx index 715c22dee..bc9e9ea63 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx @@ -1,32 +1,31 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // GEOM GEOMGUI : GUI for Geometry component // File : GEOMToolsGUI_DeflectionDlg.cxx // Author : OCC Team - +// #include "GEOMToolsGUI_DeflectionDlg.h" #include +#include #include -#include +#include #include #include @@ -71,14 +70,21 @@ GEOMToolsGUI_DeflectionDlg::GEOMToolsGUI_DeflectionDlg (QWidget* parent) TextLabel1->setText(tr("GEOM_DEFLECTION")); GroupC1Layout->addWidget(TextLabel1, 0, 0); - SpinBox = new QtxDoubleSpinBox (GroupC1); - SpinBox->setPrecision( 6 ); - SpinBox->setDecimals( 6 ); + SpinBox = new SalomeApp_DoubleSpinBox (GroupC1); + // Obtain precision from preferences + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + const char* quantity = "parametric_precision"; + int aPrecision = resMgr->integerValue( "Geometry", quantity, 6 ); + SpinBox->setAcceptNames( false ); + SpinBox->setPrecision( aPrecision ); + SpinBox->setDecimals( aPrecision ); SpinBox->setRange( DEFLECTION_MIN, 1.0 ); SpinBox->setSingleStep( 1.0e-04 ); - //SpinBox->setMinimum(1.0e-07); - //SpinBox->setMaximum(1.0); - //SpinBox->setStep(1.0e-04); + // Add a hint for the user saying how to tune precision + QString userPropName = QObject::tr( QString( "GEOM_PREF_%1" ).arg( quantity ).toLatin1().constData() ); + SpinBox->setProperty( "validity_tune_hint", + QVariant( QObject::tr( "GEOM_PRECISION_HINT" ).arg( userPropName ) ) ); + SpinBox->setObjectName("SpinBoxU"); SpinBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); SpinBox->setValue(1.0e-04); @@ -137,12 +143,12 @@ GEOMToolsGUI_DeflectionDlg::~GEOMToolsGUI_DeflectionDlg() // no need to delete child widgets, Qt does it all for us } -double GEOMToolsGUI_DeflectionDlg::getDC() const +double GEOMToolsGUI_DeflectionDlg::getTheDC() const { return SpinBox->text().toDouble(); } -void GEOMToolsGUI_DeflectionDlg::setDC (const double v) +void GEOMToolsGUI_DeflectionDlg::setTheDC (const double v) { SpinBox->setValue(v); }