class
GUIInputBox
Input box is a GUI element that accepts Unicode textual input.
It can be single or multi-line and handles various types of text manipulation.
Public
Methods
staticGetGuiTypeName
Returns type name of the GUI element used for finding GUI element styles.
SetText
Determines the text inside the input box.
GetText
SetFilter
Sets an optional filter that can control what is allowed to be entered into the input box.
Filter should return true if the provided string is valid and false otherwise. Set the filter to null to deactivate filtering.
staticCreate
Creates a new GUI element.
- contents
- Structure describing the contents of the GUI element to create.
- styleClass
- Style class that will be used for determining GUI element visuals from the current style sheet. If no class is provided, default style is determined based on GUI element type.
- options
- Additional options that control GUI element size and position. This will override options set in the style sheet.
Fields
Internal
Constructors
GUIInputBox
Methods
CalculateUnconstrainedOptimalSize
Calculates the optimal size for the GUI element, ignoring size constraints.
Protected
Methods
~GUIInputBox
GetStyleSheetElement
Returns the name of the GUI element type to be used for style lookup in the style sheet.
UpdateRenderElements
Recreates the internal render elements.
Must be called before GetRenderElementVertexAndIndexData/FillBuffer if element is dirty. Marks the element as non dirty.
DoOnMouseEvent
Called when a mouse event is received on any GUI element the mouse is interacting with.
Return true if you have processed the event and don't want other elements to process it.
DoOnTextInputEvent
Called when some text is input and the GUI element has input focus.
Return true if you have processed the event and don't want other elements to process it.
DoOnCommandEvent
Called when a command event is triggered.
Return true if you have processed the event and don't want other elements to process it.
DoOnVirtualButtonEvent
Called when a virtual button is pressed/released and the GUI element has input focus.
Return true if you have processed the event and don't want other elements to process it.
GetRenderElementDepthRange
Returns the range of depths that the child elements can be rendered it.
HasCustomCursor
Checks if the GUI element has a custom cursor and outputs the cursor type if it does.
GetContextMenu
Returns a context menu if a GUI element has one.
Otherwise returns nullptr.
Private
Methods
InsertString
Inserts a new string into the current text at the specified index.
InsertChar
Inserts a new character into the current text at the specified index.
EraseChar
Erases a single character at the specified index.
DeleteSelectedText
Deletes text that is currently selected.
- internal
- If internal no filter will be applied after the text is deleted, and no event will be triggered either.
GetSelectedText
Returns currently selected text.
ShowCaret
Shows the input caret.
You must position the caret manually after showing it.
HideCaret
Hides the input caret.
ShowSelection
Shows selection with the specified anchor position.
You must position selection start and end before selection will actually render. Anchor position determines selection behavior as the user moves the selection with the keyboard.
ClearSelection
Removes any active selection.
ScrollTextToCaret
Adjusts the text offset (scroll) so that the caret is visible.
ClampScrollToBounds
Clamps the text offset (scroll) so that the text fits in the provided bounds nicely with minimal white space.
GetTextOffset
Returns offset at which to render the text.
Relative to parent widget.
CutText
Cuts currently selected text to clipboard.
CopyText
Copies currently selected text to clipboard.
PasteText
Inserts text from clipboard to current caret location.
BuildTextSpriteInformation
Builds a structure describing the text, using the current text.