classpetanque::Editor
sys::Obj fwt::Widget fwt::Canvas petanque::Panel petanque::Editor
Editor is the canvas used to display and edit syntax color coded text.
- caret
Pos caret()
Get current caret position
- colCount
virtual override Int colCount()
Number of columns
- colw
virtual const override Int colw
Width of each column
- docEndPos
Pos docEndPos()
Position of document end
- findNext
Pos? findNext(Str s, Pos? last, Bool matchCase)
Find the specified string in the document starting the search at the document offset and looking forward. Return null is not found. Note we don't currently support searching across multiple lines.
- goto
Move caret and scroll to the given position and ensure editor is focused
- highlights
Span[] highlights := Span[,]
List of spans to highligh in the document
- line
Get line string for given zero based line number
- lineCount
virtual override Int lineCount()
Number of lines
- lineh
virtual const override Int lineh
Height of each line
- load
Load the document from the given input stream
- loadLines
Load from lines already parsed into memory
- make
new make(|This? f := null)
It-block constructor
- modify
Void modify(Span span, Str newText)
Remove text between span and/or insert new given text at that position. Return new position of end of inserted text.
- onCaret
EventListeners onCaret()
Callback when the caret position is modified.
- onModify
EventListeners onModify()
Callback when the text is modified.
- onPaintBackground
- onPaintLines
- options
const EditorOptions options := EditorOptions.<ctor>()
Options defines alll the colors, styling, key bindings
- ro
const Bool ro := false
Is editor read only
- rules
const SyntaxRules rules := ...
Syntax rules to use for color coding
- save
Save the document to the given output stream
- selection
Span? selection
Current selection or null for no selection
- textForSpan
Get text for the given span