COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Public Member Functions | Protected Member Functions | Private Slots | List of all members
PythonCodeEditor Class Reference

simple python editor More...

#include <PythonCodeEditor.hpp>

Inherits PythonCodeContainer.

Public Member Functions

 PythonCodeEditor (QWidget *parent=0)
 
- Public Member Functions inherited from PythonCodeContainer
 PythonCodeContainer (QWidget *parent=0)
 constructor More...
 
void repaint_border_area (QPaintEvent *event)
 called by the border area on repaint event, display the line numbers from QTextBlock::userState More...
 

Protected Member Functions

void key_press_event (QKeyEvent *)
 call after the the common text More...
 
void new_line (int indent_number)
 allow the console to known when execute a inputed code More...
 
void border_click (const QPoint &pos)
 called by the border area on click event More...
 
bool editable_zone (const QTextCursor &cursor)
 allow the python container to known if the position of the cursor is writable, used for the python console More...
 
void insert_text (const QString &text)
 ask a text insertion to the inherited class More...
 
- Protected Member Functions inherited from PythonCodeContainer
void toggle_break_point (int fragment_block, int line_number, bool send=true)
 Send a toggle break command to the script engine. More...
 
void keyPressEvent (QKeyEvent *e)
 manage some typing behaviour then call key_press_event to propagate the event to the inherited class More...
 
void resizeEvent (QResizeEvent *e)
 repaint the border area More...
 
void mouseMoveEvent (QMouseEvent *e)
 start a timer when the mouse is on a word, the timer will make a request_documentation for this word More...
 
void leaveEvent (QEvent *)
 stop the documentation timer More...
 
QMimeData * createMimeDataFromSelection () const
 create a mimeData with a preview of the selected text More...
 
bool canInsertFromMimeData (const QMimeData *source) const
 allow to drop text mimeData and QListWidgetItem mimeData More...
 
void insertFromMimeData (const QMimeData *source)
 call insert_text with the extracted mimeData More...
 

Private Slots

void execute_immediat ()
 send the code to the python console, the entire code is executed directly More...
 
void execute_stepped ()
 send the code to the python console, the console stop after each statement to let the user do some modifications More...
 
void open ()
 open a file and append his content to the code editor More...
 
void save ()
 save the code editor content to a file More...
 
void contents_change (int pos, int sub, int add)
 called at each modification, the main purpose of this is to change the new block state to LINE_NUMBER More...
 

Additional Inherited Members

- Public Types inherited from PythonCodeContainer
enum  line_type { PROMPT_1 = 100000, PROMPT_2 = 100001, LINE_NUMBER = 100002 }
 Use to manage userData in a QTextBlock. More...
 
- Protected Slots inherited from PythonCodeContainer
void update_border_area (const QRect &, int)
 connected to the scrollbar signal of the code zone, ask to the border area to do a repaint More...
 
void keywords_changed (const QStringList &add, const QStringList &sub)
 
void insert_completion (QString)
 
void request_documentation ()
 
void popup_documentation (const QString &documentation)
 
- Protected Attributes inherited from PythonCodeContainer
int border_width
 
QPoint offset_border
 
QToolBar * tool_bar
 
QVector< int > break_points
 
PythonSyntaxeHighlighterhighlighter
 
- Static Protected Attributes inherited from PythonCodeContainer
static PythonConsolepython_console =NULL
 
static QStandardItemModel python_dictionary
 
static QTreeView * python_scope_values =NULL
 

Detailed Description

simple python editor

Definition at line 30 of file PythonCodeEditor.hpp.

Constructor & Destructor Documentation

PythonCodeEditor ( QWidget *  parent = 0)

Definition at line 30 of file PythonCodeEditor.cpp.

Member Function Documentation

void border_click ( const QPoint &  pos)
protectedvirtual

called by the border area on click event

Implements PythonCodeContainer.

Definition at line 75 of file PythonCodeEditor.cpp.

void contents_change ( int  pos,
int  sub,
int  add 
)
privateslot

called at each modification, the main purpose of this is to change the new block state to LINE_NUMBER

Definition at line 152 of file PythonCodeEditor.cpp.

bool editable_zone ( const QTextCursor &  cursor)
protectedvirtual

allow the python container to known if the position of the cursor is writable, used for the python console

Implements PythonCodeContainer.

Definition at line 84 of file PythonCodeEditor.cpp.

void execute_immediat ( )
privateslot

send the code to the python console, the entire code is executed directly

Definition at line 96 of file PythonCodeEditor.cpp.

void execute_stepped ( )
privateslot

send the code to the python console, the console stop after each statement to let the user do some modifications

Definition at line 102 of file PythonCodeEditor.cpp.

void insert_text ( const QString &  text)
protectedvirtual

ask a text insertion to the inherited class

Implements PythonCodeContainer.

Definition at line 90 of file PythonCodeEditor.cpp.

void key_press_event ( QKeyEvent *  e)
protectedvirtual

call after the the common text

Implements PythonCodeContainer.

Definition at line 48 of file PythonCodeEditor.cpp.

void new_line ( int  indent_number)
protectedvirtual

allow the console to known when execute a inputed code

Reimplemented from PythonCodeContainer.

Definition at line 63 of file PythonCodeEditor.cpp.

void open ( )
privateslot

open a file and append his content to the code editor

Definition at line 108 of file PythonCodeEditor.cpp.

void save ( )
privateslot

save the code editor content to a file

Definition at line 130 of file PythonCodeEditor.cpp.


The documentation for this class was generated from the following files:
Send comments to:
COOLFluiD Web Admin