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