m
Move page script moved page XML/Script to WoW:XML/Script without leaving a redirect
m (Move page script moved page XML/Script to WoW:XML/Script without leaving a redirect) |
|||
| (10 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{ | {{uixmlprop}} | ||
[[XML/Script|Script]] is way to add handler code to a UI element. Script is base type that is not used directly, but added to <[[XML/Scripts|Scripts]]> using one of the specific handler types such as 'OnClick'. The Script type provides a base type for all of the hander types. | [[XML/Script|Script]] is way to add handler code to a UI element. Script is base type that is not used directly, but added to <[[XML/Scripts|Scripts]]> using one of the specific handler types such as 'OnClick'. The Script type provides a base type for all of the hander types. | ||
| Line 12: | Line 11: | ||
== Attributes == | == Attributes == | ||
* function {{attrtype|string}} (optional) | * function {{attrtype|string}} (optional) | ||
*:global name of | *: named function to call using a simple global name. Can be used instead of in payload with inline script text. | ||
* method {{attrtype|string}} (optional) | * method {{attrtype|string}} (optional) | ||
*:this frame Lua | *: named method to call using this frame's Lua table or 'mixin' name of function to call, in lieu of inline text or 'function'. | ||
* inherit ([[XML types#SCRIPTINHERITTYPE|SCRIPTINHERITTYPE]]) (optional) | * inherit ([[XML types#SCRIPTINHERITTYPE|SCRIPTINHERITTYPE]]) (optional) | ||
*: order to run this script relative to any | *: order to run this script relative to any other scripts for this event including any 'inherited'. Default is 'none'. | ||
* intrinsicOrder ([[XML types#SCRIPTINTRINSICORDERTYPE|SCRIPTINTRINSICORDERTYPE]]) (optional) | * intrinsicOrder ([[XML types#SCRIPTINTRINSICORDERTYPE|SCRIPTINTRINSICORDERTYPE]]) (optional) | ||
*: order to run this script relative to any implementation scripts for this event. Used only in an intrinsic definition. Default is 'none'. | *: order to run this script relative to any implementation scripts for this event. Used only in an intrinsic definition. Default is 'none'. | ||
| Line 24: | Line 23: | ||
== Payload == | == Payload == | ||
* (optional) - Lua script as plain text called as a Lua function. | * (optional) - Lua script as plain text called as a Lua function. | ||
<pre> | |||
=== | <Frame name="Frame1"> | ||
* self - (table) the | <Scripts> | ||
<OnMouseUp> | |||
print(self:GetName(), event, ...) -- payload | |||
</OnMouseUp> | |||
</Scripts> | |||
</Frame> | |||
</pre> | |||
=== Parameters === | |||
Lua script parameters set by the engine for use by the inline script. | |||
* self - (table) the Lua table automatically genmerated for the frame | |||
* event - (string) the name of the wow event | * event - (string) the name of the wow event | ||
* ... - the remaining Lua args list including any event arguments | * ... - the remaining Lua args list including any event arguments | ||
| Line 67: | Line 75: | ||
== See also == | == See also == | ||
* [[XML/Scripts]] - for outer parent element | |||
* [[XML_properties#Scripts]] - for a list of handlers | * [[XML_properties#Scripts]] - for a list of handlers | ||
* [[Widget handlers]] - for which handlers work with which elements | * [[Widget handlers]] - for which handlers work with which elements | ||
* [[:Category:Widget event handlers]] | * [[:Category:Widget event handlers]] | ||