ScriptWindow.h
Go to the documentation of this file.
/***************************************************************************
File : ScriptWindow.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2006 - 2009 by Ion Vasilief Knut Franke
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Python script window
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef SCRIPTWINDOW_H
#define SCRIPTWINDOW_H
#include "ScriptEdit.h"
#include <QMainWindow>
#include <QMenu>
#include <QCloseEvent>
class ScriptingEnv;
class ApplicationWindow;
class LineNumberDisplay;
class QAction;
class ScriptWindow: public QMainWindow
{
Q_OBJECT
public:
ScriptWindow(ScriptingEnv *env, ApplicationWindow *app);
~ScriptWindow(){exit(0);};
public slots:
void newScript();
void open(const QString& fn = QString());
void save();
void saveAs();
void languageChange();
virtual void setVisible(bool visible);
ScriptEdit* editor(){return te;};
void executeAll(){te->executeAll();};
void showLineNumbers(bool show = true);
private slots:
void setAlwaysOnTop(bool on);
void redirectOutput(bool);
void printPreview();
void showWorkspace(bool on = true);
void find();
void findNext();
void findPrevious();
void replace();
void increaseIndent();
void decreaseIndent();
void enableActions();
signals:
void visibilityChanged(bool visible);
private:
void moveEvent( QMoveEvent* );
void resizeEvent( QResizeEvent* );
void initMenu();
void initActions();
ScriptEdit *te;
ApplicationWindow *d_app;
LineNumberDisplay *d_line_number;
QWidget *d_frame;
QString fileName;
QMenu *file, *edit, *run, *windowMenu;
QAction *actionNew, *actionUndo, *actionRedo, *actionCut, *actionCopy, *actionPaste;
QAction *actionExecute, *actionExecuteAll, *actionEval, *actionPrint, *actionOpen;
QAction *actionSave, *actionSaveAs;
QAction *actionAlwaysOnTop, *actionHide, *actionShowLineNumbers;
QAction *actionShowConsole, *actionRedirectOutput, *actionPrintPreview;
QAction *actionShowWorkspace;
QAction *actionFind, *actionFindNext, *actionFindPrev, *actionReplace;
QAction *actionIncreaseIndent, *actionDecreaseIndent;
QDockWidget *consoleWindow;
QTextEdit *console;
};
#endif
ScriptEdit::executeAll
void executeAll()
Definition: ScriptEdit.cpp:431
ScriptWindow::d_line_number
LineNumberDisplay * d_line_number
Definition: ScriptWindow.h:89
ScriptWindow::actionShowConsole
QAction * actionShowConsole
Definition: ScriptWindow.h:99
ScriptWindow::actionPrint
QAction * actionPrint
Definition: ScriptWindow.h:96
ScriptWindow::actionUndo
QAction * actionUndo
Definition: ScriptWindow.h:95
ScriptWindow::editor
ScriptEdit * editor()
Definition: ScriptWindow.h:59
ScriptWindow::console
QTextEdit * console
Definition: ScriptWindow.h:104
ScriptWindow::moveEvent
void moveEvent(QMoveEvent *)
Definition: ScriptWindow.cpp:400
ScriptWindow::increaseIndent
void increaseIndent()
Definition: ScriptWindow.cpp:465
ScriptWindow::executeAll
void executeAll()
Definition: ScriptWindow.h:60
ScriptWindow::actionCut
QAction * actionCut
Definition: ScriptWindow.h:95
ScriptWindow::actionReplace
QAction * actionReplace
Definition: ScriptWindow.h:101
LineNumberDisplay
A QTextEdit displaying line numbers.
Definition: LineNumberDisplay.h:38
ScriptWindow::setVisible
virtual void setVisible(bool visible)
Definition: ScriptWindow.cpp:380
ScriptWindow::actionRedirectOutput
QAction * actionRedirectOutput
Definition: ScriptWindow.h:99
ScriptWindow::windowMenu
QMenu * windowMenu
Definition: ScriptWindow.h:94
ScriptWindow::actionDecreaseIndent
QAction * actionDecreaseIndent
Definition: ScriptWindow.h:102
ScriptWindow::te
ScriptEdit * te
Definition: ScriptWindow.h:87
ScriptingEnv
An interpreter for evaluating scripting code. Abstract.
Definition: ScriptingEnv.h:50
ScriptWindow::enableActions
void enableActions()
Definition: ScriptWindow.cpp:475
ScriptWindow::actionCopy
QAction * actionCopy
Definition: ScriptWindow.h:95
ScriptWindow::newScript
void newScript()
Definition: ScriptWindow.cpp:338
ScriptWindow::actionExecuteAll
QAction * actionExecuteAll
Definition: ScriptWindow.h:96
ScriptWindow::actionHide
QAction * actionHide
Definition: ScriptWindow.h:98
ScriptWindow::visibilityChanged
void visibilityChanged(bool visible)
ScriptWindow::ScriptWindow
ScriptWindow(ScriptingEnv *env, ApplicationWindow *app)
Definition: ScriptWindow.cpp:47
ScriptWindow::d_app
ApplicationWindow * d_app
Definition: ScriptWindow.h:88
ScriptWindow::initActions
void initActions()
Definition: ScriptWindow.cpp:107
ScriptWindow::initMenu
void initMenu()
Definition: ScriptWindow.cpp:92
ScriptWindow::actionOpen
QAction * actionOpen
Definition: ScriptWindow.h:96
ScriptWindow::saveAs
void saveAs()
Definition: ScriptWindow.cpp:354
ScriptWindow::actionFindNext
QAction * actionFindNext
Definition: ScriptWindow.h:101
ScriptWindow::printPreview
void printPreview()
Definition: ScriptWindow.cpp:427
ScriptWindow::actionPaste
QAction * actionPaste
Definition: ScriptWindow.h:95
ScriptWindow::replace
void replace()
Definition: ScriptWindow.cpp:460
ScriptWindow::file
QMenu * file
Definition: ScriptWindow.h:94
ScriptWindow::actionShowLineNumbers
QAction * actionShowLineNumbers
Definition: ScriptWindow.h:98
ScriptWindow::d_frame
QWidget * d_frame
Definition: ScriptWindow.h:90
ScriptWindow::languageChange
void languageChange()
Definition: ScriptWindow.cpp:260
ScriptWindow::save
void save()
Definition: ScriptWindow.cpp:363
ScriptWindow::actionRedo
QAction * actionRedo
Definition: ScriptWindow.h:95
ApplicationWindow
QtiPlot's main window.
Definition: ApplicationWindow.h:133
ScriptWindow::actionFind
QAction * actionFind
Definition: ScriptWindow.h:101
ScriptEdit
Editor widget with support for evaluating expressions and executing code.
Definition: ScriptEdit.h:50
ScriptWindow::actionExecute
QAction * actionExecute
Definition: ScriptWindow.h:96
ScriptWindow
Python script window.
Definition: ScriptWindow.h:43
ScriptWindow::decreaseIndent
void decreaseIndent()
Definition: ScriptWindow.cpp:470
ScriptWindow::actionSaveAs
QAction * actionSaveAs
Definition: ScriptWindow.h:97
ScriptWindow::actionAlwaysOnTop
QAction * actionAlwaysOnTop
Definition: ScriptWindow.h:98
ScriptWindow::actionSave
QAction * actionSave
Definition: ScriptWindow.h:97
ScriptWindow::actionPrintPreview
QAction * actionPrintPreview
Definition: ScriptWindow.h:99
ScriptWindow::findNext
void findNext()
Definition: ScriptWindow.cpp:450
ScriptWindow::actionNew
QAction * actionNew
Definition: ScriptWindow.h:95
ScriptWindow::actionFindPrev
QAction * actionFindPrev
Definition: ScriptWindow.h:101
ScriptWindow::actionShowWorkspace
QAction * actionShowWorkspace
Definition: ScriptWindow.h:100
ScriptWindow::open
void open(const QString &fn=QString())
Definition: ScriptWindow.cpp:345
ScriptWindow::showLineNumbers
void showLineNumbers(bool show=true)
Enables/Disables the line number display.
Definition: ScriptWindow.cpp:412
ScriptWindow::showWorkspace
void showWorkspace(bool on=true)
Definition: ScriptWindow.cpp:435
ScriptWindow::resizeEvent
void resizeEvent(QResizeEvent *)
Definition: ScriptWindow.cpp:406
ScriptWindow::redirectOutput
void redirectOutput(bool)
Definition: ScriptWindow.cpp:419
ScriptWindow::run
QMenu * run
Definition: ScriptWindow.h:94
ScriptWindow::actionIncreaseIndent
QAction * actionIncreaseIndent
Definition: ScriptWindow.h:102
ScriptEdit.h
ScriptWindow::~ScriptWindow
~ScriptWindow()
Definition: ScriptWindow.h:49
ScriptWindow::fileName
QString fileName
Definition: ScriptWindow.h:92
ScriptWindow::findPrevious
void findPrevious()
Definition: ScriptWindow.cpp:455
ScriptWindow::find
void find()
Definition: ScriptWindow.cpp:445
ScriptWindow::edit
QMenu * edit
Definition: ScriptWindow.h:94
ScriptWindow::setAlwaysOnTop
void setAlwaysOnTop(bool on)
Definition: ScriptWindow.cpp:388
ScriptWindow::consoleWindow
QDockWidget * consoleWindow
Definition: ScriptWindow.h:103
ScriptWindow::actionEval
QAction * actionEval
Definition: ScriptWindow.h:96