Main Menu |
---|
|
The API is no longer being updated here until further notice. |
This is a list of scripts handlers that can be set on each widget type, along with the arguments that are passed.
- See Widget handlers/Complete list for a full list that does not omit inherited handlers.
- Script types are defined in the XML Schema Definition, and ScriptObject:HasScript() can be used to check if a script is supported by a widget.
ScriptObject
This is the base object for all objects with script handlers.
- OnLoad(self) - Run when the frame is created.
- OnUpdate(self, elapsed) - Run each time the screen is drawn by the game engine.
AnimationGroup
AnimationGroup has the handlers from ScriptObject, plus the following:
- OnFinished(self, requested) - Run when the animation (or animation group) finishes animating.
- OnLoop(self, loopState) - Run when the animation group's loop state changes.
- OnPause(self) - Run when the animation (or animation group) is paused.
- OnPlay(self) - Run when the animation (or animation group) begins to play.
- OnStop(self, requested) - Run when the animation (or animation group) is stopped.
Animation
Animation has the handlers from ScriptObject, plus the following:
- OnFinished(self, requested)
- OnPause(self)
- OnPlay(self)
- OnStop(self, requested)
Inherits
The following objects inherit the handlers from Animation:
- Alpha
- Scale
- LineScale
- Translation
- LineTranslation
- Path
- Rotation
- TextureCoordTranslation
Frame
Frame has the handlers from ScriptObject, plus the following:
- OnAttributeChanged(self, key, value) - Run when a frame attribute is changed.
- OnChar(self, text) - Run for each text character typed in the frame.
- OnDisable(self) - Run when the frame is disabled.
- OnDragStart(self, button) - Run when the mouse is dragged starting in the frame.
- OnDragStop(self) - Run when the mouse button is released after a drag started in the frame,
- OnEnable(self) - Run when the frame is enabled.
- OnEnter(self, motion) - Run when the mouse cursor enters the frame's interactive area.
- OnEvent(self, event, ...) - Run whenever an event fires for which the frame is registered.
- OnHide(self) - Run when the frame's visbility changes to hidden.
- OnHyperlinkClick(self, link, text, button) - Run when the mouse clicks a hyperlink on the FontInstance object.
- OnHyperlinkEnter(self, link, text) - Run when the mouse moves over a hyperlink on the FontInstance object.
- OnHyperlinkLeave(self, link, text) - Run when the mouse moves away from a hyperlink on the FontInstance object.
- OnKeyDown(self, key) - Run when a keyboard key is pressed if the frame is keyboard enabled.
- OnKeyUp(self, key) - Run when a keyboard key is released if the frame is keyboard enabled.
- OnLeave(self, motion) - Run when the mouse cursor leaves the frame's interactive area.
- OnMouseDown(self, button) - Run when a mouse button is pressed while the cursor is over the frame.
- OnMouseUp(self, button) - Run when the mouse button is released following a mouse down action in the frame.
- OnMouseWheel(self, delta) - Run when the frame receives a mouse wheel scrolling action.
- OnReceiveDrag(self) - Run when the mouse button is released after dragging into the frame.
- OnShow(self) - Run when the frame becomes visible.
- OnSizeChanged(self, width, height) - Run when a frame's size changes.
Inherits
The following objects inherit the handlers from Frame:
- ArchaeologyDigSiteFrame
- MessageFrame
- Minimap
- OffScreenFrame
- QuestPOIFrame
- ScenarioPOIFrame
- ScrollingMessageFrame
- SimpleHTML
- UnitPositionFrame
- WorldFrame
The following objects have the handlers from Frame, plus the following:
Browser
- OnButtonUpdate(self, action)
- OnEditFocusGained(self)
- OnEditFocusLost(self)
- OnError(self, msg)
- OnEscapePressed(self)
- OnExternalLink(self, url)
Button
CheckButton / ItemButton inherit the handlers from Button.
- OnClick(self, button, down) - Run when the button is clicked.
- OnDoubleClick(self, button) - Run when the button is double-clicked.
- PostClick(self, button, down) - Run immediately following the button's `OnClick` handler with the same arguments.
- PreClick(self, button, down) - Run immediately before the button's `OnClick` handler with the same arguments.
Checkout
- OnButtonUpdate(self, action)
- OnEditFocusGained(self)
- OnEditFocusLost(self)
- OnError(self, msg)
- OnEscapePressed(self)
- OnExternalLink(self, url)
- OnRequestNewSize(self, width, height)
ColorSelect
- OnColorSelect(self, r, g, b) - Run when the color select frame's color selection changes.
Cooldown
- OnCooldownDone(self)
EditBox
- OnArrowPressed(self, key)
- OnCharComposition - Run when the edit box's input composition mode changes.
- OnCursorChanged(self, x, y, width, height) - Run when the position of the text insertion cursor in the edit box changes.
- OnEditFocusGained(self) - Run when the edit box becomes focused for keyboard input.
- OnEditFocusLost(self) - Run when the edit box loses keyboard input focus.
- OnEnterPressed(self) - Run when the Enter (or Return) key is pressed while the edit box has keyboard focus.
- OnEscapePressed(self) - Run when the Escape key is pressed while the edit box has keyboard focus.
- OnInputLanguageChanged(self, language) - Run when the edit box's language input mode changes.
- OnSpacePressed(self) - Run when the space bar is pressed while the edit box has keyboard focus.
- OnTabPressed(self) - Run when the Tab key is pressed while the edit box has keyboard focus.
- OnTextChanged(self, isUserInput) - Run when the edit box's text is changed.
- OnTextSet(self) - Run when the edit box's text is set programmatically.
FogOfWarFrame
- OnUiMapChanged(self, uiMapID)
GameTooltip
- OnTooltipAddMoney(self, cost, maxcost) - Run when an amount of money should be added to the tooltip.
- OnTooltipCleared(self) - Run when the tooltip is hidden or its content is cleared.
- OnTooltipSetAchievement - Run when the tooltip is filled with information about an achievement.
- OnTooltipSetDefaultAnchor(self) - Run when the tooltip is repositioned to its default anchor location.
- OnTooltipSetEquipmentSet - Run when the tooltip is filled with information about an equipment set.
- OnTooltipSetFramestack(self, highlightFrame) - Run when the tooltip is filled with a list of frames under the mouse cursor.
- OnTooltipSetItem(self) - Run when the tooltip is filled with information about an item.
- OnTooltipSetQuest - Run when the tooltip is filled with information about a quest.
- OnTooltipSetSpell(self) - Run when the tooltip is filled with information about a spell.
- OnTooltipSetUnit(self) - Run when the tooltip is filled with information about a unit.
Model
PlayerModel / TabardModel inherit the handlers from Model.
- OnAnimFinished(self) - Run when the model's animation finishes.
- OnAnimStarted(self)
- OnModelLoaded(self)
CinematicModel
- OnPanFinished
DressupModel
- OnDressModel(self)
MovieFrame
- OnMovieFinished(self) - Run when a movie frame's movie ends.
- OnMovieHideSubtitle(self) - Runs when the movie's most recently displayed subtitle should be hidden.
- OnMovieShowSubtitle(self, text) - Runs when a subtitle for the playing movie should be displayed.
ScrollFrame
- OnHorizontalScroll(self, offset) - Run when the scroll frame's horizontal scroll position changes.
- OnScrollRangeChanged(self, xrange, yrange) - Run when the scroll frame's scroll position is changed.
- OnVerticalScroll(self, offset) - Run when the scroll frame's vertical scroll position changes.
Slider
- OnMinMaxChanged - Run when the slider's or status bar's minimum and maximum values change.
- OnValueChanged (self, value) - Run when the slider's or status bar's value changes.
StatusBar
- OnMinMaxChanged - Run when the slider's or status bar's minimum and maximum values change.
- OnValueChanged (self, value) - Run when the slider's or status bar's value changes.
References
- wowprogramming 2017-09-03. Widget script handlers listing.
- Townlong Yak 2017-06-27. WidgetAPI.lua.
- Resike 2019-05-21. WidgetReference.lua.