Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYMachineToolbar.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 #include <QToolBar>
24 
27 #include "TYMachineToolbar.h"
28 
29 #define TR(id) OLocalizator::getString("TYMachineToolbar", (id))
30 #define IMG(id) OLocalizator::getPicture("TYMachineToolbar", (id))
31 
32 TYMachineToolbar::TYMachineToolbar(QButtonGroup* pBtnGroup, QMainWindow* parent /*= 0*/,
33  QString title /*= ""*/)
34  : QToolBar(title, parent)
35 {
36  Q_CHECK_PTR(pBtnGroup);
37 
38  _toolButtonBox = new QToolButton(this);
39  _toolButtonBox->setIcon(QPixmap(IMG("id_icon_box")));
40  _toolButtonBox->setText(TR("id_menuitem_box"));
41  _toolButtonBox->setToolTip(TR("id_menuitem_box"));
42  _toolButtonBox->setStatusTip(TR("id_menuitem_box"));
43  _toolButtonBox->setCheckable(true);
44  addWidget(_toolButtonBox);
46 
47  _toolButtonCyl = new QToolButton(this);
48  _toolButtonCyl->setIcon(QPixmap(IMG("id_icon_cyl")));
49  _toolButtonCyl->setText(TR("id_menuitem_cyl"));
50  _toolButtonCyl->setToolTip(TR("id_menuitem_cyl"));
51  _toolButtonCyl->setStatusTip(TR("id_menuitem_cyl"));
52  _toolButtonCyl->setCheckable(true);
53  addWidget(_toolButtonCyl);
55 
56  _toolButtonSemiCyl = new QToolButton(this);
57  _toolButtonSemiCyl->setIcon(QPixmap(IMG("id_icon_semicyl")));
58  _toolButtonSemiCyl->setText(TR("id_menuitem_semicyl"));
59  _toolButtonSemiCyl->setToolTip(TR("id_menuitem_semicyl"));
60  _toolButtonSemiCyl->setStatusTip(TR("id_menuitem_semicyl"));
61  _toolButtonSemiCyl->setCheckable(true);
62  addWidget(_toolButtonSemiCyl);
64 }
65 
67 
69 {
70  _toolButtonBox->setEnabled(active);
71  _toolButtonCyl->setEnabled(active);
72  _toolButtonSemiCyl->setEnabled(active);
73 }
Modeler specialisee pour l'edition des machines (fichier header)
#define IMG(id)
#define TR(id)
Barre d'outils Machine (fichier header)
TYMachineToolbar(QButtonGroup *pBtnGroup, QMainWindow *parent=0, QString title="")
QToolButton * _toolButtonBox
Bouton box.
void activeButtons(bool active)
virtual ~TYMachineToolbar()
QToolButton * _toolButtonSemiCyl
Bouton demi cylindre.
QToolButton * _toolButtonCyl
Bouton cylindre.