User:Watchout/DevWidget

From Warcraft Wiki
Jump to navigation Jump to search

Edit Box

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

When you declare an edit box object make sure that you include a FontString element which defines the Font which is used to display the text inputted into the EditBox. Otherwise EditBox will not display any text or being able to receive text input from the user, instead it would just display a portion of the blinking cursor (when focused)

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

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, but the text will still expand below the borders. (The effect will be similar to html elements positioned absolutely with width/height restricted)


XML

Inheritance

Attributes

  • letters (int; default=0)
  • blinkSpeed (float; default=0.5)
  • numeric (boolean; default=false)
  • password (boolean; default=false)
  • multiline (boolean; default=false)
  • historyLines (int; default=0)
  • autoFocus (boolean; default=true)
  • ignoreArrows (boolean; default=false)


Elements

  • SampleElementName (SampleElementType)
  • SampleElementNameIsType
  • FontString (UIOBJECTTYPE FontStringType)
  • HighlightColor (UIOBJECTTYPE ColorType)
  • TextInsets (UIOBJECTTYPE Inset)

LUA API

Methods


Event Handlers