Files
Basalt2/docs/.vitepress/dist/assets/references_elements_TextBox.md.BO98sZYp.js
2025-09-16 17:41:40 +02:00

2 lines
6.3 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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('<h1 id="textbox" tabindex="-1">TextBox <a class="header-anchor" href="#textbox" aria-label="Permalink to &quot;TextBox&quot;"></a></h1><p><em>A multi-line text editor component with cursor support and text manipulation features</em></p><p>Extends: <code>VisualElement</code></p><h2 id="properties" tabindex="-1">Properties <a class="header-anchor" href="#properties" aria-label="Permalink to &quot;Properties&quot;"></a></h2><table tabindex="0"><thead><tr><th>Property</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td>lines</td><td>table</td><td>{}</td><td>Array of text lines</td></tr><tr><td>cursorX</td><td>number</td><td>1</td><td>Cursor X position</td></tr><tr><td>cursorY</td><td>number</td><td>1</td><td>Cursor Y position (line number)</td></tr><tr><td>scrollX</td><td>number</td><td>0</td><td>Horizontal scroll offset</td></tr><tr><td>scrollY</td><td>number</td><td>0</td><td>Vertical scroll offset</td></tr><tr><td>editable</td><td>boolean</td><td>true</td><td>Whether text can be edited</td></tr><tr><td>syntaxPatterns</td><td>table</td><td>{}</td><td>Syntax highlighting patterns</td></tr><tr><td>cursorColor</td><td>number</td><td>nil</td><td>Color of the cursor</td></tr></tbody></table><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to &quot;Functions&quot;"></a></h2><table tabindex="0"><thead><tr><th>Method</th><th>Returns</th><th>Description</th></tr></thead><tbody><tr><td><a href="#textbox-addsyntaxpattern-pattern-color">TextBox:addSyntaxPattern</a></td><td>TextBox</td><td>Adds a new syntax highlighting pattern</td></tr><tr><td><a href="#textbox-removesyntaxpattern-index">TextBox:removeSyntaxPattern</a></td><td>TextBox</td><td>Removes a syntax pattern by index (1-based)</td></tr><tr><td><a href="#textbox-clearsyntaxpatterns">TextBox:clearSyntaxPatterns</a></td><td>TextBox</td><td>Clears all syntax highlighting patterns</td></tr><tr><td><a href="#textbox-updateviewport">TextBox:updateViewport</a></td><td>TextBox</td><td>Updates the viewport to keep the cursor in view</td></tr><tr><td><a href="#textbox-settext-text">TextBox:setText</a></td><td>TextBox</td><td>Sets the text of the TextBox</td></tr><tr><td><a href="#textbox-gettext">TextBox:getText</a></td><td>string</td><td>Gets the text of the TextBox</td></tr></tbody></table><h2 id="textbox-addsyntaxpattern-pattern-color" tabindex="-1">TextBox:addSyntaxPattern(pattern, color) <a class="header-anchor" href="#textbox-addsyntaxpattern-pattern-color" aria-label="Permalink to &quot;TextBox:addSyntaxPattern(pattern, color)&quot;"></a></h2><p>Adds a new syntax highlighting pattern</p><h3 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ul><li><code>pattern</code> <code>string</code> The regex pattern to match</li><li><code>color</code> <code>number</code> The color to apply</li></ul><h3 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ul><li><code>TextBox</code> <code>self</code> The TextBox instance</li></ul><h2 id="textbox-removesyntaxpattern-index" tabindex="-1">TextBox:removeSyntaxPattern(index) <a class="header-anchor" href="#textbox-removesyntaxpattern-index" aria-label="Permalink to &quot;TextBox:removeSyntaxPattern(index)&quot;"></a></h2><p>Removes a syntax pattern by index (1-based)</p><h3 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ul><li><code>index</code> <code>number</code> The index of the pattern to remove</li></ul><h3 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ul><li><code>TextBox</code> self</li></ul><h2 id="textbox-clearsyntaxpatterns" tabindex="-1">TextBox:clearSyntaxPatterns() <a class="header-anchor" href="#textbox-clearsyntaxpatterns" aria-label="Permalink to &quot;TextBox:clearSyntaxPatterns()&quot;"></a></h2><p>Clears all syntax highlighting patterns</p><h3 id="returns-2" tabindex="-1">Returns <a class="header-anchor" href="#returns-2" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ul><li><code>TextBox</code> self</li></ul><h2 id="textbox-updateviewport" tabindex="-1">TextBox:updateViewport() <a class="header-anchor" href="#textbox-updateviewport" aria-label="Permalink to &quot;TextBox:updateViewport()&quot;"></a></h2><p>Updates the viewport to keep the cursor in view</p><h3 id="returns-3" tabindex="-1">Returns <a class="header-anchor" href="#returns-3" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ul><li><code>TextBox</code> <code>self</code> The TextBox instance</li></ul><h2 id="textbox-settext-text" tabindex="-1">TextBox:setText(text) <a class="header-anchor" href="#textbox-settext-text" aria-label="Permalink to &quot;TextBox:setText(text)&quot;"></a></h2><p>Sets the text of the TextBox</p><h3 id="parameters-2" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-2" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ul><li><code>text</code> <code>string</code> The text to set</li></ul><h3 id="returns-4" tabindex="-1">Returns <a class="header-anchor" href="#returns-4" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ul><li><code>TextBox</code> <code>self</code> The TextBox instance</li></ul><h2 id="textbox-gettext" tabindex="-1">TextBox:getText() <a class="header-anchor" href="#textbox-gettext" aria-label="Permalink to &quot;TextBox:getText()&quot;"></a></h2><p>Gets the text of the TextBox</p><h3 id="returns-5" tabindex="-1">Returns <a class="header-anchor" href="#returns-5" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ul><li><code>string</code> <code>text</code> The text of the TextBox</li></ul>',37)]))}const p=e(d,[["render",n]]);export{u as __pageData,p as default};