Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYSourceWidget.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 
25 #include <qmenu.h>
26 #include <qbuttongroup.h>
27 #include <QtWidgets>
28 
30 #include "TYSourceWidget.h"
31 #include "TYElementWidget.h"
32 
33 #define TR(id) OLocalizator::getString("TYSourceWidget", (id))
34 #define IMG(id) OLocalizator::getPicture("TYSourceWidget", (id))
35 
36 TYSourceWidget::TYSourceWidget(TYSource* pElement, QWidget* _pParent /*=NULL*/) : TYWidget(pElement, _pParent)
37 {
38  _elmW = new TYElementWidget(pElement, this);
39  // _colorW = new TYColorInterfaceWidget(pElement, this);
40 
41  // resize( 300, 220 );
42  setWindowTitle(TR("id_caption"));
43  _sourceLayout = new QGridLayout();
44 
45  _sourceLayout->addWidget(_elmW, 0, 0);
46  // _sourceLayout->addWidget( _colorW, 1, 0);
47 
48  _groupBox = new QGroupBox(this);
49  _groupBox->setTitle(TR("id_tabspectre_box"));
50  _groupBoxLayout = new QGridLayout();
51  _groupBox->setLayout(_groupBoxLayout);
52 
53  _pushButtonShowSpectre = new QPushButton(_groupBox);
54  _pushButtonShowSpectre->setText(TR("id_button_spectre"));
55 
56  _groupBoxLayout->addWidget(_pushButtonShowSpectre, 0, 0);
57 
58  _sourceLayout->addWidget(_groupBox, 2, 0);
59 
60  updateContent();
61 
62  connect(_pushButtonShowSpectre, &QPushButton::clicked, this, &TYSourceWidget::showSpectre);
63  _sourceLayout->setContentsMargins(0, 0, 0, 0);
64 
65  setLayout(_sourceLayout);
66 }
67 
69 
71 {
73  // _colorW->updateContent();
74 }
75 
77 {
78  _elmW->apply();
79  // _colorW->apply();
80 
81  emit modified();
82 }
83 
85 {
86  TYSpectre* spectre = getElement()->getCurrentSpectre();
87  spectre->edit(this);
88 }
outil IHM pour un element (fichier header)
#define TR(id)
outil IHM pour une source (fichier header)
classe de l'objet IHM pour un element
virtual void apply()
virtual void updateContent()
TYElementWidget * _elmW
QGroupBox * _groupBox
virtual void updateContent()
virtual void apply()
QPushButton * _pushButtonShowSpectre
TYSourceWidget(TYSource *pElement, QWidget *_pParent=NULL)
virtual ~TYSourceWidget()
QGridLayout * _sourceLayout
QGridLayout * _groupBoxLayout
classe de l'objet IHM pour un objet metier de type TYElement
Definition: TYWidget.h:43
void modified()