UIOBJECT EditBox

For summary of EditBox properties/methods see UISUMMARY EditBox

Edit Box
A user can input text into the edit box which can then be retrieved using the EditBox:GetText function.

When declaring an edit box object make sure that you either set "font" attribute for &lt;EditBox&gt; element, or include a &lt;FontString&gt; element, thus declaring which font is to be used to display text input into your edit box. If you do not do so EditBox will not display any text, just a blinking cursor.

 .. Size .. Anchors .. Layers .. etc.       

XML
See XML/EditBox.

Methods

 * EditBox:AddHistoryLine("text") - Add text to the edit history.
 * EditBox:ClearFocus - Removes text input focus from this editbox element.
 * EditBox:GetAltArrowKeyMode - Returns value of ignoreArrows attribute, in 1/nil format.
 * EditBox:GetBlinkSpeed - Returns value of blinkSpeed attribute.
 * EditBox:GetHistoryLines - Get the number of history lines for this edit box
 * EditBox:GetInputLanguage - Get the input language (locale based not in-game)
 * EditBox:GetMaxBytes
 * EditBox:GetMaxLetters - Returns value of letters attribute.
 * EditBox:GetNumLetters - Gets the number of letters in the box.
 * EditBox:GetNumber - Returns number entered in the editbox, or 0 if editbox text is not a number.
 * EditBox:GetText - Get the current text contained in the edit box.
 * EditBox:GetTextInsets - Returns list of left,right,top,bottom text insets.
 * EditBox:HasFocus - Returns true if the edit box has the focus.
 * EditBox:HighlightText(&#91;startPos,endPos&#93;) - Set the highlight to all or some of the edit box text.
 * EditBox:Insert("text") - Insert text into the edit box.
 * EditBox:IsAutoFocus - Returns value of autoFocus attribute, in 1/nil format.
 * EditBox:IsMultiLine - Returns value of multiLine attribute, in 1/nil format.
 * EditBox:IsNumeric - Returns value of numeric attribute, in 1/nil format.
 * EditBox:IsPassword - Returns value of password attribute, in 1/nil format.
 * EditBox:SetAltArrowKeyMode
 * EditBox:SetAutoFocus
 * EditBox:SetBlinkSpeed
 * EditBox:SetFocus
 * EditBox:SetHistoryLines - Set the number of history lines to remember.
 * EditBox:SetMaxBytes(maxBytes) - Set the maximum byte size for entered text.
 * EditBox:SetMaxLetters(maxLetters) - Set the maximum number of letters for entered text.
 * EditBox:SetMultiLine
 * EditBox:SetNumber(number)
 * EditBox:SetNumeric
 * EditBox:SetPassword
 * EditBox:SetSpacing - Sets the spacing, between multiple lines
 * EditBox:SetText("text") - Set the text contained in the edit box.
 * EditBox:SetTextInsets(l,r,t,b)
 * EditBox:ToggleInputLanguage

Event Handlers

 * OnCursorChanged
 * OnEditFocusGained
 * OnEditFocusLost
 * OnEnterPressed
 * OnEscapePressed
 * OnInputLanguageChanged
 * OnSpacePressed
 * OnTabPressed
 * OnTextChanged
 * OnTextSet

On multi-line and EditBox:SetHeight
Note that multi-line EditBoxes will ignore any attempts to set its height via SetHeight or via Dimension attributes in XML. They will start out the height of a single line of text, and keep expanding their area as needed. This effect becomes visible if the editbox has a backdrop set, or a texture anchored to its corners.

Explicitly setting the top and bottom anchors with SetPoint will however size it like expected.