Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYFaceToolbar.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 <qtoolbutton.h>
22 #include <qbuttongroup.h>
23 
26 #include "TYFaceToolbar.h"
27 
28 #define TR(id) OLocalizator::getString("TYFaceToolbar", (id))
29 #define IMG(id) OLocalizator::getPicture("TYFaceToolbar", (id))
30 
31 TYFaceToolbar::TYFaceToolbar(QButtonGroup* pBtnGroup, QMainWindow* parent /*= 0*/, QString title /*= ""*/)
32  : QToolBar(title, parent)
33 {
34  _boucheActive = false;
35  _chemineeActive = false;
36  _fenetreActive = false;
37 
38  Q_CHECK_PTR(pBtnGroup);
39 
40  _toolButtonBouche = new QToolButton(this);
41  _toolButtonBouche->setIcon(QPixmap(IMG("id_icon_bouche")));
42  _toolButtonBouche->setText(TR("id_menuitem_bouche"));
43  _toolButtonBouche->setToolTip(TR("id_menuitem_bouche"));
44  _toolButtonBouche->setStatusTip(TR("id_menuitem_bouche"));
45  _toolButtonBouche->setCheckable(true);
46  addWidget(_toolButtonBouche);
48 
49  _toolButtonCheminee = new QToolButton(this);
50  _toolButtonCheminee->setIcon(QPixmap(IMG("id_icon_cheminee")));
51  _toolButtonCheminee->setText(TR("id_menuitem_cheminee"));
52  _toolButtonCheminee->setToolTip(TR("id_menuitem_cheminee"));
53  _toolButtonCheminee->setStatusTip(TR("id_menuitem_cheminee"));
54  _toolButtonCheminee->setCheckable(true);
55  addWidget(_toolButtonCheminee);
57 
58  _toolButtonFenetre = new QToolButton(this);
59  _toolButtonFenetre->setIcon(QPixmap(IMG("id_icon_fenetre")));
60  _toolButtonFenetre->setText(TR("id_menuitem_fenetre"));
61  _toolButtonFenetre->setToolTip(TR("id_menuitem_fenetre"));
62  _toolButtonFenetre->setStatusTip(TR("id_menuitem_fenetre"));
63  _toolButtonFenetre->setCheckable(true);
64  addWidget(_toolButtonFenetre);
66 }
67 
69 
71 {
72  if (active)
73  {
74  _toolButtonBouche->setEnabled(_boucheActive);
77  }
78  else
79  {
80  _toolButtonBouche->setEnabled(active);
81  _toolButtonCheminee->setEnabled(active);
82  _toolButtonFenetre->setEnabled(active);
83  }
84 }
85 
86 void TYFaceToolbar::activeBouche(bool active)
87 {
88  _boucheActive = active;
89  _toolButtonBouche->setEnabled(active);
90 }
91 
93 {
94  _chemineeActive = active;
95  _toolButtonCheminee->setEnabled(active);
96 }
97 
99 {
100  _fenetreActive = active;
101  _toolButtonFenetre->setEnabled(active);
102 }
Classe Modeler specialisee pour l'edition des faces (fichier header)
#define IMG(id)
#define TR(id)
Barre d'outils Face (fichier header)
void activeCheminee(bool active)
void activeFenetre(bool active)
virtual ~TYFaceToolbar()
Destructeur.
TYFaceToolbar(QButtonGroup *pBtnGroup, QMainWindow *parent=0, QString title="")
Constructeur par defaut.
QToolButton * _toolButtonFenetre
Bouton Fenetre.
Definition: TYFaceToolbar.h:75
QToolButton * _toolButtonCheminee
Bouton Cheminee.
Definition: TYFaceToolbar.h:72
void activeBouche(bool active)
bool _chemineeActive
Definition: TYFaceToolbar.h:73
QToolButton * _toolButtonBouche
Bouton Bouche.
Definition: TYFaceToolbar.h:69
void activeButtons(bool active)
Active/Desactive chaque boutons.