TextView
class TextView: NSTextView
The text view for the editor
-
The delegate for the ChordProEditor
Declaration
Swift
var chordProEditorDelegate: ChordProEditorDelegate?
-
The parent
Declaration
Swift
var parent: ChordProEditor?
-
The parsed song lines
Declaration
Swift
var lines: [Song.Section.Line] = []
-
The current line at the cursor
Declaration
Swift
var currentLine = Song.Section.Line()
-
The optional arguments of the current directive
Declaration
Swift
var currentDirectiveArguments = ChordProParser.Arguments()
-
The range of the current line
Declaration
Swift
var currentLineRange: NSRange = .init()
-
The rect of the current paragraph
Declaration
Swift
var currentParagraphRect: NSRect?
-
The optional double-clicked directive in the editor
Declaration
Swift
var clickedDirective: Bool = false
-
The selected text in the editor
Declaration
Swift
var selectedText: String
-
Draw a background behind the current fragment
Declaration
Swift
override func draw(_ dirtyRect: CGRect)
Parameters
dirtyRect
The current rect of the editor
-
Handle double-click on directives to edit them
Declaration
Swift
override func mouseDown(with event: NSEvent)
Parameters
event
The mouse click event
-
Set the selection to the characters in an array of ranges in response to user action
Declaration
Swift
override func setSelectedRange( _ charRange: NSRange, affinity: NSSelectionAffinity, stillSelecting stillSelectingFlag: Bool )
-
Replace the whole text with a new text
Declaration
Swift
func replaceText(text: String)
Parameters
text
The replacement text
-
Get the parsed current line
Declaration
Swift
func getCurrentLine(lineNumber: Int) -> Song.Section.Line
Parameters
lineNumber
The current line number
Return Value
The parsed current line
-
Set the fragment information
Declaration
Swift
func setFragmentInformation(selectedRange: NSRange)
Parameters
selectedRange
The current selected range of the text editor