Gui::PythonConsole Class Reference

#include <PythonConsole.h>

Inheritance diagram for Gui::PythonConsole:
Gui::TextEdit Gui::WindowParameter

List of all members.

Public Slots

void onCopyCommand ()
 Copy the selected commands into the clipboard.
void onCopyHistory ()
 Copy the history of the console into the clipboard.
void onInsertFileName ()
void onSaveHistoryAs ()

Public Member Functions

void OnChange (Base::Subject< const char * > &rCaller, const char *rcReason)
 Set new font and colors according to the paramerts.
void printStatement (const QString &cmd)
 Prints the Python statement cmd to the console.
 PythonConsole (QWidget *parent=0)
 Constructs a PythonConsole which is a child of 'parent'.
 ~PythonConsole ()
 Destroys the object and frees any allocated resources.

Protected Member Functions

bool canInsertFromMimeData (const QMimeData *source) const
void changeEvent (QEvent *e)
void contextMenuEvent (QContextMenuEvent *e)
 Pops up the context menu with some extensions.
QMimeData * createMimeDataFromSelection () const
void dragEnterEvent (QDragEnterEvent *e)
 Dragging of action objects is allowed.
void dragMoveEvent (QDragMoveEvent *e)
 Dragging of action objects is allowed.
void dropEvent (QDropEvent *e)
 Drops the event e and writes the right Python command.
void insertFromMimeData (const QMimeData *source)
 Allow to paste plain text or urls of text files.
void keyPressEvent (QKeyEvent *e)
 Checks the input of the console to make the correct indentations.
void overrideCursor (const QString &txt)
 Overwrites the text of the cursor.
void showEvent (QShowEvent *e)
 Shows the Python window and sets the focus to set text cursor.

Friends

class PythonStderr
class PythonStdout

Detailed Description

Definition at line 91 of file PythonConsole.h.


Constructor & Destructor Documentation

PythonConsole::PythonConsole ( QWidget *  parent = 0  ) 
PythonConsole::~PythonConsole (  ) 

Member Function Documentation

bool PythonConsole::canInsertFromMimeData ( const QMimeData *  source  )  const [protected]

Definition at line 771 of file PythonConsole.cpp.

References Mesh2Shape::ext.

Referenced by contextMenuEvent().

void PythonConsole::changeEvent ( QEvent *  e  )  [protected]

Definition at line 715 of file PythonConsole.cpp.

References draftlibs::fcgeo::connect().

void PythonConsole::contextMenuEvent ( QContextMenuEvent *  e  )  [protected]
QMimeData * PythonConsole::createMimeDataFromSelection (  )  const [protected]
void PythonConsole::dragEnterEvent ( QDragEnterEvent *  e  )  [protected]

Dragging of action objects is allowed.

Definition at line 762 of file PythonConsole.cpp.

void PythonConsole::dragMoveEvent ( QDragMoveEvent *  e  )  [protected]

Dragging of action objects is allowed.

Definition at line 752 of file PythonConsole.cpp.

void PythonConsole::dropEvent ( QDropEvent *  e  )  [protected]

Drops the event e and writes the right Python command.

Definition at line 730 of file PythonConsole.cpp.

References printStatement().

void PythonConsole::insertFromMimeData ( const QMimeData *  source  )  [protected]

Allow to paste plain text or urls of text files.

Definition at line 793 of file PythonConsole.cpp.

References Mesh2Shape::ext, and DrawingExample::file.

void PythonConsole::keyPressEvent ( QKeyEvent *  e  )  [protected]

Checks the input of the console to make the correct indentations.

After a command is prompted completely the Python interpreter is started.

Reimplemented from Gui::TextEdit.

Definition at line 431 of file PythonConsole.cpp.

References Gui::ConsoleHistory::append(), Gui::PythonConsoleP::callTipsList, macros::cmd, Gui::PythonConsoleP::history, Gui::ConsoleHistory::isEmpty(), Gui::ConsoleHistory::next(), overrideCursor(), Gui::ConsoleHistory::prev(), Gui::CallTipsList::showTips(), Gui::CallTipsList::validateCursor(), and Gui::ConsoleHistory::value().

void PythonConsole::OnChange ( Base::Subject< const char * > &  rCaller,
const char *  sReason 
)

Set new font and colors according to the paramerts.

Reimplemented from Gui::WindowParameter.

Definition at line 402 of file PythonConsole.cpp.

References Gui::PythonConsoleP::colormap, Gui::WindowParameter::getWindowParameter(), and Gui::SyntaxHighlighter::setColor().

void PythonConsole::onCopyCommand (  )  [slot]

Copy the selected commands into the clipboard.

This is a subset of the history.

Definition at line 1069 of file PythonConsole.cpp.

References Gui::PythonConsoleP::Command, draftlibs::dxfLibrary::copy, Gui::PythonConsoleP::Normal, and Gui::PythonConsoleP::type.

Referenced by contextMenuEvent().

void PythonConsole::onCopyHistory (  )  [slot]
void PythonConsole::onInsertFileName (  )  [slot]

Definition at line 1045 of file PythonConsole.cpp.

References Gui::getMainWindow(), and Gui::FileDialog::getOpenFileName().

Referenced by contextMenuEvent().

void PythonConsole::onSaveHistoryAs (  )  [slot]
void PythonConsole::overrideCursor ( const QString &  txt  )  [protected]

Overwrites the text of the cursor.

Definition at line 968 of file PythonConsole.cpp.

Referenced by keyPressEvent().

void PythonConsole::printStatement ( const QString &  cmd  ) 

Prints the Python statement cmd to the console.

Note:
The statement gets only printed and added to the history but not invoked.

Definition at line 679 of file PythonConsole.cpp.

References Gui::ConsoleHistory::append(), Gui::PythonConsoleP::history, Gui::PythonConsoleP::interactive, and Gui::PythonConsoleP::statements.

Referenced by Gui::MacroManager::addLine(), and dropEvent().

void PythonConsole::showEvent ( QShowEvent *  e  )  [protected]

Shows the Python window and sets the focus to set text cursor.

Definition at line 702 of file PythonConsole.cpp.


Friends And Related Function Documentation

friend class PythonStderr [friend]

Definition at line 140 of file PythonConsole.h.

Referenced by PythonConsole().

friend class PythonStdout [friend]

Definition at line 139 of file PythonConsole.h.

Referenced by PythonConsole().


The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:02:01 2011 for FreeCAD by  doxygen 1.6.1