Widget: EditBox

From AddOn Studio
Jump to navigation Jump to search

Widget API < EditBox

For summary of all EditBox properties / methods see UISUMMARY EditBox

Edit Box[edit]

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 <EditBox> element, or include a <FontString> 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.

<EditBox name="TestEditBox">
      .. Size
      .. Anchors
      .. Layers
      .. etc.
      
      <FontString inherits="GameFontNormal"/>
</EditBox>

XML[edit]

See XML/EditBox.

LUA API[edit]

User:Watchout/Inheritance

Methods[edit]


Event Handlers[edit]


On multi-line and EditBox:SetHeight()[edit]

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.