Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYDalleWidget.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 
21 #include <QCheckBox>
22 // Added by qt3to4:
23 #include <QGridLayout>
24 #include <QLabel>
25 
29 #include "TYDalleWidget.h"
30 
31 #define TR(id) OLocalizator::getString("TYDalleWidget", (id))
32 
33 TYDalleWidget::TYDalleWidget(TYDalle* pElement, QWidget* _pParent /*=NULL*/) : TYWidget(pElement, _pParent)
34 {
35 
36  _accPolygonW = new TYAcousticPolygonWidget(pElement, this);
38  // _accPolygonW->setLayoutSpacing(0, 0);
39 
40  resize(300, 680);
41  setWindowTitle(TR("id_caption"));
42  _dalleLayout = new QGridLayout();
43  setLayout(_dalleLayout);
44 
45  _dalleLayout->addWidget(_accPolygonW, 1, 0);
46 
47  _groupBoxParoi = new QGroupBox(this);
48  _groupBoxParoi->setTitle(TR("id_paroi"));
49  _groupBoxParoiLayout = new QGridLayout();
51 
52  _lineEditNomParoi = new QLineEdit(_groupBoxParoi);
53  _lineEditNomParoi->setEnabled(false);
54  _groupBoxParoiLayout->addWidget(_lineEditNomParoi, 0, 0);
55 
56  _pushButtonParoi = new QPushButton(_groupBoxParoi);
57  _pushButtonParoi->setText(TR("id_proprietes_button"));
58  _groupBoxParoiLayout->addWidget(_pushButtonParoi, 0, 1);
59 
60  _labeUseEtage = new QLabel(_groupBoxParoi);
61  _labeUseEtage->setText(TR("id_useEtage_label"));
62  _checkBoxUseEtage = new QCheckBox(_groupBoxParoi);
63  _checkBoxUseEtage->setText(TR(""));
64  _groupBoxParoiLayout->addWidget(_labeUseEtage, 1, 0);
65  _groupBoxParoiLayout->addWidget(_checkBoxUseEtage, 1, 1);
66 
67  _dalleLayout->addWidget(_groupBoxParoi, 3, 0);
68 
69  connect(_pushButtonParoi, &QPushButton::clicked, this, &TYDalleWidget::editParoi);
70  connect(_checkBoxUseEtage, &QPushButton::clicked, this, &TYDalleWidget::updateUseParoi);
71 
72  updateContent();
73 }
74 
76 
78 {
80 
81  _lineEditNomParoi->setText(getElement()->getParoi()->getName());
82  _checkBoxUseEtage->setChecked(!(getElement()->isParoiLocked()));
83 
85 }
86 
88 {
90  getElement()->setParoiLocked(!(_checkBoxUseEtage->isChecked()));
91 
92  emit modified();
93 }
94 
96 {
97  int ret = getElement()->getParoi()->edit(this);
98 
99  if (ret == QDialog::Accepted)
100  {
101  _lineEditNomParoi->setText(getElement()->getParoi()->getName());
102  }
103 }
104 
106 {
107  _pushButtonParoi->setEnabled(!(_checkBoxUseEtage->isChecked()));
108 }
objet IHM pour un polygone acoustique (fichier header)
#define TR(id)
Outil IHM pour une dalle (fichier header)
classe de l'objet IHM pour un polygone acoustique
QCheckBox * _checkBoxUseEtage
Definition: TYDalleWidget.h:87
QLabel * _labeUseEtage
Definition: TYDalleWidget.h:86
QGridLayout * _dalleLayout
Definition: TYDalleWidget.h:83
virtual void apply()
virtual ~TYDalleWidget()
TYDalleWidget(TYDalle *pElement, QWidget *_pParent=NULL)
QGridLayout * _groupBoxParoiLayout
Definition: TYDalleWidget.h:84
TYAcousticPolygonWidget * _accPolygonW
Definition: TYDalleWidget.h:89
QPushButton * _pushButtonParoi
Definition: TYDalleWidget.h:81
QGroupBox * _groupBoxParoi
Definition: TYDalleWidget.h:79
QLineEdit * _lineEditNomParoi
Definition: TYDalleWidget.h:80
virtual void updateContent()
classe de l'objet IHM pour un objet metier de type TYElement
Definition: TYWidget.h:43
void modified()