WoW API: GetAutoCompleteResults

From AddOn Studio
Revision as of 16:25, 8 August 2009 by WoWWiki>Speeddymon (Create page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WoW API < GetAutoCompleteResults

Gets the results of the built-in autocomplete, based on the text currently entered into an editbox.

GetAutoCompleteResults("text",
                       parent.autoCompleteParams.include,
                       parent.autoCompleteParams.exclude,
                       AUTOCOMPLETE_MAX_BUTTONS+1,
                       cursorPosition);

Parameters

Arguments

("text", parent.autoCompleteParams.include, parent.autoCompleteParams.exclude, AUTOCOMPLETE_MAX_BUTTONS+1, cursorPosition)
text
String - first characters of the possible names to be autocompleted
parent.autoCompleteParams.include
Numeric - arbitrary value assigned by Blizzard based on the type of editbox, as to what type of names to include
parent.autoCompleteParams.exclude
Numeric - arbitrary value assigned by Blizzard based on the type of editbox, as to what type of names to exclude
AUTOCOMPLETE_MAX_BUTTONS
- Numeric - arbitrary value assigned by Blizzard to determine how many buttons to include in the AutoComplete dropdown. Add 1 to allow for a disabled button that indicates there are more names than can be shown by the default AutoComplete dropdown.
cursorPosition
- Numeric - position of the cursor within the editbox. Can usually be obtained by EditBox:GetCursorPosition()

Example

Assuming you are sending a mail to someone whose name starts with "a", and that the Send Mail window is open

GetAutoCompleteResults("a",
                       SendMailNameEditBox.autoCompleteParams.include,
                       SendMailNameEditBox.autoCompleteParams.exclude,
                       AUTOCOMPLETE_MAX_BUTTONS+1,
                       SendMailNameEditBox:GetCursorPosition())