MeAndUnique
January 11th, 2021, 22:33
The documentation for the return value of a windowcontrol's onClickDown() handler found at https://www.fantasygrounds.com/refdoc/windowcontrol.xcp#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.
<?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>
<?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>