| 920 | }; |
| 921 | |
| 922 | PythonShell::PythonShell(ICaptureContext &ctx, QWidget *parent) |
| 923 | : QFrame(parent), ui(new Ui::PythonShell), m_Ctx(ctx) |
| 924 | { |
| 925 | ui->setupUi(this); |
| 926 | |
| 927 | m_ThreadCtx = new CaptureContextInvoker(this, m_Ctx); |
| 928 | |
| 929 | QObject::connect(ui->lineInput, &RDLineEdit::keyPress, this, &PythonShell::interactive_keypress); |
| 930 | QObject::connect(ui->helpSearch, &RDLineEdit::keyPress, this, &PythonShell::helpSearch_keypress); |
| 931 | |
| 932 | ui->lineInput->setFont(Formatter::FixedFont()); |
| 933 | ui->interactiveOutput->setFont(Formatter::FixedFont()); |
| 934 | ui->scriptOutput->setFont(Formatter::FixedFont()); |
| 935 | ui->helpText->setFont(Formatter::FixedFont()); |
| 936 | |
| 937 | ui->lineInput->setAcceptTabCharacters(true); |
| 938 | |
| 939 | scriptEditor = new ScintillaEdit(this); |
| 940 | |
| 941 | scriptEditor->styleSetFont(STYLE_DEFAULT, Formatter::FixedFont().family().toUtf8().data()); |
| 942 | |
| 943 | scriptEditor->setMarginLeft(4.0); |
| 944 | scriptEditor->setMarginWidthN(0, 32.0); |
| 945 | scriptEditor->setMarginWidthN(1, 0.0); |
| 946 | scriptEditor->setMarginWidthN(2, 16.0); |
| 947 | scriptEditor->setObjectName(lit("scriptEditor")); |
| 948 | |
| 949 | scriptEditor->markerSetBack(CURRENT_MARKER, SCINTILLA_COLOUR(240, 128, 128)); |
| 950 | scriptEditor->markerSetBack(CURRENT_MARKER + 1, SCINTILLA_COLOUR(240, 128, 128)); |
| 951 | scriptEditor->markerDefine(CURRENT_MARKER, SC_MARK_SHORTARROW); |
| 952 | scriptEditor->markerDefine(CURRENT_MARKER + 1, SC_MARK_BACKGROUND); |
| 953 | |
| 954 | scriptEditor->autoCSetMaxHeight(10); |
| 955 | |
| 956 | scriptEditor->usePopUp(SC_POPUP_NEVER); |
| 957 | |
| 958 | scriptEditor->setContextMenuPolicy(Qt::CustomContextMenu); |
| 959 | QObject::connect(scriptEditor, &ScintillaEdit::customContextMenuRequested, this, |
| 960 | &PythonShell::editor_contextMenu); |
| 961 | |
| 962 | ConfigureSyntax(scriptEditor, SCLEX_PYTHON); |
| 963 | |
| 964 | scriptEditor->setTabWidth(4); |
| 965 | |
| 966 | scriptEditor->setScrollWidth(1); |
| 967 | scriptEditor->setScrollWidthTracking(true); |
| 968 | |
| 969 | scriptEditor->colourise(0, -1); |
| 970 | |
| 971 | QObject::connect(scriptEditor, &ScintillaEdit::modified, |
| 972 | [this](int type, int, int, int, const QByteArray &, int, int, int) { |
| 973 | if(type & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT | SC_MOD_BEFOREINSERT | |
| 974 | SC_MOD_BEFOREDELETE)) |
| 975 | { |
| 976 | scriptEditor->markerDeleteAll(CURRENT_MARKER); |
| 977 | scriptEditor->markerDeleteAll(CURRENT_MARKER + 1); |
| 978 | } |
| 979 | }); |
nothing calls this directly
no test coverage detected