jf-roku/components/ButtonGroupHoriz.xml

34 lines
763 B
XML

<?xml version="1.0" encoding="utf-8" ?>
<component name="ButtonGroupHoriz" extends="ButtonGroup">
<interface>
<field id="escape" type="boolean" alwaysNotify="true" />
</interface>
<script type="text/brightscript">
<![CDATA[
sub init()
m.top.layoutDirection = "horiz"
end sub
function onKeyEvent(key as string, press as boolean) as boolean
if not press then return false
if key = "right"
i = m.top.buttonFocused
m.top.focusButton = i + 1
return true
else if key = "left"
i = m.top.buttonFocused
m.top.focusButton = i - 1
return true
else if key = "up" or key = "down"
m.top.escape = true
return true
end if
return false
end function
]]>
</script>
</component>