This property returns target box assigned to the event when creating the event
object.
<gadget id="myBox" language="jscript" code="...">
<attributes blockEvents="true"/>
<parts>
<box:hbox s:fill="red" s:height="100" s:width="100"/>
</parts>
<behavior>
<reaction event="mouseDown" action="gadget:onMouseDown();"/>
</behavior>
</gadget>
// in the gadget script
function onMouseDown()
{
var eventObj = shell.currentEvent;
if (eventObj)
{
var originalTargetBox = eventObj.originalTargetBox;
var targetBox = eventObj.targetBox;
if (originalTargetBox && targetBox && originalTargetBox != targetBox)
{
// if you click on the hbox part, the targetBox of the MouseEvent (which is inherited from DOMEvent)
// is myBox because it sets blockEvents="true", but the originalTargetBox is the hbox
}
}
}