|
Krita Source Code Documentation
|
Inheritance diagram for scripter.ui_scripter.editor.pythoneditor.CodeEditor:Public Member Functions | |
| __init__ (self, scripter, parent=None) | |
| autoindent (self) | |
| debugAreaPaintEvent (self, event) | |
| debugAreaWidth (self) | |
| dedent (self) | |
| dedentBlock (self, blockNumber) | |
| font (self) | |
| font (self, font="Monospace") | |
| highlightCurrentLine (self) | |
| indent (self) | |
| isEmptyBlock (self, blockNumber) | |
| keyPressEvent (self, e) | |
| lineNumberAreaPaintEvent (self, event) | |
| lineNumberAreaWidth (self) | |
| repaintDebugArea (self) | |
| resizeEvent (self, event) | |
| setDocumentModified (self, changed=False) | |
| setFontSize (self, size=10) | |
| setStepped (self, status) | |
| toggleComment (self) | |
| updateLineNumberArea (self, rect, dy) | |
| updateMarginsWidth (self) | |
| wheelEvent (self, e) | |
Public Attributes | |
| debugArea | |
| debugArrow | |
| font | |
| highlightCurrentLine | |
| indent_width | |
| lineNumberArea | |
| scripter | |
| setDocumentModified | |
| updateLineNumberArea | |
| updateMarginsWidth | |
Static Public Attributes | |
| int | DEBUG_AREA_WIDTH = 20 |
Protected Attributes | |
| _documentChanged | |
| _documentModified | |
| _font | |
| _stepped | |
Definition at line 37 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.__init__ | ( | self, | |
| scripter, | |||
| parent = None ) |
Definition at line 41 of file pythoneditor.py.
References scripter.ui_scripter.editor.pythoneditor.CodeEditor.__init__(), KisPipeBrushParasite.dim, KisSpinBoxUnitManager.dim, FlattenSpec.dim, and xcfLayer.dim.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.autoindent | ( | self | ) |
The return key has just been pressed (and processed by the editor)
now insert leading spaces to reflect an appropriate indent level
against the previous line.
This will depend on the end of the previous line. If it ends:
* with a colon (:) then indent to a new indent level
* with a comma (,) then this is an implied continuation line, probably
in the middle of a function's parameter list
- look for last open bracket on previous line (, [ or {
- if found indent to that level + one character,
- otherwise use previous line whitespace, this is probably a list or
parameter list so line up with other elements
* with a backslash (\) then this is a continuation line, probably
on the RHS of an assignment
- similar rules as for comma, but if there is an = character
use that plus one indent level if that is greater
* if it is an open bracket of some sort treat similarly to comma
* anything else - a new line at the same indent level. This will preserve
the indent level of whitespace lines. User can shift-tab to dedent
as necessary
Definition at line 278 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.debugAreaPaintEvent | ( | self, | |
| event ) |
Definition at line 138 of file pythoneditor.py.
References scripter.ui_scripter.editor.pythoneditor.CodeEditor._stepped, scripter.ui_scripter.editor.pythoneditor.CodeEditor.debugArea, scripter.ui_scripter.editor.pythoneditor.CodeEditor.debugAreaWidth(), scripter.ui_scripter.editor.pythoneditor.CodeEditor.debugArrow, KisPipeBrushParasite.dim, KisSpinBoxUnitManager.dim, FlattenSpec.dim, xcfLayer.dim, KoTextShapeDataBase.document(), KoShapeAnchor::TextLocation.document(), KoTextShapeDataBasePrivate.document, krita::Document::Private.document, Document.document(), View.document(), KisAslXmlWriter::Private.document, KisAslXmlWriter.document(), KisAnimationImporter::Private.document, KisCloneDocumentStroke.document, KisDecorationsWrapperLayer::Private.document, KisDecorationsWrapperLayer.document(), KisView.document, KisView.document(), KisViewManager.document(), KoItemToolTip.document, KisTimeBasedItemModel::Private.document, KisTimeBasedItemModel.document(), krita.sceditor.highlighter.PythonHighlighter.document, KisKraLoader::Private.document, scripter.ui_scripter.syntax.syntax.PythonHighlighter.document, ToolReferenceImages.document(), scripter.debugcontroller.DebugController.scripter, scripter.debugger_scripter.debugger.Debugger.scripter, scripter.ui_scripter.actions.closeaction.closeaction.CloseAction.scripter, scripter.ui_scripter.actions.debugaction.debugaction.DebugAction.scripter, scripter.ui_scripter.actions.newaction.newaction.NewAction.scripter, scripter.ui_scripter.actions.openaction.openaction.OpenAction.scripter, scripter.ui_scripter.actions.reloadaction.reloadaction.ReloadAction.scripter, scripter.ui_scripter.actions.runaction.runaction.RunAction.scripter, scripter.ui_scripter.actions.saveaction.saveaction.SaveAction.scripter, scripter.ui_scripter.actions.saveasaction.saveasaction.SaveAsAction.scripter, scripter.ui_scripter.actions.settingsaction.settingsaction.SettingsAction.scripter, scripter.ui_scripter.actions.settingsaction.settingsdialog.SettingsDialog.scripter, scripter.ui_scripter.editor.pythoneditor.CodeEditor.scripter, scripter.ui_scripter.tabwidgets.debuggerwidget.debuggerwidget.DebuggerWidget.scripter, scripter.ui_scripter.tabwidgets.debuggerwidget.stepaction.StepAction.scripter, scripter.ui_scripter.tabwidgets.debuggerwidget.stopaction.StopAction.scripter, scripter.ui_scripter.tabwidgets.outputwidget.clearaction.ClearAction.scripter, scripter.ui_scripter.tabwidgets.outputwidget.outputwidget.OutPutWidget.scripter, and scripter.uicontroller.UIController.scripter.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.debugAreaWidth | ( | self | ) |
Definition at line 65 of file pythoneditor.py.
References scripter.ui_scripter.editor.pythoneditor.CodeEditor.DEBUG_AREA_WIDTH.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.dedent | ( | self | ) |
Definition at line 262 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.dedentBlock | ( | self, | |
| blockNumber ) |
Definition at line 246 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.font | ( | self | ) |
Definition at line 386 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.font | ( | self, | |
| font = "Monospace" ) |
Definition at line 390 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.highlightCurrentLine | ( | self | ) |
Highlight current line under cursor
Definition at line 154 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.indent | ( | self | ) |
Definition at line 213 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.isEmptyBlock | ( | self, | |
| blockNumber ) |
test whether block with number blockNumber contains any non-whitespace If only whitespace: return true, else return false
Definition at line 197 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.keyPressEvent | ( | self, | |
| e ) |
Definition at line 183 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.lineNumberAreaPaintEvent | ( | self, | |
| event ) |
This method draws the current lineNumberArea for while
Definition at line 112 of file pythoneditor.py.
References KisPipeBrushParasite.dim, KisSpinBoxUnitManager.dim, FlattenSpec.dim, xcfLayer.dim, KoFontRegistry.fontMetrics(), scripter.ui_scripter.editor.pythoneditor.CodeEditor.lineNumberArea, krita::Palette::Private.palette, KisDlgPaletteEditor.palette(), DlgLayerSplit.palette(), KisFilterPalettizeConfiguration.palette(), KisFilterPalettizeConfiguration.palette(), and palette_docker.palette_sortColors.sortColors.palette().
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.lineNumberAreaWidth | ( | self | ) |
The lineNumberAreaWidth is the quatity of decimal places in blockCount
Definition at line 68 of file pythoneditor.py.
References KisPipeBrushParasite.dim, KisSpinBoxUnitManager.dim, FlattenSpec.dim, xcfLayer.dim, and KoFontRegistry.fontMetrics().
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.repaintDebugArea | ( | self | ) |
Definition at line 400 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.resizeEvent | ( | self, | |
| event ) |
Definition at line 80 of file pythoneditor.py.
References scripter.ui_scripter.editor.pythoneditor.CodeEditor.debugArea, scripter.ui_scripter.editor.pythoneditor.CodeEditor.debugAreaWidth(), KisPipeBrushParasite.dim, KisSpinBoxUnitManager.dim, FlattenSpec.dim, xcfLayer.dim, scripter.ui_scripter.editor.pythoneditor.CodeEditor.lineNumberArea, scripter.ui_scripter.editor.pythoneditor.CodeEditor.lineNumberAreaWidth(), and scripter.ui_scripter.editor.pythoneditor.CodeEditor.resizeEvent().
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.setDocumentModified | ( | self, | |
| changed = False ) |
Definition at line 404 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.setFontSize | ( | self, | |
| size = 10 ) |
Definition at line 394 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.setStepped | ( | self, | |
| status ) |
Definition at line 397 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.toggleComment | ( | self | ) |
Toggle lines of selected text to/from either comment or uncomment selected text is obtained from text cursor If selected text contains both commented and uncommented text this will flip the state of each line - which may not be desirable.
Definition at line 341 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.updateLineNumberArea | ( | self, | |
| rect, | |||
| dy ) |
This slot is invoked when the editors viewport has been scrolled
Definition at line 100 of file pythoneditor.py.
References scripter.ui_scripter.editor.pythoneditor.CodeEditor.debugArea, KisPipeBrushParasite.dim, KisSpinBoxUnitManager.dim, FlattenSpec.dim, xcfLayer.dim, scripter.ui_scripter.editor.pythoneditor.CodeEditor.lineNumberArea, scripter.ui_scripter.editor.pythoneditor.CodeEditor.updateMarginsWidth, and scripter.ui_scripter.editor.pythoneditor.CodeEditor.updateMarginsWidth().
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.updateMarginsWidth | ( | self | ) |
Definition at line 97 of file pythoneditor.py.
References scripter.ui_scripter.editor.pythoneditor.CodeEditor.debugAreaWidth(), KisPipeBrushParasite.dim, KisSpinBoxUnitManager.dim, FlattenSpec.dim, xcfLayer.dim, and scripter.ui_scripter.editor.pythoneditor.CodeEditor.lineNumberAreaWidth().
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.wheelEvent | ( | self, | |
| e ) |
When the CTRL is pressed during the wheelEvent, zoomIn and zoomOut slots are invoked
Definition at line 171 of file pythoneditor.py.
|
protected |
Definition at line 60 of file pythoneditor.py.
|
protected |
Definition at line 405 of file pythoneditor.py.
|
protected |
Definition at line 391 of file pythoneditor.py.
|
protected |
Definition at line 57 of file pythoneditor.py.
|
static |
Definition at line 39 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.debugArea |
Definition at line 48 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.debugArrow |
Definition at line 58 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.font |
Definition at line 56 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.highlightCurrentLine |
Definition at line 52 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.indent_width |
Definition at line 61 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.lineNumberArea |
Definition at line 47 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.scripter |
Definition at line 46 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.setDocumentModified |
Definition at line 63 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.updateLineNumberArea |
Definition at line 51 of file pythoneditor.py.
| scripter.ui_scripter.editor.pythoneditor.CodeEditor.updateMarginsWidth |
Definition at line 50 of file pythoneditor.py.