QtiPlot  0.9.8.2
ScriptWindow.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : ScriptWindow.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2006 - 2009 by Ion Vasilief Knut Franke
6  Email (use @ for *) : ion_vasilief*yahoo.fr
7  Description : Python script window
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 #ifndef SCRIPTWINDOW_H
30 #define SCRIPTWINDOW_H
31 
32 #include "ScriptEdit.h"
33 
34 #include <QMainWindow>
35 #include <QMenu>
36 #include <QCloseEvent>
37 class ScriptingEnv;
38 class ApplicationWindow;
39 class LineNumberDisplay;
40 class QAction;
41 
43 class ScriptWindow: public QMainWindow
44 {
45  Q_OBJECT
46 
47 public:
49  ~ScriptWindow(){exit(0);};
50 
51 public slots:
52  void newScript();
53  void open(const QString& fn = QString());
54  void save();
55  void saveAs();
56  void languageChange();
57  virtual void setVisible(bool visible);
58 
59  ScriptEdit* editor(){return te;};
60  void executeAll(){te->executeAll();};
61 
63  void showLineNumbers(bool show = true);
64 
65 private slots:
66  void setAlwaysOnTop(bool on);
67  void redirectOutput(bool);
68  void printPreview();
69  void showWorkspace(bool on = true);
70  void find();
71  void findNext();
72  void findPrevious();
73  void replace();
74  void increaseIndent();
75  void decreaseIndent();
76  void enableActions();
77 
78 signals:
79  void visibilityChanged(bool visible);
80 
81 private:
82  void moveEvent( QMoveEvent* );
83  void resizeEvent( QResizeEvent* );
84 
85  void initMenu();
86  void initActions();
90  QWidget *d_frame;
91 
92  QString fileName;
93 
94  QMenu *file, *edit, *run, *windowMenu;
103  QDockWidget *consoleWindow;
104  QTextEdit *console;
105 };
106 
107 #endif