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> 1267This script is always run <strong>for</strong> the frame which received the initial mouse buttondown event (unless the frame is registered <strong>for</strong> drag actions <strong>and</strong> a drag action isstarted be<strong>for</strong>e the button is released). For further details, see the example underOnClick.Arguments:self—<strong>Reference</strong> to the widget <strong>for</strong> which the script was run (frame)button—Name <strong>of</strong> the mouse button responsible <strong>for</strong> the click action (string)This widget script is defined <strong>for</strong> the following widget types: Button,CheckButton, ColorSelect, Cooldown, DressUpModel, EditBox, Frame,GameTooltip, MessageFrame, Minimap, Model, MovieFrame, PlayerModel,ScrollFrame, ScrollingMessageFrame, SimpleHTML, Slider, StatusBar,TabardModelOnMouseWheelRun when the frame receives a mouse wheel scrolling action.OnMouseWheel(self, delta)In order <strong>for</strong> this h<strong>and</strong>ler to be run, the frame must be mouse wheel enabled<strong>and</strong> the mouse cursor must be within the frame while the scroll wheel (orequivalent device) is used.Arguments:self—<strong>Reference</strong> to the widget <strong>for</strong> which the script was run (frame)delta—1 <strong>for</strong> a scroll-up action, -1 <strong>for</strong> a scroll-down action (number)Example:-- Print the mousewheel delta <strong>for</strong> a buttonCreateFrame(“Frame“, “test“, UIParent, “UIPanelButtonTemplate2“)test:SetPoint(“CENTER“)test:EnableMouseWheel(true)test:SetScript(“OnMouseWheel“, function(self, delta)DEFAULT_CHAT_FRAME:AddMessage(delta)end)This widget script is defined <strong>for</strong> the following widget types: Button,CheckButton, ColorSelect, Cooldown, DressUpModel, EditBox, Frame,GameTooltip, MessageFrame, Minimap, Model, MovieFrame, PlayerModel,ScrollFrame, ScrollingMessageFrame, SimpleHTML, Slider, StatusBar,TabardModelOnMovieFinishedRun when a movie frame’s movie ends.OnMovieFinished(self)Arguments:self—<strong>Reference</strong> to the widget <strong>for</strong> which the script was run (movieframe)This widget script is defined <strong>for</strong> the following widget types: MovieFrame

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

Saved successfully!

Ooh no, something went wrong!