-
January 11th, 2021, 22:33 #1
Extension Development - onClickDown Return Value
The documentation for the return value of a windowcontrol's onClickDown() handler found at https://www.fantasygrounds.com/refdo...cp#onClickDown, specifically "A value of false indicates that the default framework functionality for the this particular control should not be executed, but the processing should continue for the element below this control, if any." appears to indicate that if one control is drawn over top another, the bottom control will receive the onClickDown event when the top control returns false. However, this does not appear to be the case. The following has been used to show that only the topmost control's handler will receive the event when testing in the 5E ruleset, though it is assumed that the ruleset has no bearing on this particular functionality.
Code:<?xml version="1.0" encoding="UTF-8"?> <root release="3.0" version="3"> <properties> <name>OnClickDownExample</name> <ruleset> <name>5E</name> </ruleset> </properties> <base> <script name="opener"> function onInit() Interface.openWindow("tester", ""); end </script> <windowclass name="tester"> <frame>utilitybox</frame> <script> function onClickDown(button, x, y) Debug.chat("window"); return false; end </script> <sheetdata> <genericcontrol name="bottom"> <anchored position="over" /> <script> function onClickDown(button, x, y) Debug.chat("bottom"); return false; end </script> </genericcontrol> <genericcontrol name="top"> <anchored position="over" /> <script> function onClickDown(button, x, y) Debug.chat("top"); return false; end </script> </genericcontrol> </sheetdata> </windowclass> </base> </root>
My Forge creations: https://forge.fantasygrounds.com/crafter/9/view-profile
My GitHub: https://github.com/MeAndUnique
Buy me a coffee: https://ko-fi.com/meandunique
Discord: MeAndUnique#6805
-
January 12th, 2021, 02:07 #2
MOD: moved to Workshop, as that's the best place to discuss extensions and development.
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
January 12th, 2021, 18:54 #3Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
January 15th, 2021, 23:22 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
This is by design; though the documentation may need to be clarified. When it states that "the processing should continue for the element below this control", it refers to the window and other parent elements, not any other controls in the same window.
In these scenarios, I usually use the "disabled" tag to block mouse interactions completely for one of the controls. Or intercept events at the higher-level control and pass to the lower-level control.
Regards,
JPG
-
January 17th, 2021, 18:34 #5
Thanks for the reply, that helps clarify expectation for sibling control interactions. The above example still does not cause the window to receive the event from the "bottom" control if the "top" control is removed, which sounds like it is a bug if I am interpreting intent correctly.
My Forge creations: https://forge.fantasygrounds.com/crafter/9/view-profile
My GitHub: https://github.com/MeAndUnique
Buy me a coffee: https://ko-fi.com/meandunique
Discord: MeAndUnique#6805
-
January 17th, 2021, 19:21 #6
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
Well, technically, window instances do not support click events (only window controls do); so they would continue to be passed up the hierarchy to any window containers (subwindow/windowlist).
Regards,
JPG
-
January 17th, 2021, 20:38 #7
Ok, cool, thanks for clearing that up for me.
My Forge creations: https://forge.fantasygrounds.com/crafter/9/view-profile
My GitHub: https://github.com/MeAndUnique
Buy me a coffee: https://ko-fi.com/meandunique
Discord: MeAndUnique#6805
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks