ScriptWindow.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : ScriptWindow.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2006 by Ion Vasilief, 
00006                            Tilman Hoener zu Siederdissen,
00007                            Knut Franke
00008     Email (use @ for *)  : ion_vasilief*yahoo.fr, thzs*gmx.net
00009     Description          : Python script window
00010                            
00011  ***************************************************************************/
00012 
00013 /***************************************************************************
00014  *                                                                         *
00015  *  This program is free software; you can redistribute it and/or modify   *
00016  *  it under the terms of the GNU General Public License as published by   *
00017  *  the Free Software Foundation; either version 2 of the License, or      *
00018  *  (at your option) any later version.                                    *
00019  *                                                                         *
00020  *  This program is distributed in the hope that it will be useful,        *
00021  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00022  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00023  *  GNU General Public License for more details.                           *
00024  *                                                                         *
00025  *   You should have received a copy of the GNU General Public License     *
00026  *   along with this program; if not, write to the Free Software           *
00027  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00028  *   Boston, MA  02110-1301  USA                                           *
00029  *                                                                         *
00030  ***************************************************************************/
00031 #ifndef SCRIPTWINDOW_H
00032 #define SCRIPTWINDOW_H
00033 
00034 #include "ScriptEdit.h"
00035 
00036 #include <QMainWindow>
00037 #include <QMenu>
00038 #include <QCloseEvent>
00039 class ScriptingEnv;
00040 class ApplicationWindow;
00041 class LineNumberDisplay;
00042 class QAction;
00043 
00045 class ScriptWindow: public QMainWindow
00046 {
00047     Q_OBJECT
00048 
00049 public:
00050         ScriptWindow(ScriptingEnv *env, ApplicationWindow *app);
00051         ~ScriptWindow(){exit(0);};
00052 
00053 public slots:
00054         void newScript();
00055         void open(const QString& fn = QString());
00056         void save();
00057         void saveAs();
00058         void languageChange();
00059         virtual void setVisible(bool visible);
00060 
00061         ScriptEdit* editor(){return te;};
00062         void executeAll(){te->executeAll();};
00063         
00065         void showLineNumbers(bool show = true);
00066         
00067 private slots:
00068         void setAlwaysOnTop(bool on);
00069 
00070 signals:
00071         void visibilityChanged(bool visible);
00072 
00073 private:
00074         void moveEvent( QMoveEvent* );
00075         void resizeEvent( QResizeEvent* );
00076 
00077         void initMenu();
00078         void initActions();
00079         ScriptEdit *te;
00080         ApplicationWindow *d_app;
00081         LineNumberDisplay *d_line_number;
00082         QWidget *d_frame;
00083 
00084         QString fileName;
00085 
00086         QMenu *file, *edit, *run, *windowMenu;
00087         QAction *actionNew, *actionUndo, *actionRedo, *actionCut, *actionCopy, *actionPaste;
00088         QAction *actionExecute, *actionExecuteAll, *actionEval, *actionPrint, *actionOpen;
00089         QAction *actionSave, *actionSaveAs;
00090         QAction *actionAlwaysOnTop, *actionHide, *actionShowLineNumbers;
00091 };
00092 
00093 #endif

Generated on Sun Jun 15 21:32:19 2008 for QtiPlot by  doxygen 1.5.6