Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
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