import{_ as t,a as o,b as a,ag as r}from"./chunks/framework.BcrMLAmg.js";const m=JSON.parse('{"title":"ComboBox","description":"","frontmatter":{},"headers":[],"relativePath":"references/elements/ComboBox.md","filePath":"references/elements/ComboBox.md","lastUpdated":1757846084000}'),d={name:"references/elements/ComboBox.md"};function l(n,e,h,b,s,c){return a(),o("div",null,e[0]||(e[0]=[r('
This is the ComboBox class. It extends the dropdown functionality with editable text input,allowing users to either select from a list or type their own custom text.
Extends: DropDown
| Property | Type | Default | Description |
|---|---|---|---|
| editable | boolean | true | Whether the ComboBox allows text input |
| text | string | "" | The current text content of the ComboBox |
| cursorPos | number | 1 | The current cursor position in the text |
| viewOffset | number | 0 | The horizontal scroll offset for viewing long text |
| placeholder | string | "..." | Text to display when input is empty |
| placeholderColor | color | gray | Color of the placeholder text |
| focusedBackground | color | blue | Background color when ComboBox is focused |
| focusedForeground | color | white | Foreground color when ComboBox is focused |
| autoComplete | boolean | false | Whether to enable auto-complete filtering when typing |
| manuallyOpened | boolean | false | Whether the dropdown was manually opened (not by auto-complete) |
| Method | Returns | Description |
|---|---|---|
| ComboBox.new | ComboBox | Creates a new ComboBox instance |
| ComboBox:setText | ComboBox | Sets the text content |
| ComboBox:getText | string | Gets the text content |
| ComboBox:setEditable | ComboBox | Sets editable state |
| ComboBox:char | - | Handles character input |
| ComboBox:key | - | Handles key input |
| ComboBox:render | - | Renders the ComboBox |
| ComboBox:focus | - | Called when gaining focus |
| ComboBox:blur | - | Called when losing focus |
Creates a new ComboBox instance
ComboBox self The newly created ComboBox instanceSets the text content of the ComboBox
text string The text to setComboBox selfGets the current text content
string text The current textSets whether the ComboBox is editable
editable boolean Whether the ComboBox should be editableComboBox selfHandles character input when editable
char string The character that was typedHandles key input when editable
key number The key code that was pressedheld boolean Whether the key is being heldRenders the ComboBox
Called when the ComboBox gains focus
Called when the ComboBox loses focus
',41)]))}const x=t(d,[["render",l]]);export{m as __pageData,x as default};