jf-roku/components/library/item.xml

37 lines
898 B
XML
Raw Normal View History

2019-03-14 17:11:51 +00:00
<?xml version="1.0" encoding="utf-8" ?>
<component name="LibItem" extends="Group">
<children>
<Label id="itemText" horizAlign="center" font="font:MediumSystemFont" height="75" />
</children>
<interface>
<field id="itemContent" type="node" onChange="itemContentChanged"/>
</interface>
<script type="text/brightscript">
<![CDATA[
sub Init()
m.itemText = m.top.findNode("itemText")
m.itemText.text = "Loading..."
updateSize()
end sub
sub updateSize()
m.itemText = m.top.findNode("itemText")
maxSize = m.top.getParent().itemSize
m.itemText.width = maxSize[0]
m.itemText.translation = [0, (maxSize[1] / 2) - 15]
end sub
function itemContentChanged() as void
m.itemText = m.top.findNode("itemText")
itemData = m.top.itemContent
m.itemText.text = itemData.labelText
updateSize()
end function
]]>
</script>
</component>