Diol can save your theme preference in this browser using local storage.
EsTextbox *EsTextboxCreate(EsElement *parent, EsTextboxFlags flags = ES_FLAGS_DEFAULT, EsStyleID style = 0);
Creates a new empty textbox. Single-line by default; use ES_TEXTBOX_MULTILINE for multiple lines.
bool EsTextboxFind(EsTextbox *textbox, STRING string, int32_t *line, int32_t *byte, EsTextboxFindFlags flags);
Searches for the given string, starting at the position in line/byte. Returns true if found and writes the found position back to line/byte. The search wraps around the end of the text.
void EsTextboxInsert(EsTextbox *textbox, STRING string = BLANK_STRING, bool sendUpdatedMessage = true);
Deletes existing selection first.
void EsTextboxAppend(EsTextbox *textbox, STRING string = BLANK_STRING, bool sendUpdatedMessage = true);
Ignores the user's selection.
char *EsTextboxGetContents(EsTextbox *textbox, size_t *bytes = ES_NULL, EsTextboxGetContentsFlags flags = ES_FLAGS_DEFAULT);
Result will be zero-terminated; free with EsHeapFree.
double EsTextboxGetContentsAsDouble(EsTextbox *textbox, EsTextboxGetContentsFlags flags = ES_FLAGS_DEFAULT);
Parses the current contents of the textbox as a double and returns the result.
size_t EsTextboxGetLineLength(EsTextbox *textbox, uintptr_t line = 0);
Returns the length of the given line, in bytes.
void EsTextboxGetSelection(EsTextbox *textbox, int32_t *fromLine, int32_t *fromByte, int32_t *toLine, int32_t *toByte);
Writes the current selection to the output parameters. The two positions are the two carets; an equal start and end means no selection.
void EsTextboxMoveCaret(EsTextbox *textbox, int32_t line, int32_t byte);
Moves both carets to the given position, clearing the selection.
void EsTextboxSetSelection(EsTextbox *textbox, int32_t fromLine, int32_t fromByte, int32_t toLine, int32_t toByte);
Sets the selection range. A byte position of -1 means the end of the line.
void EsTextboxSelectAll(EsTextbox *textbox);
Selects all the text in the textbox.
void EsTextboxClear(EsTextbox *textbox, bool sendUpdatedMessage);
Deletes all the text. If sendUpdatedMessage is true, sends the update message.
void EsTextboxUseNumberOverlay(EsTextbox *textbox, bool defaultBehaviour);
Enables an overlay for editing a number by dragging vertically or using the arrow keys. Requires edit-based mode and a single-line textbox. If defaultBehaviour is true, the textbox applies the value changes itself.
void EsTextboxUseBreadcrumbOverlay(EsTextbox *textbox);
Enables a breadcrumb bar overlay above the textbox contents. Requires edit-based mode. The application must handle the ES_MSG_TEXTBOX_GET_BREADCRUMB and ES_MSG_TEXTBOX_ACTIVATE_BREADCRUMB messages.
void EsTextboxMoveCaretRelative(EsTextbox *textbox, EsTextboxMoveCaretRelativeFlags flags);
Moves one or both carets by a unit selected by the flags. The unit is one of the ES_TEXTBOX_MOVE_CARET_SINGLE/WORD/LINE/VERTICAL/ALL values.
void EsTextboxEnsureCaretVisible(EsTextbox *textbox, bool verticallyCenter = false);
Scrolls the textbox so that the caret is visible. If verticallyCenter is true, the caret is centered vertically.
void EsTextboxSetUndoManager(EsTextbox *textbox, EsUndoManager *manager);
Replaces the textbox's undo manager. Must be called while the textbox is not focused, and only once.
void EsTextboxSetTextSize(EsTextbox *textbox, uint16_t size);
Sets the text size of the textbox, in pixels.
void EsTextboxSetFont(EsTextbox *textbox, EsFont font);
Sets the font of the textbox's text.
void EsTextboxSetupSyntaxHighlighting(EsTextbox *textbox, EsSyntaxHighlightingLanguage language, const uint32_t *customColors = ES_NULL, size_t customColorCount = 0);
Enables syntax highlighting with the given language. customColors overrides the built-in colors; at most 8 colors are used.
void EsTextboxStartEdit(EsTextbox *textbox);
Starts an edit for an edit-based textbox and sends the ES_MSG_TEXTBOX_EDIT_START message. If the message is not handled, the whole text is selected first.
void EsTextboxEnableSmartReplacement(EsTextbox *textbox, bool enabled);
e.g. smart quotes.
void EsTextboxSetReadOnly(EsTextbox *textbox, bool readOnly);
Prevents the user from modifying the contents of the textbox; EsTextboxInsert will still work. Incompatible with ES_TEXTBOX_EDIT_BASED. Undo events will not be created.