Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYPointWidget.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
26 // Added by qt3to4:
27 #include <QGridLayout>
28 #include <QLabel>
29 
30 #include "TYPointWidget.h"
31 
32 #define TR(id) OLocalizator::getString("TYPointWidget", (id))
33 
34 TYPointWidget::TYPointWidget(TYPoint* pElement, QWidget* _pParent /*=NULL*/) : TYWidget(pElement, _pParent)
35 {
36 
37  // _elmW = new TYElementWidget(pElement, this);
38  // _colorW = new TYColorInterfaceWidget(pElement, this);
39 
40  resize(300, 174);
41  setWindowTitle(TR("id_caption"));
42  _pointLayout = new QGridLayout();
43  setLayout(_pointLayout);
44 
45  // _pointLayout->addWidget( _elmW, 0, 0 );
46  // _pointLayout->addWidget( _colorW, 1, 0 );
47 
48  _groupBox = new QGroupBox(this);
49  _groupBox->setTitle(TR("id_position"));
50  _groupBoxLayout = new QGridLayout();
51  _groupBox->setLayout(_groupBoxLayout);
52 
53  _labelX = new QLabel(_groupBox);
54  _labelX->setText(TR("id_x_label"));
55  _groupBoxLayout->addWidget(_labelX, 0, 0);
56 
57  _labelZ = new QLabel(_groupBox);
58  _labelZ->setText(TR("id_z_label"));
59  _groupBoxLayout->addWidget(_labelZ, 2, 0);
60 
61  _labelY = new QLabel(_groupBox);
62  _labelY->setText(TR("id_y_label"));
63  _groupBoxLayout->addWidget(_labelY, 1, 0);
64 
66  _groupBoxLayout->addWidget(_lineEditX, 0, 1);
67 
69  _groupBoxLayout->addWidget(_lineEditY, 1, 1);
70 
72  _groupBoxLayout->addWidget(_lineEditZ, 2, 1);
73 
74  _pointLayout->addWidget(_groupBox, 2, 0);
75 
76  updateContent();
77 }
78 
80 
82 {
83  // _elmW->updateContent();
84  // _colorW->updateContent();
85 
86  _lineEditX->setText(QString().setNum(getElement()->_x, 'f', 3));
87  _lineEditY->setText(QString().setNum(getElement()->_y, 'f', 3));
88  _lineEditZ->setText(QString().setNum(getElement()->_z, 'f', 3));
89 }
90 
92 {
93  // _elmW->apply();
94  // _colorW->apply();
95 
96  getElement()->_x = _lineEditX->text().toDouble();
97  getElement()->_y = _lineEditY->text().toDouble();
98  getElement()->_z = _lineEditZ->text().toDouble();
99 
100  emit modified();
101 }
102 
104 {
105  _lineEditZ->setEnabled(false);
106 }
107 
109 {
110  _lineEditZ->setEnabled(false);
111 }
outil IHM pour une entrée utilisateur (fichier header)
#define TR(id)
outil IHM pour un point (fichier header)
TYLineEdit * _lineEditZ
Definition: TYPointWidget.h:92
QGroupBox * _groupBox
Definition: TYPointWidget.h:86
virtual void apply()
QGridLayout * _pointLayout
Definition: TYPointWidget.h:94
QLabel * _labelX
Definition: TYPointWidget.h:87
QLabel * _labelY
Definition: TYPointWidget.h:89
virtual ~TYPointWidget()
TYPointWidget(TYPoint *pElement, QWidget *_pParent=NULL)
QLabel * _labelZ
Definition: TYPointWidget.h:88
QGridLayout * _groupBoxLayout
Definition: TYPointWidget.h:95
virtual void updateContent()
TYLineEdit * _lineEditX
Definition: TYPointWidget.h:90
TYLineEdit * _lineEditY
Definition: TYPointWidget.h:91
classe de l'objet IHM pour un objet metier de type TYElement
Definition: TYWidget.h:43
void modified()