# GraffitiEditor
Class Inherits GraffitiWebUIControl
## About
GraffitiEditor is an advanced HTML WYSIWYG editor. Supports many HTML standard elements including images, video, audio, tables and much more. Completely customizable toolbar, and beautiful Light/Dark mode auto-switching.
## Preview

Previous
Next
## Warnings
### HTML Content Support
HTML supplied to GraffitiEditor may not render entirely as expected if it did not originate from GraffitiEditor.
Conversion of this HTML to match the expected formatting is attempted, but may produce unexpected results.
Support for these incongruities is not provided.
### Linux Support
Support varies by Linux distribution and installed libwebkit library and version.
### Windows Support
Requires the presence of an HTMLViewer on a window or container within the project.
## Compatibility
### Framework API Version
| 1.0 | 2.0 |
| :---: | :---: |
| True | True |
### Desktop
| 32-Bit | 64-Bit |
| :---: | :---: |
| True | True |
## Attributes
| Name | Value |
| --- | --- |
| DefaultEvent | "Changed" |
## Enumerations
| Name | Value | Description |
| --- | :---: | --- |
| HorizontalRuleStyles | Solid <br> Dotted <br> Dashed | Possible drawing styles for Horizontal Rules. |
| Languages | EN <br> CKB <br> DA <br> DE <br> ES <br> FR <br> HE <br> IT <br> JA <br> KO <br> LV <br> NL <br> PL <br> PT <br> RO <br> RU <br> SE <br> UA <br> ZH | Supported languages. |
| Views | WYSIWYG <br> Code | Supported view types. |
## Event Definitions
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Changed | (None) | (None) | Raised when the content has been changed by the user. |
| Closing | (None) | (None) | |
| CustomButtonPressed | button as GraffitiEditorToolbarButton | (None) | Raised when a GraffitiEditorToolbarButton that has been added to the toolbar is pressed. |
| CustomMenuSelected | menu as GraffitiEditorToolbarMenu <br> value as String | (None) | Raised when the user selects an item from a GraffitiEditorToolbarMenu that has been added to the toolbar. |
| FocusLost | (None) | (None) | |
| FocusReceived | (None) | (None) | |
| Opening | (None) | (None) | |
| Ready | (None) | (None) | Raised when the component is fully displayed and ready. |
| SaveButtonPressed | (None) | (None) | Raised when the user clicks the Save button, if the Save button is currently on the toolbar. |
| SelectionChanged | (None) | (None) | Raised when the user has changed the selected text/elements. |
| ShortcutPressed | shortcut as GraffitiEditorShortcut | (None) | Raised when the user presses a registered keyboard shortcut. |
| ViewChanged | (None) | (None) | Raised when the user switches between the WYSIWYG and Code views. |
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Function | AllowedTags | As | Returns any custom HTML tags that have been aded to be supported in the editor. |
| Sub | AllowedTags | (None) | Returns any custom HTML tags that have been aded to be supported in the editor. |
| Sub | Append | (None) | Appends the provided HTML to the content of the editor. |
| Sub | Constructor | (None) | Creates a new instance of the class. |
| Function | DisallowedTags | As | Returns any HTML tags that have been forbidden to be used in the editor. |
| Sub | DisallowedTags | (None) | Returns any HTML tags that have been forbidden to be used in the editor. |
| Sub | Focus | (None) | Forces focus to the editor area. |
| Function | FormattedHTML | As | Returns the HTML content of the editor in a formatted representation. |
| Sub | HideHelpers | (None) | Hides any visible popup menus and element editors. |
| Function | HTMLInline | As | Returns the HTML content with styles inlined. |
| Sub | Insert | (None) | Inserts the provided HTML as the current selection point of the editor. |
| Sub | InsertAudio | (None) | Inserts an AUDIO element at the current selection point of the editor. |
| Sub | InsertHorizontalRule | (None) | Inserts an HR element at the current selection point of the editor. |
| Sub | InsertImage | (None) | Inserts the specified image at the current selection point of the editor. |
| Sub | InsertImage | (None) | Inserts the specified image at the current selection point of the editor. |
| Sub | InsertLink | (None) | Inserts a link at the current selection point of the editor. |
| Sub | InsertTable | (None) | Inserts a table at the current selection point of the editor. |
| Sub | InsertVideo | (None) | Inserts a VIDEO element at the current selection point of the editor. Attempts to automatically parse YouTube and Vimeo links. |
| Sub | Print | (None) | Launches a print preview, allowing users to print the content. |
| Sub | RegisterShortcut | (None) | Registers a shortcut key combination to raise the ShortcutPressed event when the editor has focus. |
| Sub | SetFocus | (None) | Sets focus to the editor area. |
| Sub | ShowAudioModal | (None) | Shows the in-editor audio modal. |
| Sub | ShowImageModal | (None) | Shows the in-editor image modal. |
| Sub | ShowLinkModal | (None) | Shows the in-editor link modal. |
| Sub | ShowVideoModal | (None) | Shows the in-editor video modal. |
| Function | Stylesheet | As | Returns the base stylesheet to be used for display outside the control. |
| Function | ToPage | As | Creates a valid HTML page complete with headers using the current content of the editor. |
| Attributes | Hidden = True | updateFonts | |
| Attributes | Hidden = True | updateLineHeights | |
| Attributes | Hidden = True | updateParagraphStyles | |
| Attributes | Hidden = True | updateTags | |
| Attributes | Hidden = True | updateTemplates | |
| Attributes | Hidden = True | updateTextStyles | |
| Attributes | Hidden = True | updateToolbar | |
| Attributes | Deprecated | ZoomReset | |
| Attributes | Deprecated | ZoomText | |
| Attributes | Deprecated | ZoomTextIn | |
| Attributes | Deprecated | ZoomTextOut | |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| Alert | GraffitiEditorAlert | Nil | Access to Alert functionality. |
| AllowMediaUploads | Boolean | Nil | When False, pasting media will be disabled. |
| AllowStyleChangesOnly | Boolean | Nil | Denies attempts to editor text content by using the keyboard or mouse. |
| Autocorrect | Boolean | Nil | |
| CustomCSS | String | Nil | Custom CSS string to apply to the view. |
| Enabled | Boolean | Nil | Determines whether the user can interact with the component's toolbar or change its contents. |
| Fonts | GraffitiEditorFonts | Nil | Access to font management functionality. |
| History | GraffitiEditorHistory | Nil | Access to editor history functionality. |
| HTML | String | Nil | Current value of the editor. |
| Locale | Languages | Nil | Language used to display the toolbar tooltips. |
| Padding | Integer | Nil | Pixel size of the editor's padding. |
| Private | As | = | |
| Private | As | Nil | |
| Private | As | = | |
| Private | As | = | |
| Private | As | = | |
| Private | As | Nil | |
| Private | As | = | |
| Private | As | = | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | = | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | | GraffitiEditorShortcut | |
| Private | As | = | |
| Private | | String | |
| Private | | String | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | = | |
| Private | As | = | |
| Private | As | Nil | |
| Private | As | = | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| Private | As | Nil | |
| ReadOnly | Boolean | Nil | Determines whether the user can interact with the component's toolbar or change its contents without significantly altering its appearance. |
| RTL | Boolean | Nil | Right-to-left display. |
| Selection | GraffitiEditorSelection | Nil | Access to Selection functionality. |
| SpellCheck | Boolean | Nil | When True, spell checking will be enabled on the component. |
| SpellCheckLanguage | String | Nil | Locale to use for checking spelling. |
| State | GraffitiEditorState | Nil | Access to state functionality. |
| Styles | GraffitiEditorStyles | Nil | Access to custom Styles functionality. |
| Templates | GraffitiEditorTemplates | Nil | Access to Templates functionality. |
| Toolbar | GraffitiEditorToolbar | Nil | Access to Toolbar functionality. |
| View | Views | Nil | Current editor view. |