Salome HOME
Issue #1735: Names in deflection dialog box.
[modules/shaper.git] / src / XGUI / XGUI_DeflectionDialog.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        XGUI_DeflectionDialog.cpp
4 // Created:     27 Jul 2016
5 // Author:      Natalia ERMOLAEVA
6
7 #include <XGUI_DeflectionDialog.h>
8
9 #include <ModelAPI_Tools.h>
10
11 #include <ModuleBase_DoubleSpinBox.h>
12
13 #include <QLabel>
14 #include <QButtonGroup>
15 #include <QGridLayout>
16 #include <QRadioButton>
17 #include <QDialogButtonBox>
18
19 XGUI_DeflectionDialog::XGUI_DeflectionDialog(QWidget* theParent)
20   : QDialog(theParent)
21 {
22   setWindowTitle(tr("Deflection"));
23   QGridLayout* aLay = new QGridLayout(this);
24
25   myDeflection = new ModuleBase_DoubleSpinBox(this);
26   myDeflection->setDecimals(12);
27   myDeflection->setRange(0, 1);
28   myDeflection->setSingleStep(0.001);
29   aLay->addWidget(new QLabel(tr("Deflection value"), this), 0, 0);
30   aLay->addWidget(myDeflection, 0, 1);
31
32   QDialogButtonBox* aButtons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
33                                                     Qt::Horizontal, this);
34   connect(aButtons, SIGNAL(accepted()), this, SLOT(accept()));
35   connect(aButtons, SIGNAL(rejected()), this, SLOT(reject()));
36   aLay->addWidget(aButtons, 1, 0, 1, 2);
37 }
38
39 void XGUI_DeflectionDialog::setDeflection(const double& theValue)
40 {
41   myDeflection->setValue(theValue);
42 }
43
44 double XGUI_DeflectionDialog::getDeflection() const
45 {
46   return myDeflection->value();
47 }