GraffitiSyntaxEditor

Preview #

About #

GraffitiSyntaxEditor is a full featured code and text editor component with support for 34 themes, 143 languages (modes), and the following features:

  • Custom Mode Support
  • Custom Theme Support
  • Annotations
  • Breakpoints
  • Single-Line Comment Toggling
  • Block Comment Toggling
  • Built-In Find/Replace
  • Code Folding
  • Single or Multiple Line Indent
  • Selection Modification (Duplication, Lowercase, Number alterations, Move, Split, Transpose by Line, Transpose Characters, Uppercase, By Word)
  • Built-In GoTo by Line Number
  • Undo Stack
  • Code Matching Highlight
  • Autocomplete
  • File Drop Loading
  • Visible Margins
  • Soft or Hard Tabs
  • Tab Size Setting
  • Optional Word Wrap

Enumerations #

NameValues
AnnotationTypesInfo = 0
Warning = 1
Error = 2
ThemesAmbiance = 0
Chaos = 1
Chrome = 2
Clouds = 3
CloudsMidnight = 4
Cobalt = 5
CrimsonEditor = 6
Dawn = 7
Dreamweaver = 8
Eclipse = 9
GitHub = 10
IdleFingers = 11
iPlastic = 12
Katzenmilch = 13
KRTheme = 14
Kuroir = 15
Merbivore = 16
MerbivoreSoft = 17
MonoIndustrial = 18
Monokai = 19
PastelOnDark = 20
SolarizedDark = 21
SolarizedLight = 22
SQLServer = 23
Terminal = 24
TextMate = 25
Tomorrow = 26
TomorrowNight = 27
TomorrowNightBlue = 28
TomorrowNightBright = 29
TomorrowNightEighties = 30
Twilight = 31
VibrantInk = 32
XCode = 33
Custom = 34
ModesABAP = 0
ABC = 0
ActionScript = 1
ADA = 2
ApacheConf = 3
AppleScript = 4
ASCIIDoc = 5
AssemblyX86 = 6
AutoHotKey = 7
BatchFile = 8
Bro = 9
C_CPP = 10
C9Search = 11
Cirru = 12
Clojure = 13
Cobol = 14
CoffeeScript = 15
ColdFusion = 16
CSharp = 17
CSS = 18
Curly = 19
D = 20
Dart = 21
Diff = 22
Django = 23
DockerFile = 24
Dot = 25
Drools = 26
Eiffel = 27
EJS = 28
Elixir = 29
Elm = 30
ERLang = 31
Forth = 32
Fortran = 33
FTL = 34
GCode = 35
Gherkin = 36
GitIgnore = 37
GLSL = 38
Gobstones = 39
GOLang = 40
Groovy = 41
HAML = 42
Handlebars = 43
Haskell = 44
HaskellCabal = 45
Haxe = 46
HJSON = 47
HTML = 48
HTMLElixir = 49
HTMLRuby = 50
INI = 51
IO = 52
Jack = 53
Jade = 54
Java = 55
JavaScript = 56
JSON = 57
JSONIQ = 58
JSP = 59
JSX = 60
Julia = 61
Kotlin = 62
LaTeX = 63
Lean = 64
LESS = 65
Liquid = 66
LISP = 67
Live_Script = 68
LiveScript = 69
LogIQL = 70
LSL = 71
LUA = 72
LUAPage = 73
Lucene = 74
MakeFile = 75
Markdown = 76
Mask = 77
MatLab = 78
Maze = 79
Mel = 80
MIPS_Assembler = 81
MIPSAssembler = 82
MushCode = 83
MySQL = 84
Nix = 85
NSIS = 86
ObjectiveC = 87
OCAML = 88
Pascal = 89
Perl = 90
PGSQL = 91
PHP = 92
PlainText = 93
PowerShell = 94
Praat = 95
Prolog = 96
Properties = 97
Protobuf = 98
Python = 99
R = 100
Razor = 101
RDoc = 102
RHTML = 103
RST = 104
Ruby = 105
Rust = 106
SASS = 107
SCAD = 108
Scala = 109
Scheme = 110
SCSS = 111
SH = 112
SJS = 113
Smarty = 114
Snippets = 115
SoyTemplate = 116
Space = 117
SQL = 118
SQLServer = 119
Stylus = 120
SVG = 121
Swift = 122
Swig = 123
TCL = 124
Tex = 125
Text = 126
Textile = 127
TOML = 128
TSX = 129
Twig = 130
TypeScript = 131
Vala = 132
VBScript = 133
Velocity = 134
Verilog = 135
VHDL = 136
Wollok = 137
XML = 138
Xojo = 139
XQuery = 140
YAML = 141
Custom = 142

Constants #

NameTypeValue
  This class exposes no constants.

Events #

DefinitionDescription
BreakpointAdded( Row as Integer )Breakpoint has been added by the user.
BreakpointRemoved( Row as Integer )Breakpoint has been removed by the user.
Change()Text content has changed.
FileDropped(Name as String, Content as String)The user has dropped a file on the component.
FoldAdded(startRow as Integer, endRow as Integer)Raised when the user folds a code block.
FoldRemoved(startRow as Integer, endRow as Integer)Raised when the user unfolds a code block.
SelChange()Selected text has changed.
UIReady()Raised when loading has completed.

Methods #

NameParametersReturn TypeDescription
AddAnnotationLine as IntegerNoneAdds an annotation to the right-hand gutter.
theText as String
AnnotationType as AnnotationTypes
AddBreakpointLine as IntegerNoneAdds a breakpoint.
AddModemodeName as StringNoneAdds the specified mode to the component. modeSource should be the JavaScript source of the mode to add.
modeSource as String
AddThemethemeName as StringNoneAdds the specified theme to the component. themeSource should be the JavaScript source of the theme to add.
themeSource as String
CenterSelectionNoneNoneCenters the currently selected text in the viewport.
ClearAnnotationsNoneNoneRemove all annotations.
ClearBreakpointsNoneNoneRemove all breakpoints.
ClearHistoryNoneNoneFlush Undo/Redo buffers.
CommentBlockToggleNoneNoneToggle block commenting of the current selection.
CommentToggleNoneNoneToggle single commenting of the current selection.
CopyNoneNoneCopies the currently selected text to the clipboard.
DeleteNoneNoneDeletes the currently selected text from the content.
DeselectAllNoneNoneDeselect all text.
FindtoFind as StringNoneSearch for toFind in the text.
Backwards as Boolean = False
Wrap as Boolean = False
CaseSensitive as Boolean = False
WholeWord as Boolean = False
FindAlltoFind as StringNoneFind all instances of toFind in the text.
FindNextNoneNoneFinds the next instance of the text. Requires there first be a Find call.
FindPrevNoneNoneFinds the previous instance of the text. Requires there first be a Find call.
FoldNoneNoneFolds the currently selected block.
FoldAllNoneNoneFolds all blocks in the document.
GetFoldsNoneDictionary()Returns all currently folded block coordinates.
GetLineLine as Integer as StringNoneGet full line text.
GotoLineLine as IntegerNoneGo to the specified line within the text.
GotoPageDownNoneNoneGo to line one page below current selection.
GotoPageUpNoneNoneGo to line one page above current selection.
IndentNoneNoneIndent the current line.
InsertLinesnewLines() as StringNoneInsert lines at selection.
InsertTexttheText as StringNoneInsert theText at current selection.
IsBreakpointRow as IntegerBooleanDetermine if the specified row has a breakpoint assigned.
IsRowFoldedRow as IntegerBooleanReturns whether the specified row is within a currently folded code block.
LoaderHideNoneNoneHides the loading spinner.
LoaderShowNoneNoneShows a loading spinner that covers the entire component.
MatchingExpandToNoneNoneExpands the current selection within matching blocks.
MatchingJumpToNoneNoneMoves the cursor to the matching block element corresponding to the current selection.
NavigateDownbyLines as IntegerNoneMove the cursor down.
NavigateEndNoneNoneMove the cursor to the end of the document.
NavigateLeftbyCharacters as IntegerNoneMove the cursor left by the specified number of characters.
NavigateLineEndNoneNoneMove cursor to the end of the line.
NavigateLineStartNoneNoneMove cursor to the start of the line.
NavigateRightbyCharacters as IntegerNoneMove the cursor right by the specified number of characters.
NavigateStartNoneNoneMove the cursor to the start of the document.
NavigateToRow as IntegerNoneMove cursor to specified position.
Column as Integer
NavigateUpbyLines as IntegerNoneMove the cursor up by the specified number of lines.
NavigateWordLeftNoneNoneMove cursor one word to the left.
NavigateWordRightNoneNoneMove cursor one word to the right.
OutdentNoneNoneRemove an indent from the current line.
PasteNoneNonePastes the clipboard text in to the content at the current cursor position.
RedoNoneNoneRedo an undone change.
RemoveAnnotationLine as IntegerNoneRemoves an annotation from the specified line.
RemoveBreakpointLine as IntegerNoneRemoves a breakpoint from the specified line.
ReplacereplaceWith as StringNoneReplaces instance with replaceWith. Requires Find or FindAll to be called first.
ReplaceAllreplaceWith as StringNoneReplaces all instances with replaceWith. Requires Find or FindAll to be called first.
SelectAllNoneNoneSelect all text in the document.
SelectDownNoneNoneSelects down one line.
SelectionDuplicateNoneNoneDuplicates the currently selected text within the document.
SelectionCopyLinesDownNoneNoneCopies the currently selected content on to the following line.
SelectionCopyLinesUpNoneNoneCopies the currently selected content on to the preceding line.
SelectionModifyNumberDelta as IntegerNoneModifies the currently selected number adding Delta.
SelectionMoveLinesDownNoneNoneMoves the selected text down one line.
SelectionMoveLinesUpNoneNoneMoves the selected text up one line.
SelectionSplitLineNoneNoneSplits the current line at the cursor position.
SelectionToLowercaseNoneNoneConverts the current selection to lowercase.
SelectionToUppercaseNoneNoneConverts the current selection to uppercase.
SelectionTransposeNoneNoneReverses the order of the currently selected lines.
SelectionTransposeLetterNoneNoneReverses the order of the currently selected characters in the document.
SelectLineNoneNoneSelect entire current line.
SelectPageUpNoneNoneSelects the previous page of content.
SelectPageDownNoneNoneSelects the next page of document.
SelectToStartNoneNoneSelects all content from the current cursor position to the beginning of the document.
SelectToEndNoneNoneSelects all content from the current cursor position to the end of the document.
SelectUpNoneNoneSelects up one line.
SelectWordNoneNoneSelect word that the cursor currently resides in.
SelectWordLeftNoneNoneSelect word to the immediate left of the cursor.
SelectWordRightNoneNoneSelect word to the immediate right of the cursor.
ShowFindNoneNoneShows the built-in find panel.
ShowReplaceNoneNoneShows the built-in replace panel.
ShowGotoLinePromptText as String = “Enter line number: ”NoneShows the built-in “Go to Line” panel.
ShowSettingsMenu DEBUG ONLYNoneNoneShow a panel containing current control settings. Changes here are not reflected in the control’s properties.
ShowShortcutsMenuNoneNoneShows a panel containing a list of the default keyboard shortcuts for the editor.
UndoNoneNoneReverse a change.
UnfoldNoneNoneUnfolds the currently selected block.
UnfoldAllNoneNoneUnfolds all folded blocks in the document.

Properties #

NameTypeDefault ValueDescription
AutoCompleteBooleanTrueWhen True, the editor will show a popup with suggestions while typing.
CanRedoBooleanFalseIf true, there are actions in the history which can be redone.
CanUndoBooleanFalseIf true, there are actions in the history which can be undone.
CurrentColumnInteger(ReadOnly)0Current column of the cursor within the document.
CurrentLineInteger(ReadOnly)0Current line of the cursor within the document.
FadeFoldWidgetsBooleanTrueWhen True, fold widgets will fade out when the block is not hovered.
FileDropAllowedBooleanTrueWhen True, users can drop files on the component in an attempt to load them into the editor.
FileDropCaptionString“Drop file to load”Text displayed in the file drop capture interface.
FileDropCaptionWorkingString“Loading File…”Text displayed in the file drop capture interface while a file is being read.
FontFamilyString“monospace”Sets the editor to use the provided HTML-supported font family.
FontSizeInteger12Size of the font used to display text in the viewport.
IsDirtyBooleanFalseWhen True, the Xojo properties of the component may not yet reflect the true values. Wait for IsDirty = True before saving.
ModeNameString“”When Mode = Custom, this will select the mode supplied via AddMode.
ModesModesModes.ABAPCurrent syntax mode, or language, of the control.
PrintMarginColumnInteger80Width of the print margin in pixels.
SelLengthInteger0Length of current selection.
SelStartInteger0Starting point of current selection.
SelTextString“”Currently selected text.
ShowFoldWidgetBooleanTrueWhen True, disclosure triangles are drawn in the left gutter for blocks.
ShowGutterBooleanTrueControls display of the left-hand line number and breakpoint gutter.
ShowInvisibleBooleanFalseWhen True, invisible characters are made visible in the viewport.
ShowLoaderOnEventsBooleanFalseIf true, the loading spinner will be shown to denote that the control is busy when communicating.
ShowPrintMarginBooleanTrueWhen True, the print margin is displayed on the right side.
TabSizeInteger4Length, in characters, of an indent/outdent/tab.
TextString“”Text content of the editor.
ThemeThemesThemes.AmbianceThe visual style of the editor, including colors for syntax hightlighting.
ThemeNameString“”Custom theme to apply.
WordWrapBooleanFalseWhen true long lines will wrap down the next line.

Examples #

There are currently no examples for this class.