2019-02-04 02:57:52 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
|
|
<component name="LibraryRow" extends="RowList">
|
2019-03-02 05:55:28 +00:00
|
|
|
<interface>
|
2019-03-05 05:18:01 +00:00
|
|
|
<field id="rowSize" type="int" />
|
|
|
|
<field id="libList" type="associativearray" onChange="setData" />
|
2019-03-02 05:55:28 +00:00
|
|
|
</interface>
|
|
|
|
<script type="text/brightscript">
|
|
|
|
<![CDATA[
|
|
|
|
sub init()
|
|
|
|
m.top.itemComponentName = "LibItem"
|
2019-03-02 22:22:13 +00:00
|
|
|
m.top.content = getData()
|
|
|
|
|
2019-03-10 05:53:36 +00:00
|
|
|
m.top.rowFocusAnimationStyle = "floatingFocus"
|
|
|
|
m.top.vertFocusAnimationStyle = "floatingFocus"
|
|
|
|
|
|
|
|
m.top.showRowLabel = [false]
|
|
|
|
|
|
|
|
updateSize()
|
|
|
|
|
|
|
|
m.top.setfocus(true)
|
|
|
|
end sub
|
|
|
|
|
|
|
|
sub updateSize()
|
2019-03-02 05:55:28 +00:00
|
|
|
m.top.numrows = 1
|
2019-03-10 05:28:28 +00:00
|
|
|
m.top.rowSize = 5
|
|
|
|
|
|
|
|
dimensions = m.top.getScene().currentDesignResolution
|
|
|
|
|
|
|
|
border = 200
|
2019-03-12 23:34:51 +00:00
|
|
|
m.top.translation = [border, border + 115]
|
2019-03-10 05:28:28 +00:00
|
|
|
|
|
|
|
itemWidth = (dimensions["width"] - border*2) / m.top.rowSize
|
|
|
|
itemHeight = 75
|
2019-03-02 22:22:13 +00:00
|
|
|
|
2019-03-02 05:55:28 +00:00
|
|
|
m.top.visible = true
|
2019-03-10 05:28:28 +00:00
|
|
|
|
|
|
|
' size of the whole row
|
|
|
|
m.top.itemSize = [dimensions["width"] - border*2, itemHeight]
|
|
|
|
' spacing between rows
|
2019-03-11 02:35:48 +00:00
|
|
|
m.top.itemSpacing = [ 0, 30 ]
|
2019-03-10 05:28:28 +00:00
|
|
|
|
|
|
|
' size of the item in the row
|
|
|
|
m.top.rowItemSize = [ itemWidth, itemHeight ]
|
|
|
|
' spacing between items in a row
|
|
|
|
m.top.rowItemSpacing = [ 0, 0 ]
|
2019-03-02 05:55:28 +00:00
|
|
|
end sub
|
2019-02-04 02:57:52 +00:00
|
|
|
|
2019-03-02 05:55:28 +00:00
|
|
|
function setData()
|
|
|
|
libs = m.top.liblist
|
|
|
|
rowsize = m.top.rowSize
|
2019-03-02 20:36:37 +00:00
|
|
|
|
2019-03-02 05:55:28 +00:00
|
|
|
n = libs.TotalRecordCount
|
|
|
|
|
|
|
|
' Test for no remainder
|
|
|
|
if int(n/rowsize) = n/rowsize then
|
|
|
|
m.top.numRows = n/rowsize
|
|
|
|
else
|
|
|
|
m.top.numRows = n/rowsize + 1
|
|
|
|
end if
|
|
|
|
|
|
|
|
m.top.content = getData()
|
|
|
|
end function
|
|
|
|
|
|
|
|
function getData()
|
|
|
|
if m.top.libList = invalid then
|
|
|
|
data = CreateObject("roSGNode", "ContentNode")
|
|
|
|
return data
|
|
|
|
end if
|
|
|
|
|
|
|
|
libs = m.top.libList
|
|
|
|
rowsize = m.top.rowSize
|
|
|
|
data = CreateObject("roSGNode", "ContentNode")
|
|
|
|
for rownum=1 to m.top.numRows
|
|
|
|
row = data.CreateChild("ContentNode")
|
|
|
|
for i=1 to rowsize
|
|
|
|
index = (rownum - 1) * rowsize + i
|
|
|
|
if index > libs.TotalRecordCount then
|
|
|
|
exit for
|
|
|
|
end if
|
|
|
|
datum = libs.Items[index-1]
|
2019-03-12 01:24:39 +00:00
|
|
|
item = row.CreateChild("LibraryData")
|
2019-03-02 05:55:28 +00:00
|
|
|
item.labelText = datum.name
|
2019-03-05 04:31:58 +00:00
|
|
|
item.libraryID = datum.id
|
|
|
|
item.libraryType = datum.CollectionType
|
2019-03-12 23:34:51 +00:00
|
|
|
item.data = datum
|
2019-03-02 05:55:28 +00:00
|
|
|
end for
|
|
|
|
end for
|
|
|
|
return data
|
|
|
|
end function
|
|
|
|
]]>
|
|
|
|
</script>
|
2019-02-04 02:57:52 +00:00
|
|
|
</component>
|