Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYFaceSetWidget.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 
27 // Added by qt3to4:
28 #include <QGridLayout>
29 #include <QLabel>
30 
31 #include "TYFaceSetWidget.h"
32 
33 #define TR(id) OLocalizator::getString("TYFaceSetWidget", (id))
34 
35 TYFaceSetWidget::TYFaceSetWidget(TYFaceSet* pElement, QWidget* _pParent /*=NULL*/)
36  : TYWidget(pElement, _pParent)
37 {
38 
39  resize(300, 540);
40  setWindowTitle(TR("id_caption"));
41  QGridLayout* _faceSetLayout = new QGridLayout();
42  setLayout(_faceSetLayout);
43 
44  _groupBoxVolume = new QGroupBox(this);
45  _groupBoxVolume->setTitle(TR("id_volume_label"));
46  _groupBoxVolumeLayout = new QGridLayout();
48 
49  _groupBoxSurface = new QGroupBox(this);
50  _groupBoxSurface->setTitle(TR("id_surface_label"));
51  _groupBoxSurfaceLayout = new QGridLayout();
53 
54  // Presentation du volume
56  _lineEditVolume->setEnabled(false);
57  _groupBoxVolumeLayout->addWidget(_lineEditVolume, 0, 0);
58 
59  QLabel* pUnitVolume = new QLabel(_groupBoxVolume);
60  pUnitVolume->setText(TR("id_unite_volume"));
61  _groupBoxVolumeLayout->addWidget(pUnitVolume, 0, 1);
62 
63  // Presentation de la surface
65  _lineEditSurface->setEnabled(false);
66  _groupBoxSurfaceLayout->addWidget(_lineEditSurface, 0, 0);
67 
68  QLabel* pUnitSurface = new QLabel(_groupBoxSurface);
69  pUnitSurface->setText(TR("id_unite_surface"));
70  _groupBoxSurfaceLayout->addWidget(pUnitSurface, 0, 1);
71 
72  // Insertion dans la boite de dialogue
73  _faceSetLayout->addWidget(_groupBoxVolume, 0, 0);
74  _faceSetLayout->addWidget(_groupBoxSurface, 0, 1);
75 
76  updateContent();
77 }
78 
80 
82 {
83  _lineEditVolume->setText(QString().setNum(getElement()->volume()));
84  _lineEditSurface->setText(QString().setNum(getElement()->surface()));
85 }
86 
88 {
90  emit modified();
91 }
#define TR(id)
Outil IHM pour un ensemble de faces (fichier header)
outil IHM pour une entrée utilisateur (fichier header)
static void setIsSavedOk(const bool &toSave)
Definition: TYElement.h:915
TYLineEdit * _lineEditVolume
virtual void apply()
virtual void updateContent()
QGridLayout * _faceSetLayout
TYFaceSetWidget(TYFaceSet *pElement, QWidget *_pParent=NULL)
QGridLayout * _groupBoxSurfaceLayout
TYLineEdit * _lineEditSurface
QGroupBox * _groupBoxSurface
QGroupBox * _groupBoxVolume
virtual ~TYFaceSetWidget()
QGridLayout * _groupBoxVolumeLayout
classe de l'objet IHM pour un objet metier de type TYElement
Definition: TYWidget.h:43
void modified()