5#ifndef BALL_VIEW_WIDGETS_PYWIDGET_H
6#define BALL_VIEW_WIDGETS_PYWIDGET_H
12#ifndef BALL_DATATYPE_STRING_H
16#ifndef BALL_VIEW_WIDGETS_DOCKWIDGET_H
20#ifndef BALL_VIEW_WIDGETS_TEXTEDITORWIDGET_H
24#include <QtGui/QDragEnterEvent>
25#include <QtGui/QKeyEvent>
26#include <QtGui/QDropEvent>
27#include <QtWidgets/QLineEdit>
28#include <QtWidgets/QComboBox>
29#include <QtWidgets/QTabWidget>
30#include <QtGui/QSyntaxHighlighter>
31#include <QtGui/QValidator>
32#include <QtCore/QStringList>
34#include <QtCore/QThread>
83 virtual State
validate(QString& input,
int& pos)
const;
107 bool& ok,
String comment =
"");
149 void setPyWidget(
PyWidget* pw) { pw_ = pw;}
153 virtual void keyPressEvent(QKeyEvent* event);
165 void setPyWidget(
PyWidget* pw) { pw_ = pw;}
169 virtual void keyPressEvent(QKeyEvent* event);
174 friend class MyLineEdit;
#define BALL_EMBEDDABLE(TYPE, BASE)
BALL_EXPORT bool operator<(const String &s1, const String &s2)
BALL_EXPORT bool operator==(const String &s1, const String &s2)
QTextCharFormat comment_format
QStringList BALL_keywords
QTextCharFormat python_format
vector< QRegExp > BALL_patterns
QTextCharFormat my_class_format
QTextCharFormat string_format
vector< QRegExp > python_patterns
QStringList python_keywords
void highlightBlock(const QString &text)
PythonValidator(QObject *parent=0)
virtual State validate(QString &input, int &pos) const
virtual ~PythonValidator()
static Hotkey createHotkey(String modifier, String key, String command, bool &ok, String comment="")
bool set(const String &data)
Qt::KeyboardModifiers button_state
void get(String &data) const
virtual void writePreferences(INIFile &inifile)
void showEditContextMenu(const QPoint &point)
virtual void contentsDropEvent(QDropEvent *e)
virtual void contentsDragEnterEvent(QDragEnterEvent *e)
virtual bool returnPressed()
bool parseLine_(String line)
Parse a and execute a given string. If silent_ is set to true, no prompts are being printed.
std::list< Hotkey > hotkeys_
virtual void initializeWidget(MainControl &main_control)
QString getCurrentScript()
PythonValidator validator_
virtual bool canHandle(const String &fileformat) const
String runCommand_(const String &command, bool &state)
bool openFile(const String &filename, bool run, bool is_current=false)
String getCurrentLine() const
virtual void modifyHotkeys()
void appendText_(TextEditorWidget *te, String text)
virtual void hotkeyItem()
bool runString(String command)
virtual void clearHistory_()
void dump(std::ostream &s, Size depth) const
bool testMultilineStart_(const String &line)
virtual void scriptDialog(bool run=false)
Open a dialog to select a script.
const char * getPrompt_() const
void showContextMenu(const QPoint &point)
vector< String > history_
void removeHotkey(const Hotkey &hotkey)
bool getMembers(const String &classname, QStringList &sl, const String &prefix)
MyTextEdit * script_edit_
bool started_startup_script_
void finalizePreferencesTab(Preferences &preferences)
virtual bool completionSelected_()
Preferences * preferences_
void retrieveHistoryLine_(Position index)
TextEditorWidget * script_output_
void map(String modifier, String key, String command, String comment="")
RunPythonThread * thread_
void unmap(String modifier, String key)
see above
String getCurrentWord_(QTextCursor &text_cursor)
virtual void finalizeWidget(MainControl &main_control)
bool keyPressed(QKeyEvent *e)
virtual void printCursorPosition_()
virtual void fetchPreferences(INIFile &inifile)
BALL_DEPRECATED void showDocumentation()
virtual void createScript_()
void checkMenu(MainControl &main_control)
void appendText(const String &text, bool output=false, bool state_message=false)
QComboBox * getCompletionBox_()
std::list< Hotkey >::iterator findKey_(Hotkey &hotkey)
virtual BALL_DEPRECATED void showHelp_()
bool isInDirectMode() const
BALL_DEPRECATED void createMenuHelpEntry_(QMenu *, TextEditorWidget *, const QPoint &)
void setError_(bool state)
void appendToHistory_(const String &line)
virtual bool openFile(const String &filename)
virtual void startInterpreter()
void insertHotkey(const Hotkey &hotkey)
virtual void applyPreferences()
bool getClassAndMember_(String toc)
void findError_(String result)
PythonHighlighter highlighter_1_
BALL_DEPRECATED void showClassDocu(String, String)
PythonSettings * python_settings_
void initializePreferencesTab(Preferences &preferences)
void reactTo(const QKeyEvent &e)
Position history_position_