On this page
- API Reference
- Constants
- Macros and globals
- Enums
- Constructors and drawing
- Core ensure
- Global theme helpers (top-level functions)
- Global context menu registry (top-level functions)
QUILLmanager methods- Quill Textbox methods (
__Quillstruct returned via one of theQuill(),QuillSingle()andQuillMulti()functions)- Value and selection
- Size and drawing state
- Binding and text metadata
- Callbacks
- Focus, tab, and enabled state
- Per-textbox context menu registry
- Text transforms and filtering
SetTextAlign(align)AddTransform(fn)ClearTransforms()SetAutoTrim(flag)SetAutoUpper(flag)SetAutoLower(flag)SetReadOnly(flag)SetMaxLength(len)SetAllowedChars(chars)SetDeniedChars(chars)SetNumericOnly(flag, allow_decimal = false, allow_negative = false)SetSelectAllOnFocus(flag)SetFilterFn(fn)SetOnLiveChange(fn, rate_ms = 0)SetInputMode(mode)
- Multiline/code/password controls
SetTabInserts(flag)SetTabUsesSpaces(flag)SetTabSpaces(count)SetAutoIndent(flag)SetPasswordMask(flag, mask_char = "*", allow_copy = false)SetWrap(flag)SetFont(font_asset)SetPreferredWidth(pixels)GetPreferredWidth()SetVisibleRows(rows)GetVisibleRows()SetPreferredHeight(pixels)GetPreferredHeight()SetMinHeight(pixels)GetMinHeight()SetMaxHeight(pixels)GetMaxHeight()SetResizable(flag)IsResizable()SetShowResizeGrip(flag)IsResizeGripVisible()SetUseOverlayEditor(flag)IsUsingOverlayEditor()SetOverlayEditorTitle(title)GetOverlayEditorTitle()
- Validation
- Theme and style overrides
SetTheme(theme_or_minus_one)SetLabelFont(font)SetLabelPadding(l, t, r, b)SetLabelMargin(l, t, r, b)SetLabelTextStyle(col, alpha = 1)SetLabelBackgroundSprite(spr, subimg = 0)SetLabelBorderSprite(spr, subimg = 0)SetLabelPrimitiveBackground(col, alpha = 1)SetLabelPrimitiveBorder(col, alpha = 1, thickness = 1)SetSkinBackgroundSprite(spr, subimg = 0)SetSkinBorderSprite(spr, subimg = 0)
- Rendering
- Theme API
- Callback signatures
- Custom context menu item schema
- Notes on internal API
API Reference
This page documents Quill’s public API surface in this repository.
Callback notes:
- Bind explicit scope with
method(scope, fn)when you need instance or struct scope inside callbacks.
Constants
Core box kind
QUILL_SINGLEQUILL_MULTI
Input modes
QUILL_TEXTMODE_TEXTQUILL_TEXTMODE_INTQUILL_TEXTMODE_FLOATQUILL_TEXTMODE_IDENTIFIERQUILL_TEXTMODE_PATHQUILL_TEXTMODE_CODEQUILL_TEXTMODE_PASSWORD
QUILL_TEXTMODE_CODE uses theme.fonts.code by default when SetFont(...) is not set to a valid font.
Render/debug macros
QUILL_VB_ENABLEQUILL_VB_FREEZE_FRAMESQUILL_VB_DEBUG
Macros and globals
QUILL
Macro alias for the global manager instance.
- Definition:
#macro QUILL global.__QUILL_CORE - Notes:
QUILLis an alias ofglobal.__QUILL_CORE.- Use
QuillSetTheme(new QuillTheme())for a global style baseline.
Enums
Label enums
eQuillLabelPlacement
eQuillLabelPlacement.AboveeQuillLabelPlacement.Leading
eQuillLabelAlign
eQuillLabelAlign.StarteQuillLabelAlign.Center
eQuillLabelOverflow
eQuillLabelOverflow.WrapeQuillLabelOverflow.Ellipsis
Text align enum
eQuillTextAlign
eQuillTextAlign.LefteQuillTextAlign.CentereQuillTextAlign.Right
Constructors and drawing
Quill(kind = QUILL_SINGLE, label = "", placeholder = "")
Creates a new Quill textbox.
Arguments
kindRealCore box kind (useQUILL_SINGLEorQUILL_MULTI).labelStringOptional label text.placeholderStringOptional placeholder text.
Returns: Struct.__Quill
QuillSingle(label = "", placeholder = "")
Convenience wrapper for Quill(QUILL_SINGLE, ...).
Arguments
labelStringOptional label text.placeholderStringOptional placeholder text.
Returns: Struct.__Quill
QuillMulti(label = "", placeholder = "")
Convenience wrapper for Quill(QUILL_MULTI, ...).
Arguments
labelStringOptional label text.placeholderStringOptional placeholder text.
Returns: Struct.__Quill
QuillDrawOverlays()
Draws all overlay UI used by Quill (for example, overlay editors).
Arguments: None.
Returns: Void
QuillContextMenuItem(label = "", on_click = undefined, key = "")
Creates a context menu action item.
Arguments
labelStringMenu label.on_clickFunction|UndefinedClick callback.keyStringOptional semantic key.
Returns: Struct.__QuillContextMenuItem
QuillContextMenuSeparator(key = "")
Creates a context menu separator item.
Arguments
keyStringOptional semantic key.
Returns: Struct.__QuillContextMenuSeparator
Core ensure
QuillEnsure()
Ensures that the global manager exists.
Arguments: None.
Returns: Bool
Additional details
QuillEnsure()returnstrueif the manager already existed,falseif it was recreated.
Global theme helpers (top-level functions)
QuillSetTheme(theme)
Sets the global theme used by textboxes that do not have a per-box theme.
Arguments
themeStruct.QuillThemeTheme to apply globally.
Returns: Struct.__QuillCore
QuillGetTheme()
Gets the current global Quill theme.
Arguments: None.
Returns: Struct.QuillTheme
Global context menu registry (top-level functions)
QuillContextMenuAddItem(item)
Registers a context menu item globally.
Arguments
itemStructA plain item struct, or an item created byQuillContextMenuItem(...)/QuillContextMenuSeparator(...).
Returns: Struct
QuillContextMenuRemoveItem(key_or_uid)
Removes a globally registered context menu item.
Arguments
key_or_uidString|RealA semantic key string or an auto-assigned uid.
Returns: Bool
QuillContextMenuGetItem(key_or_uid)
Fetches a globally registered context menu item.
Arguments
key_or_uidString|RealA semantic key string or an auto-assigned uid.
Returns: Struct
QuillContextMenuClearItems()
Clears all globally registered context menu items.
Arguments: None.
Returns: Void
QUILL manager methods
In most cases, you shouldn’t need to use these. Opening and closing Context menus are handled automatically by Quill, and adding or remove global context menu items should really be done via the
QuillContextMenu*()global functions. These are simply provided for advanced use cases. Global themes can be handled viaQuillSetTheme()andQuillGetTheme()
-
QUILL.OpenContextMenu(items, x, y, owner_id)- Arguments:
itemsArray<Struct>Menu item array.xRealScreen x position.yRealScreen y position.owner_idAnyOwner identifier used to associate the menu with a textbox/owner.
- Returns:
Void
- Arguments:
-
QUILL.CloseContextMenu()- Arguments: None.
- Returns:
Void
-
QUILL.IsContextMenuOpen()- Arguments: None.
- Returns:
Bool
-
QUILL.ContextMenuAddItem(item)- Arguments:
itemStructItem struct.
- Returns:
Struct
- Arguments:
-
QUILL.ContextMenuRemoveItem(key_or_uid)- Arguments:
key_or_uidString|Real
- Returns:
Bool
- Arguments:
-
QUILL.ContextMenuGetItem(key_or_uid)- Arguments:
key_or_uidString|Real
- Returns:
Struct
- Arguments:
-
QUILL.ContextMenuClearItems()- Arguments: None.
- Returns:
Struct.__QuillCore
-
QUILL.SetTheme(theme)- Arguments:
themeStruct.QuillTheme
- Returns:
Struct.__QuillCore
- Arguments:
-
QUILL.GetTheme()- Arguments: None.
- Returns:
Struct.QuillTheme
Quill Textbox methods (__Quill struct returned via one of the Quill(), QuillSingle() and QuillMulti() functions)
All setters return Struct.__Quill unless noted, and so can be fluidly chained (i.e. tb.SetLabel("Notes").SetPlaceholder("A place for your notes").OnChange(_update_notes_func);).
Value and selection
-
GetValue()- Arguments: None.
- Returns:
String
-
SetValue(v)- Arguments:
vString
- Returns:
Void
- Arguments:
-
GetCaret()- Arguments: None.
- Returns:
Real
-
SetCaret(index, extend = false)- Arguments:
indexRealextendBoolOptional, defaults tofalse.
- Returns:
Struct.__Quill
- Arguments:
-
GetSelection()- Arguments: None.
- Returns:
Struct({ has_selection, start, _end })
-
SetSelection(start, end)- Arguments:
startRealendReal
- Returns:
Struct.__Quill
- Arguments:
-
SelectAll()- Arguments: None.
- Returns:
Struct.__Quill
Size and drawing state
These return measured values before first draw, and continue to update from textbox configuration changes.
-
GetWidth()- Arguments: None.
- Returns:
Real
-
GetHeight()- Arguments: None.
- Returns:
Real
-
GetBoxWidth()- Arguments: None.
- Returns:
Real
-
GetBoxHeight()- Arguments: None.
- Returns:
Real
Binding and text metadata
-
BindText(struct_ref, key)- Arguments:
struct_refStructkeyString
- Returns:
Struct.__Quill
- Arguments:
-
SetPlaceholder(text)- Arguments:
textString
- Returns:
Struct.__Quill
- Arguments:
-
SetLabel(text)- Arguments:
textString
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelVisible(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelPlacement(placement)- Arguments:
placementAnyUseeQuillLabelPlacement.*.
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelAlign(align)- Arguments:
alignAnyUseeQuillLabelAlign.*.
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelOverflow(overflow)- Arguments:
overflowAnyUseeQuillLabelOverflow.*.
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelOffset(pixels)- Arguments:
pixelsReal
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelWidth(width)- Arguments:
widthReal
- Returns:
Struct.__Quill
- Arguments:
Callbacks
-
OnChange(fn)- Arguments:
fnFunction
- Returns:
Struct.__Quill
- Arguments:
-
OnFocus(fn)- Arguments:
fnFunction
- Returns:
Struct.__Quill
- Arguments:
-
OnBlur(fn)- Arguments:
fnFunction
- Returns:
Struct.__Quill
- Arguments:
-
OnSubmit(fn)- Arguments:
fnFunction
- Returns:
Struct.__Quill
- Arguments:
-
OnCancel(fn)- Arguments:
fnFunction
- Returns:
Struct.__Quill
- Arguments:
Focus, tab, and enabled state
-
Focus()- Arguments: None.
- Returns:
Struct.__Quill
-
Blur()- Arguments: None.
- Returns:
Struct.__Quill
-
IsFocused()- Arguments: None.
- Returns:
Bool
-
SetTabEnabled(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
SetTabOrder(order)- Arguments:
orderReal
- Returns:
Struct.__Quill
- Arguments:
-
SetMultilineSubmitOnCtrlEnter(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
SetEnabled(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
IsEnabled()- Arguments: None.
- Returns:
Bool
Per-textbox context menu registry
-
ContextMenuAddItem(item)- Arguments:
itemStruct
- Returns:
Struct.__Quill
- Arguments:
-
ContextMenuRemoveItem(key_or_uid)- Arguments:
key_or_uidString|Real
- Returns:
Struct.__Quill
- Arguments:
-
ContextMenuGetItem(key_or_uid)- Arguments:
key_or_uidString|Real
- Returns:
Struct
- Arguments:
-
ContextMenuClearItems()- Arguments: None.
- Returns:
Struct.__Quill
Text transforms and filtering
-
SetTextAlign(align)- Arguments:
alignAnyUseeQuillTextAlign.*.
- Returns:
Struct.__Quill
- Arguments:
-
AddTransform(fn)- Arguments:
fnFunction
- Returns:
Struct.__Quill
- Arguments:
-
ClearTransforms()- Arguments: None.
- Returns:
Struct.__Quill
-
SetAutoTrim(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
SetAutoUpper(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
SetAutoLower(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
SetReadOnly(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
SetMaxLength(len)- Arguments:
lenReal
- Returns:
Struct.__Quill
- Arguments:
-
SetAllowedChars(chars)- Arguments:
charsString
- Returns:
Struct.__Quill
- Arguments:
-
SetDeniedChars(chars)- Arguments:
charsString
- Returns:
Struct.__Quill
- Arguments:
-
SetNumericOnly(flag, allow_decimal = false, allow_negative = false)- Arguments:
flagBoolallow_decimalBoolOptional, defaults tofalse.allow_negativeBoolOptional, defaults tofalse.
- Returns:
Struct.__Quill
- Arguments:
-
SetSelectAllOnFocus(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
SetFilterFn(fn)- Arguments:
fnFunction
- Returns:
Struct.__Quill
- Arguments:
-
SetOnLiveChange(fn, rate_ms = 0)- Arguments:
fnFunctionrate_msRealOptional, defaults to0.
- Returns:
Struct.__Quill
- Arguments:
-
SetInputMode(mode)- Arguments:
modeAnyUseQUILL_TEXTMODE_*.
- Returns:
Struct.__Quill
- Arguments:
Multiline/code/password controls
-
SetTabInserts(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
SetTabUsesSpaces(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
SetTabSpaces(count)- Arguments:
countReal
- Returns:
Struct.__Quill
- Arguments:
-
SetAutoIndent(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
SetPasswordMask(flag, mask_char = "*", allow_copy = false)- Arguments:
flagBoolmask_charStringOptional, defaults to"*".allow_copyBoolOptional, defaults tofalse.
- Returns:
Struct.__Quill
- Arguments:
-
SetWrap(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill - Notes: On multiline textboxes, setting
falseenables horizontal overflow scrolling (horizontal scrollbar when needed, andShift + mouse wheelscrolls horizontally).
- Arguments:
-
SetFont(font_asset)- Arguments:
font_assetAsset.Font
- Returns:
Struct.__Quill
- Arguments:
-
SetPreferredWidth(pixels)- Arguments:
pixelsReal
- Returns:
Struct.__Quill
- Arguments:
-
GetPreferredWidth()- Arguments: None.
- Returns:
Real
-
SetVisibleRows(rows)- Arguments:
rowsReal
- Returns:
Struct.__Quill
- Arguments:
-
GetVisibleRows()- Arguments: None.
- Returns:
Real
-
SetPreferredHeight(pixels)- Arguments:
pixelsReal
- Returns:
Struct.__Quill
- Arguments:
-
GetPreferredHeight()- Arguments: None.
- Returns:
Real
-
SetMinHeight(pixels)- Arguments:
pixelsReal
- Returns:
Struct.__Quill
- Arguments:
-
GetMinHeight()- Arguments: None.
- Returns:
Real
-
SetMaxHeight(pixels)- Arguments:
pixelsReal
- Returns:
Struct.__Quill
- Arguments:
-
GetMaxHeight()- Arguments: None.
- Returns:
Real
-
SetResizable(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
IsResizable()- Arguments: None.
- Returns:
Bool
-
SetShowResizeGrip(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
IsResizeGripVisible()- Arguments: None.
- Returns:
Bool
-
SetUseOverlayEditor(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
-
IsUsingOverlayEditor()- Arguments: None.
- Returns:
Bool
-
SetOverlayEditorTitle(title)- Arguments:
titleString
- Returns:
Struct.__Quill
- Arguments:
-
GetOverlayEditorTitle()- Arguments: None.
- Returns:
String
Validation
-
SetValidationMessage(text, kind = "error")- Arguments:
textStringkindStringOptional, defaults to"error".
- Returns:
Struct.__Quill
- Arguments:
-
ClearValidationMessage()- Arguments: None.
- Returns:
Struct.__Quill
-
SetValidationVisible(flag)- Arguments:
flagBool
- Returns:
Struct.__Quill
- Arguments:
Theme and style overrides
-
SetTheme(theme_or_minus_one)- Arguments:
theme_or_minus_oneStruct.QuillTheme|Real
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelFont(font)- Arguments:
fontAsset.Font
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelPadding(l, t, r, b)- Arguments:
lRealtRealrRealbReal
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelMargin(l, t, r, b)- Arguments:
lRealtRealrRealbReal
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelTextStyle(col, alpha = 1)- Arguments:
colRealalphaRealOptional, defaults to1.
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelBackgroundSprite(spr, subimg = 0)- Arguments:
sprAsset.SpritesubimgRealOptional, defaults to0.
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelBorderSprite(spr, subimg = 0)- Arguments:
sprAsset.SpritesubimgRealOptional, defaults to0.
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelPrimitiveBackground(col, alpha = 1)- Arguments:
colRealalphaRealOptional, defaults to1.
- Returns:
Struct.__Quill
- Arguments:
-
SetLabelPrimitiveBorder(col, alpha = 1, thickness = 1)- Arguments:
colRealalphaRealOptional, defaults to1.thicknessRealOptional, defaults to1.
- Returns:
Struct.__Quill
- Arguments:
-
SetSkinBackgroundSprite(spr, subimg = 0)- Arguments:
sprAsset.SpritesubimgRealOptional, defaults to0.
- Returns:
Struct.__Quill
- Arguments:
-
SetSkinBorderSprite(spr, subimg = 0)- Arguments:
sprAsset.SpritesubimgRealOptional, defaults to0.
- Returns:
Struct.__Quill
- Arguments:
Rendering
-
Draw(x, y, w = undefined, h = undefined)- Arguments:
xRealyRealwReal|UndefinedOptional. Usespreferred_widthwhen omitted.hReal|UndefinedOptional.
- Returns:
Void
- Arguments:
-
DrawOverlay()- Arguments: None.
- Returns:
Void
Theme API
new QuillTheme()
Creates a root theme object.
Returns: Struct.QuillTheme
Members
fontstextboxlabelskinsselectioncaretscrollbarmenueditor
Setters
SetFonts(font_theme)SetTextbox(tb_theme)SetLabel(label_theme)SetSkins(skin_theme)SetSelection(sel_theme)SetCaret(caret_theme)SetScrollbar(scroll_theme)SetMenu(menu_theme)SetEditor(editor_theme)
Subtheme constructors
new QuillFontSubtheme()new QuillTextboxSubtheme()new QuillLabelSubtheme()new QuillSkinSubtheme()new QuillSelectionSubtheme()new QuillCaretSubtheme()new QuillScrollbarSubtheme()new QuillMenuSubtheme()new QuillEditorSubtheme()
QuillFontSubtheme exposes body, code, label, menu, editor_title, editor_body, and validation. QuillScrollbarSubtheme includes border_spr_outside_draw for Nine Slice outside-border rendering. QuillMenuSubtheme includes border_spr_outside_draw for Nine Slice outside-border rendering. QuillEditorSubtheme includes panel_border_spr_outside_draw for Nine Slice outside-border rendering.
Built-in presets
new QuillTheme_VoidMango()new QuillTheme_ChunkyCandy()
Callback signatures
OnChange(fn)->fn(tb, new_value)OnFocus(fn)->fn(tb)OnBlur(fn)->fn(tb)OnSubmit(fn)->fn(tb, value)OnCancel(fn)->fn(tb)SetFilterFn(fn)->fn(insert_text) -> stringSetOnLiveChange(fn)->fn(text)AddTransform(fn)->fn(text) -> text
Use method(scope, fn) for callback scope binding.
Custom context menu item schema
For QUILL.OpenContextMenu(items, x, y, owner_id), each item can be either:
- a plain struct using the fields below
- or an item created by
QuillContextMenuItem(...)/QuillContextMenuSeparator(...)
Common fields
__uid(auto-assigned unique numeric ID)key(string, optional semantic key)
Action item fields
label(string)shortcut(string, optional)enabled(bool, optional, default true)visible(bool, optional, default true)on_click(callable)
Separator item fields
is_separator: true
Item instance methods
SetKey(key)SetLabel(label)SetShortcut(shortcut)SetEnabled(flag)SetVisible(flag)SetOnClick(on_click)
Notes on internal API
Methods prefixed with __ are internal implementation details and aren’t stable API.