Quantcast UIOBJECT EditBox - WoWWiki - Your guide to the World of Warcraft
Recent changes Random page
GAMING
Gaming
 
StarCraft Wiki
Super Smash Wiki
Halopedia
Diablo Wiki
FFXIclopedia
Grand Theft Wiki
See more...

UIOBJECT EditBox

From WoWWiki

Jump to: navigation, search
Main Menu


For summary of EditBox properties/methods see UISUMMARY EditBox

Contents

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 <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

Inheritance

Attributes

Attributes for <EditBox> element. Shown in parentheses are (attribute type; default value).

  • font (string) - name of one of the predefined fonts to use in your EditBox. For example, "GameFontNormal".
  • letters (int; 0) - maximum number of letters which can be entered in this EditBox. Zero means no character limit.
  • blinkSpeed (float; 0.5) - speed of cursor blinking, interval in seconds between "blinks".
  • numeric (boolean; false) - if true, then only digits 0-9 can be entered in this EditBox
  • password (boolean; false) - if true, then asterisks will be displayed instead of whatever text you enter.
  • multiLine (boolean; false) - multi-line EditBox
  • historyLines (int; 0) - Number of lines to keep as a "history" for this editbox. You can cycle through editbox' history with arrows Up and Down (or Alt+Up, Alt+Down if attribute ignoreArrows set to true)
  • autoFocus (boolean; true) - if true, then this EditBox will automatically receive keyboard focus when it is displayed.
  • ignoreArrows (boolean; false) - if false, then pressing arrows on keyboard will move cursor around the EditBox. If set to true, then EditBox will ignore arrows and they will instead turn around your character in game world. In this case you can still move text cursor around your editbox with Alt-arrows.

Elements

LUA API

Methods


Event Handlers


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.

Rate this article:
Share this article: