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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1236 Part IV ■ <strong>Reference</strong>SetCursorPositionSets the cursor position in the edit box.EditBox:SetCursorPosition(position)Arguments:position—New position <strong>for</strong> the keyboard input cursor (between 0, <strong>for</strong> theposition be<strong>for</strong>e the first character, <strong>and</strong> editbox:GetNumLetters(),<strong>for</strong>theposition after the last character) (number)SetFocusFocuses the edit box <strong>for</strong> keyboard input.EditBox:SetFocus()Only one edit box may be focused at a time; setting focus to one edit box willremove it from the currently focused edit box.SetHistoryLinesSets the maximum number <strong>of</strong> history lines stored by the edit box.EditBox:SetHistoryLines(count)Lines <strong>of</strong> text can be added to the edit box’s history by calling:AddHistoryLine(); once added, the user can quickly set the edit box’scontents to one <strong>of</strong> these lines by pressing the up or down arrow keys. (Historylines are only accessible via the arrow keys if the edit box is not in multi-linemode.)Arguments:count—Maximum number <strong>of</strong> history lines to be stored by the edit box (number)SetIndentedWordWrapSets whether long lines <strong>of</strong> text are indented when wrapping.EditBox:SetIndentedWordWrap(indent)Arguments:indent—True to indent wrapped lines <strong>of</strong> text; false otherwise(boolean)SetMaxBytesSets the maximum number <strong>of</strong> bytes <strong>of</strong> text allowed in the edit box.EditBox:SetMaxBytes(maxBytes)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.Note: Unicode characters may consist <strong>of</strong> more than one byte each, so the behavior<strong>of</strong> a byte limit may differ from that <strong>of</strong> a character limit in practical use.Arguments:maxBytes—Maximum number <strong>of</strong> text bytes allowed in the edit box, or 0 <strong>for</strong> nolimit (number)

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

Saved successfully!

Ooh no, something went wrong!