All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ScriptTabWidget.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2011-20011 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of TerraLib Code Editor - A widget component for scripting with TerraLib Platform.
4 
5  TerraLib Code Editor is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib Code Editor is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with TerraLib Code Editor. See COPYING. If not, write to
17  Gilberto Ribeiro de Queiroz at <gribeiro@dpi.inpe.br>.
18  */
19 
20 /*!
21  \file ScriptTabWidget.cpp
22 
23  \brief The main tab widget may be used to display several scripts.
24 */
25 
26 // TerraLib Code Editor
27 #include "Application.h"
28 #include "ScriptTabWidget.h"
29 #include "ScriptWidget.h"
30 
31 // Qt
32 #include <QtGui/QMenu>
33 #include <QtGui/QMouseEvent>
34 
36  : QTabWidget(parent),
37  m_parent(parent)
38 {
39 }
40 
42 {
43 }
44 
45 tce::Application* tce::ScriptTabWidget::getApplication() const
46 {
47  return m_parent;
48 }
49 
51 {
52  if(evt->button() == Qt::RightButton)
53  {
54  QMenu m(this);
55 
56  if(m_parent->isFullScreen())
57  {
58  QAction* viewNormal = new QAction(tr("&View Normal"), this);
59 
60  m.addAction(viewNormal);
61 
62  connect(viewNormal, SIGNAL(triggered()), m_parent, SLOT(viewNormal()));
63  }
64 
65  //m.popup(evt->pos());
66  m.exec(evt->globalPos());
67  }
68 
69  QTabWidget::mousePressEvent(evt);
70 }
71 
A widget that can be used to show and control he execution of a script.
ScriptTabWidget(Application *parent)
The main tab widget may be used to display several scripts.
Application * getApplication() const
void mousePressEvent(QMouseEvent *evt)