WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   EventButton and EventFrame widgets (https://www.wowinterface.com/forums/showthread.php?t=59526)

Mayron 03-12-23 03:28 AM

EventButton and EventFrame widgets
 
Hi all. I was wondering if there are any documentation or wiki articles on these newer `EventFrame` and `EventButton` widgets. Blizzard uses them a lot in their XML files. I was surprised I haven't heard much discussion online about them.

Here's an example of how to create an `EventFrame`, followed by the contents dumped to depth 2:

`/run local a = CreateFrame("EventFrame");`

Lua Code:
  1. ["OnShow_Intrinsic"] = function: 000002106023F200,
  2. ["HasRegistrantsForEvent"] = function: 0000021060BA9730,
  3. ["GetCallbacksByEvent"] = function: 00000210600A3A50,
  4. ["UnregisterEvents"] = function: 00000210600BADF0,
  5. ["OnHide_Intrinsic"] = function: 000002106023F1C8,
  6. ["GenerateCallbackEvents"] = function: 00000210600BB630,
  7. ["DoesFrameHaveEvent"] = function: 00000210600A3BD8,
  8. ["GetCallbackTable"] = function: 00000210600A3A18,
  9. ["callbackTables"] = {
  10.     ["1"] = {},
  11.     ["2"] = {}
  12. },
  13. ["SecureInsertEvent"] = function: 0000021060BA9780,
  14. ["Event"] = {
  15.   ["OnSizeChanged"] = "OnSizeChanged",
  16.   ["OnShow"] = "OnShow",
  17.   ["OnScroll"] = "OnScroll",
  18.   ["OnAllowScrollChanged"] = "OnAllowScrollChanged",
  19.   ["OnHide"] = "OnHide"
  20. },
  21. ["RegisterCallback"] = function: 0000021060122FD0,
  22. ["GetCallbackTables"] = function: 00000210600A39A8,
  23. ["SetUndefinedEventsAllowed"] = function: 00000210600A39E0,
  24. ["UnregisterCallback"] = function: 0000021060BA97D0,
  25. ["TriggerEvent"] = function: 0000021060123050,
  26. ["OnSizeChanged_Intrinsic"] = function: 000002106023F238,
  27. ["RegisterCallbackWithHandle"] = function: 00000210600BB670,
  28. ["OnLoad"] = function: 0000021060BA96E0,
  29. ["OnLoad_Intrinsic"] = function: 000002106023F190

And here's an example of how to create an `EventButton`, followed by the contents dumped to depth 2:

`/run local a = CreateFrame("EventButton");`

Lua Code:
  1. ["OnClick_Intrinsic"] = function: 00000184D802D790,
  2. ["OnMouseUp_Intrinsic"] = function: 00000184D802D590,
  3. ["HasRegistrantsForEvent"] = function: 00000185626BC670,
  4. ["GetCallbacksByEvent"] = function: 00000184D801CB80,
  5. ["UnregisterEvents"] = function: 00000184D8023F10,
  6. ["OnLeave_Intrinsic"] = function: 000001854FD29568,
  7. ["GetCallbackTables"] = function: 00000184D801CAD8,
  8. ["SecureInsertEvent"] = function: 00000185626BC6C0,
  9. ["GenerateCallbackEvents"] = function: 00000184D8024750,
  10. ["TriggerEvent"] = function: 00000184D806C150,
  11. ["OnLoad"] = function: 00000185626BC620,
  12. ["callbackTables"] = {
  13.     ["1"] = {},
  14.     ["2"] = {}
  15. },
  16. ["OnLoad_Intrinsic"] = function: 000001854FD294C0,
  17. ["Event"] = {
  18.   ["OnSizeChanged"] = "OnSizeChanged",
  19.   ["OnEnter"] = "OnEnter",
  20.   ["OnValueChanged"] = "OnValueChanged",
  21.   ["OnMouseDown"] = "OnMouseDown",
  22.   ["OnLeave"] = "OnLeave",
  23.   ["OnClick"] = "OnClick",
  24.   ["OnMouseUp"] = "OnMouseUp"
  25. },
  26. ["RegisterCallback"] = function: 00000184D806C0D0,
  27. ["GetCallbackTable"] = function: 00000184D801CB48,
  28. ["SetUndefinedEventsAllowed"] = function: 00000184D801CB10,
  29. ["UnregisterCallback"] = function: 00000185626BC710,
  30. ["DoesFrameHaveEvent"] = function: 00000184D801CD08,
  31. ["OnSizeChanged_Intrinsic"] = function: 000001854FD295A0,
  32. ["RegisterCallbackWithHandle"] = function: 00000184D8024790,
  33. ["OnEnter_Intrinsic"] = function: 000001854FD29530,
  34. ["OnMouseDown_Intrinsic"] = function: 00000184D802D750

Mayron 03-12-23 03:29 AM

I can mostly guess how to use them, but I wasn't sure how many other addon devs didn't know about these newer widgets or if there are any additional resources for how to use them correctly. Has anyone tried them before and if so how and why did you use them?

I wasn't sure if these EventFrames were for registering in-game wow events, custom events, or only for frame/button events as shown in the `Event` sub-table (like OnSizeChanged, etc...).

If you can use them for registering game events then I was curious if you could substitute a "Frame" widget that only exists for registering and handling events with "EventFrame".

Xrystal 03-12-23 06:35 AM

I've seen them while looking at their code while bug fixing addons but not really needed to look further at them. I assumed they were either templates you used in your own frames or something that can only be used by Blizzard frames.

Fizzlemizz 03-12-23 08:26 AM

They're "new" intrinsics, the documentation is basically in their mixins (and inherited mixins).

EventTraceLogEventButtonMixin (Addons\Blizzard_EventTrace\Blizzard_EventTrace.lua which is LOD) and EventFrameMixin (EventFrame.lua).


All times are GMT -6. The time now is 09:59 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI