12.07.2015 Views

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 29 ■ Widget <strong>Reference</strong> 1237SetMaxLettersSets the maximum number <strong>of</strong> text characters allowed in the edit box.EditBox:SetMaxLetters(maxLetters)Attempts to type more than this number into the edit box will produce noresults; programmatically inserting text or setting the edit box’s text willtruncate input to the maximum length.Arguments:maxLetters—Maximum number <strong>of</strong> text characters allowed in the edit box, or 0<strong>for</strong> no limit (number)SetMultiLineSets whether the edit box shows more than one line <strong>of</strong> text.EditBox:SetMultiLine(multiLine)When in multi-line mode, the edit box’s height is determined by the number <strong>of</strong>lines shown <strong>and</strong> cannot be set directly—enclosing the edit box in aScrollFrame may prove useful in such cases.Arguments:multiLine—True to allow the edit box to display more than one line <strong>of</strong> text;false <strong>for</strong> single-line display (boolean)SetNumberSets the contents <strong>of</strong> the edit box to a number.EditBox:SetNumber(num)Arguments:num—New numeric content <strong>for</strong> the edit box (number)SetNumericSets whether the edit box only accepts numeric input.EditBox:SetNumeric(enable)Note: an edit box in numeric mode only accepts numeral input—all othercharacters, including those commonly used in numeric representations (suchas ., E <strong>and</strong> -) are not allowed.Arguments:enable—True to allow only numeric input; false to allow any text (boolean)SetPasswordSets whether the text entered in the edit box is masked.EditBox:SetPassword(enable)Arguments:enable—True to mask text entered in the edit box with asteriskcharacters (*); false to show the actual text entered (boolean)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!