QtiPlot
0.9.8.2
|
Editor widget with support for evaluating expressions and executing code. More...
#include <ScriptEdit.h>
Public Slots | |
void | commentSelection () |
void | evaluate () |
void | execute () |
void | executeAll () |
QString | exportASCII (const QString &file=QString::null) |
void | exportPDF (const QString &fileName) |
bool | find (const QString &searchString, QTextDocument::FindFlags flags, bool previous=false) |
void | findNext () |
void | findPrevious () |
QString | importASCII (const QString &file=QString::null) |
void | insertFunction (const QString &) |
void | insertFunction (QAction *action) |
void | print () |
void | print (QPrinter *) |
void | replace () |
QString | save () |
void | scriptPrint (const QString &) |
void | setContext (QObject *context) |
void | setDirPath (const QString &path) |
void | showFindDialog (bool replace=false) |
void | uncommentSelection () |
void | updateIndentation () |
Signals | |
void | activated (ScriptEdit *) |
void | dirPathChanged (const QString &path) |
void | error (const QString &, const QString &, int) |
Public Member Functions | |
void | customEvent (QEvent *) |
Handle changing of scripting environment. | |
void | enableShortcuts () |
bool | error () |
int | lineNumber (int pos) const |
Map cursor positions to line numbers. | |
void | redirectOutputTo (QTextEdit *) |
void | rehighlight () |
ScriptEdit (ScriptingEnv *env, QWidget *parent=0, const char *name=0) | |
void | setCompleter (QCompleter *c) |
void | setFileName (const QString &fn) |
~ScriptEdit () | |
![]() | |
scripted (ScriptingEnv *env) | |
void | scriptingChangeEvent (ScriptingChangeEvent *) |
ScriptingEnv * | scriptingEnv () |
~scripted () |
Protected Member Functions | |
virtual void | contextMenuEvent (QContextMenuEvent *e) |
void | focusInEvent (QFocusEvent *e) |
virtual void | keyPressEvent (QKeyEvent *e) |
Private Slots | |
void | insertCompletion (const QString &completion) |
void | insertErrorMsg (const QString &message) |
Insert an error message from the scripting system at printCursor. | |
void | matchParentheses () |
Private Member Functions | |
void | clearErrorHighlighting () |
void | createParenthesisSelection (int pos) |
void | highlightErrorLine (int offset) |
bool | matchLeftParenthesis (QTextBlock currentBlock, int index, int numRightParentheses) |
bool | matchRightParenthesis (QTextBlock currentBlock, int index, int numLeftParentheses) |
QString | textUnderCursor () const |
Private Attributes | |
QAction * | actionEval |
QAction * | actionExecute |
QAction * | actionExecuteAll |
QAction * | actionExport |
QAction * | actionFind |
QAction * | actionFindNext |
QAction * | actionFindPrevious |
QAction * | actionImport |
QAction * | actionPrint |
QAction * | actionReplace |
QAction * | actionSave |
QCompleter * | d_completer |
QString | d_err_message |
bool | d_error |
True if we are inside evaluate(), execute() or executeAll() there were errors. | |
QString | d_file_name |
QTextBlockFormat | d_fmt_default |
Format used for resetting success/failure markers. | |
SyntaxHighlighter * | d_highlighter |
QTextEdit * | d_output_widget |
QTextDocument::FindFlags | d_search_flags |
QString | d_search_string |
QMenu * | functionsMenu |
Submenu of context menu with mathematical functions. | |
Script * | myScript |
QTextCursor | printCursor |
Cursor used for output of evaluation results and error messages. | |
QString | scriptsDirPath |
Additional Inherited Members | |
![]() | |
ScriptingEnv * | scriptEnv |
Editor widget with support for evaluating expressions and executing code.
ScriptEdit::ScriptEdit | ( | ScriptingEnv * | env, |
QWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
References actionEval, actionExecute, actionExecuteAll, actionExport, actionFind, actionFindNext, actionFindPrevious, actionImport, actionPrint, actionReplace, actionSave, activated(), d_fmt_default, error(), evaluate(), execute(), executeAll(), exportASCII(), findNext(), findPrevious(), MyParser::functionNamesList(), functionsMenu, importASCII(), insertErrorMsg(), insertFunction(), matchParentheses(), myScript, ScriptingEnv::newScript(), print(), printCursor, rehighlight(), replace(), save(), scripted::scriptEnv, scriptPrint(), scriptsDirPath, setCompleter(), and showFindDialog().
ScriptEdit::~ScriptEdit | ( | ) |
References d_completer, and d_highlighter.
|
signal |
Referenced by contextMenuEvent(), enableShortcuts(), focusInEvent(), ScriptEdit(), and setCompleter().
|
private |
References d_fmt_default, and d_output_widget.
Referenced by evaluate(), execute(), and executeAll().
|
slot |
Referenced by ApplicationWindow::commentSelection().
|
protectedvirtual |
References actionEval, actionExecute, actionExecuteAll, actionExport, actionFind, actionFindNext, actionFindPrevious, actionImport, actionPrint, actionReplace, actionSave, activated(), Note::autoexec(), Script::context(), functionsMenu, ScriptingEnv::mathFunctionDoc(), ScriptingEnv::mathFunctions(), myScript, scripted::scriptEnv, Script::scriptingEnv(), and Note::tabs().
|
private |
Referenced by matchLeftParenthesis(), matchParentheses(), and matchRightParenthesis().
void ScriptEdit::customEvent | ( | QEvent * | e | ) |
Handle changing of scripting environment.
References error(), insertErrorMsg(), myScript, ScriptingEnv::newScript(), print(), rehighlight(), scripted::scriptEnv, SCRIPTING_CHANGE_EVENT, scripted::scriptingChangeEvent(), and scriptPrint().
|
signal |
Referenced by importASCII().
void ScriptEdit::enableShortcuts | ( | ) |
References actionEval, actionFind, actionFindNext, actionFindPrevious, actionImport, actionReplace, actionSave, activated(), evaluate(), findNext(), findPrevious(), importASCII(), replace(), save(), and showFindDialog().
Referenced by FunctionDialog::FunctionDialog(), FitDialog::initEditPage(), SurfaceDialog::initFunctionPage(), SurfaceDialog::initParametricSurfacePage(), and IntDialog::IntDialog().
|
inline |
References d_error.
Referenced by customEvent(), ApplicationWindow::loadScript(), and ScriptEdit().
|
signal |
|
slot |
References clearErrorHighlighting(), Script::code(), d_error, d_fmt_default, Script::eval(), highlightErrorLine(), lineNumber(), myScript, printCursor, Script::scriptingEnv(), Script::setCode(), and Script::setName().
Referenced by enableShortcuts(), Note::evaluate(), and ScriptEdit().
|
slot |
References clearErrorHighlighting(), d_error, Script::exec(), highlightErrorLine(), lineNumber(), myScript, printCursor, Script::setCode(), and Script::setName().
Referenced by Note::execute(), and ScriptEdit().
|
slot |
|
slot |
|
slot |
Referenced by Note::exportPDF().
|
slot |
References d_search_flags, and d_search_string.
Referenced by FindReplaceDialog::find(), findNext(), and findPrevious().
|
slot |
References d_search_flags, d_search_string, find(), and showFindDialog().
Referenced by enableShortcuts(), ScriptWindow::findNext(), ApplicationWindow::noteFindNext(), and ScriptEdit().
|
slot |
References d_search_flags, d_search_string, find(), and showFindDialog().
Referenced by enableShortcuts(), ScriptWindow::findPrevious(), ApplicationWindow::noteFindPrev(), and ScriptEdit().
|
protected |
References activated(), and d_completer.
|
private |
References d_err_message, d_error, lineNumber(), and scripted::scriptEnv.
Referenced by evaluate(), execute(), and executeAll().
|
slot |
References dirPathChanged(), ScriptingEnv::fileFilter(), ApplicationWindow::getFileName(), scripted::scriptEnv, scriptsDirPath, and setFileName().
Referenced by enableShortcuts(), Note::importASCII(), ApplicationWindow::loadScript(), ScriptWindow::open(), ApplicationWindow::performCustomAction(), and ScriptEdit().
|
privateslot |
|
privateslot |
Insert an error message from the scripting system at printCursor.
After insertion, the text cursor will have the error message selected, allowing the user to delete it and fix the error.
References ScriptingEnv::application(), d_err_message, d_error, printCursor, and scripted::scriptEnv.
Referenced by customEvent(), and ScriptEdit().
|
slot |
|
slot |
References insertFunction(), ScriptingEnv::mathFunctions(), and scripted::scriptEnv.
|
protectedvirtual |
References d_completer, textUnderCursor(), and updateIndentation().
int ScriptEdit::lineNumber | ( | int | pos | ) | const |
Map cursor positions to line numbers.
Referenced by evaluate(), execute(), highlightErrorLine(), and scriptPrint().
|
private |
References ParenthesisInfo::character, createParenthesisSelection(), TextBlockData::parentheses(), and ParenthesisInfo::position.
Referenced by matchParentheses().
|
privateslot |
References ParenthesisInfo::character, createParenthesisSelection(), matchLeftParenthesis(), matchRightParenthesis(), TextBlockData::parentheses(), and ParenthesisInfo::position.
Referenced by ScriptEdit().
|
private |
References ParenthesisInfo::character, createParenthesisSelection(), TextBlockData::parentheses(), and ParenthesisInfo::position.
Referenced by matchParentheses().
|
slot |
Referenced by customEvent(), Note::print(), and ScriptEdit().
|
slot |
void ScriptEdit::redirectOutputTo | ( | QTextEdit * | te | ) |
References d_output_widget, and printCursor.
Referenced by ScriptWindow::redirectOutput().
void ScriptEdit::rehighlight | ( | ) |
References d_highlighter, and scripted::scriptEnv.
Referenced by customEvent(), ConfigDialog::rehighlight(), and ScriptEdit().
|
inlineslot |
References showFindDialog().
Referenced by enableShortcuts(), and ScriptEdit().
|
slot |
References d_file_name, and exportASCII().
Referenced by enableShortcuts(), and ScriptEdit().
|
slot |
References lineNumber(), and printCursor.
Referenced by customEvent(), and ScriptEdit().
void ScriptEdit::setCompleter | ( | QCompleter * | c | ) |
|
inlineslot |
References myScript, and Script::setContext().
Referenced by Note::addTab(), ScriptWindow::ScriptWindow(), MatrixValuesDialog::setMatrix(), ExtractDataDialog::setTable(), and SetColValuesDialog::setTable().
|
slot |
References scriptsDirPath.
Referenced by Note::addTab(), ScriptWindow::ScriptWindow(), and Note::setDirPath().
void ScriptEdit::setFileName | ( | const QString & | fn | ) |
References Script::context(), d_file_name, Note::indexOf(), myScript, and Note::renameTab().
Referenced by exportASCII(), and importASCII().
|
slot |
|
private |
Referenced by keyPressEvent().
|
slot |
Referenced by ApplicationWindow::uncommentSelection().
|
slot |
Referenced by keyPressEvent().
|
private |
Referenced by contextMenuEvent(), enableShortcuts(), and ScriptEdit().
|
private |
Referenced by contextMenuEvent(), and ScriptEdit().
|
private |
Referenced by contextMenuEvent(), and ScriptEdit().
|
private |
Referenced by contextMenuEvent(), and ScriptEdit().
|
private |
Referenced by contextMenuEvent(), enableShortcuts(), and ScriptEdit().
|
private |
Referenced by contextMenuEvent(), enableShortcuts(), and ScriptEdit().
|
private |
Referenced by contextMenuEvent(), enableShortcuts(), and ScriptEdit().
|
private |
Referenced by contextMenuEvent(), enableShortcuts(), and ScriptEdit().
|
private |
Referenced by contextMenuEvent(), and ScriptEdit().
|
private |
Referenced by contextMenuEvent(), enableShortcuts(), and ScriptEdit().
|
private |
Referenced by contextMenuEvent(), enableShortcuts(), and ScriptEdit().
|
private |
Referenced by focusInEvent(), insertCompletion(), keyPressEvent(), setCompleter(), and ~ScriptEdit().
|
private |
Referenced by highlightErrorLine(), and insertErrorMsg().
|
private |
True if we are inside evaluate(), execute() or executeAll() there were errors.
Referenced by error(), evaluate(), execute(), executeAll(), highlightErrorLine(), and insertErrorMsg().
|
private |
Referenced by save(), and setFileName().
|
private |
Format used for resetting success/failure markers.
Referenced by clearErrorHighlighting(), evaluate(), and ScriptEdit().
|
private |
Referenced by rehighlight(), and ~ScriptEdit().
|
private |
Referenced by clearErrorHighlighting(), and redirectOutputTo().
|
private |
Referenced by find(), findNext(), and findPrevious().
|
private |
Referenced by find(), findNext(), and findPrevious().
|
private |
Submenu of context menu with mathematical functions.
Referenced by contextMenuEvent(), and ScriptEdit().
|
private |
Referenced by contextMenuEvent(), customEvent(), evaluate(), execute(), executeAll(), ScriptEdit(), setContext(), and setFileName().
|
private |
Cursor used for output of evaluation results and error messages.
Referenced by evaluate(), execute(), insertErrorMsg(), redirectOutputTo(), ScriptEdit(), and scriptPrint().
|
private |
Referenced by exportASCII(), importASCII(), ScriptEdit(), and setDirPath().