ScriptWindow.h

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

Generated by  doxygen 1.6.2