Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYMurWidget.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
21 #include <QPushButton>
22 #include <QCheckBox>
23 // Added by qt3to4:
24 #include <QGridLayout>
25 #include <QLabel>
26 #include <QtWidgets>
27 
31 #include "TYMurWidget.h"
32 
33 #define TR(id) OLocalizator::getString("TYMurWidget", (id))
34 
35 TYMurWidget::TYMurWidget(TYMur* pElement, QWidget* _pParent /*=NULL*/) : TYWidget(pElement, _pParent)
36 {
37 
38  resize(300, 700);
39  setWindowTitle(TR("id_caption"));
40  _murLayout = new QGridLayout();
41  setLayout(_murLayout);
42 
43  _elmW = new TYAcousticRectangleNodeWidget(pElement, this);
44  _elmW->setLayoutSpacing(0, 0);
45  _murLayout->addWidget(_elmW, 0, 0);
46 
47  QGroupBox* pGroupBoxParoi = new QGroupBox(this);
48  pGroupBoxParoi->setTitle(TR("id_paroi"));
49  QGridLayout* pGroupBoxParoiLayout = new QGridLayout();
50  pGroupBoxParoi->setLayout(pGroupBoxParoiLayout);
51 
52  _lineEditNomParoi = new QLineEdit(pGroupBoxParoi);
53  _lineEditNomParoi->setEnabled(false);
54  pGroupBoxParoiLayout->addWidget(_lineEditNomParoi, 0, 0);
55 
56  _pPushButtonParoi = new QPushButton(pGroupBoxParoi);
57  _pPushButtonParoi->setText(TR("id_proprietes_button"));
58  pGroupBoxParoiLayout->addWidget(_pPushButtonParoi, 0, 1);
59 
60  _labeUseEtage = new QLabel(pGroupBoxParoi);
61  _labeUseEtage->setText(TR("id_useEtage_label"));
62  _checkBoxUseEtage = new QCheckBox(pGroupBoxParoi);
63  _checkBoxUseEtage->setText(TR(""));
64  pGroupBoxParoiLayout->addWidget(_labeUseEtage, 1, 0);
65  pGroupBoxParoiLayout->addWidget(_checkBoxUseEtage, 1, 1);
66 
67  _murLayout->addWidget(pGroupBoxParoi, 1, 0);
68 
69  updateContent();
70 
71  connect(_pPushButtonParoi, &QPushButton::clicked, this, &TYMurWidget::editParoi);
72  connect(_checkBoxUseEtage, &QPushButton::clicked, this, &TYMurWidget::updateUseParoi);
73 }
74 
76 
78 {
80 
81  _lineEditNomParoi->setText(getElement()->getParoi()->getName());
82  _checkBoxUseEtage->setChecked(!(getElement()->isParoiLocked()));
84 }
85 
87 {
88  _elmW->apply();
89  getElement()->setParoiLocked(!(_checkBoxUseEtage->isChecked()));
90 
91  emit modified();
92 }
93 
95 {
96  int ret = getElement()->getParoi()->edit(this);
97 
98  if (ret == QDialog::Accepted)
99  {
100  _lineEditNomParoi->setText(getElement()->getParoi()->getName());
101  }
102 }
103 
105 {
106  _pPushButtonParoi->setEnabled(!(_checkBoxUseEtage->isChecked()));
107 }
outil IHM pour un ensemble de rectangles acoustiques (fichier header)
#define TR(id)
Definition: TYMurWidget.cpp:33
outil IHM pour un mur (fichier header)
Classe de l'objet IHM pour un ensemble de rectangles acoustiques.
void setLayoutSpacing(int margin, int spacing)
TYAcousticRectangleNodeWidget * _elmW
Definition: TYMurWidget.h:86
QLineEdit * _lineEditNomParoi
Definition: TYMurWidget.h:81
QGridLayout * _murLayout
Definition: TYMurWidget.h:80
QCheckBox * _checkBoxUseEtage
Definition: TYMurWidget.h:84
QLabel * _labeUseEtage
Definition: TYMurWidget.h:83
TYMurWidget(TYMur *pElement, QWidget *_pParent=NULL)
Definition: TYMurWidget.cpp:35
virtual ~TYMurWidget()
Definition: TYMurWidget.cpp:75
QPushButton * _pPushButtonParoi
Definition: TYMurWidget.h:78
void updateUseParoi()
virtual void updateContent()
Definition: TYMurWidget.cpp:77
void editParoi()
Definition: TYMurWidget.cpp:94
virtual void apply()
Definition: TYMurWidget.cpp:86
Definition: TYMur.h:36
classe de l'objet IHM pour un objet metier de type TYElement
Definition: TYWidget.h:43
void modified()