import{_ as e,a,b as r,ag as o}from"./chunks/framework.BcrMLAmg.js";const u=JSON.parse('{"title":"TextBox","description":"","frontmatter":{},"headers":[],"relativePath":"references/elements/TextBox.md","filePath":"references/elements/TextBox.md","lastUpdated":1757844696000}'),d={name:"references/elements/TextBox.md"};function n(x,t,s,l,i,h){return r(),a("div",null,t[0]||(t[0]=[o('

TextBox

A multi-line text editor component with cursor support and text manipulation features

Extends: VisualElement

Properties

PropertyTypeDefaultDescription
linestable{}Array of text lines
cursorXnumber1Cursor X position
cursorYnumber1Cursor Y position (line number)
scrollXnumber0Horizontal scroll offset
scrollYnumber0Vertical scroll offset
editablebooleantrueWhether text can be edited
syntaxPatternstable{}Syntax highlighting patterns
cursorColornumbernilColor of the cursor

Functions

MethodReturnsDescription
TextBox:addSyntaxPatternTextBoxAdds a new syntax highlighting pattern
TextBox:removeSyntaxPatternTextBoxRemoves a syntax pattern by index (1-based)
TextBox:clearSyntaxPatternsTextBoxClears all syntax highlighting patterns
TextBox:updateViewportTextBoxUpdates the viewport to keep the cursor in view
TextBox:setTextTextBoxSets the text of the TextBox
TextBox:getTextstringGets the text of the TextBox

TextBox:addSyntaxPattern(pattern, color)

Adds a new syntax highlighting pattern

Parameters

Returns

TextBox:removeSyntaxPattern(index)

Removes a syntax pattern by index (1-based)

Parameters

Returns

TextBox:clearSyntaxPatterns()

Clears all syntax highlighting patterns

Returns

TextBox:updateViewport()

Updates the viewport to keep the cursor in view

Returns

TextBox:setText(text)

Sets the text of the TextBox

Parameters

Returns

TextBox:getText()

Gets the text of the TextBox

Returns

',37)]))}const p=e(d,[["render",n]]);export{u as __pageData,p as default};