commit 0185a26f21e609d14f7aecf6460f099289e75df0
parent 499284a7b2ea87fea0269b3867f6da00ef612c6d
Author: Brian C. Lane <bcl@brianlane.com>
Date: Sun, 13 Nov 2022 17:36:16 -0800
Add GridPanel and posters
This almost looks how I want it to look. Posters are showing up now.
But every time a new list item is selected it moves to the right panel.
And eventually it crashes...
Diffstat:
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/HMS/components/CategoryLoaderTask.brs b/HMS/components/CategoryLoaderTask.brs
@@ -14,5 +14,5 @@ sub GetMetadata()
print m.top.serverurl
print m.top.category
- m.top.metadata = getCategoryMetadata(m.top.serverurl, m.top.category)
+ m.top.metadata = getCategoryMetadata("http://" + m.top.serverurl, m.top.category)
end sub
diff --git a/HMS/components/MainScene.brs b/HMS/components/MainScene.brs
@@ -71,6 +71,28 @@ end sub
sub OnMetadataLoaded()
print "MainScene->OnMetadataLoaded()"
print m.metadataTask.metadata
+
+ ' Totally not sure about this
+ m.gridPanel = m.panels.CreateChild("GridPanel")
+
+ m.posterGrid = CreateObject("roSGNode", "PosterGrid")
+ m.posterGrid.basePosterSize="[240,320]"
+ m.posterGrid.itemSpacing="[8,8]"
+ m.posterGrid.caption1NumLines="1"
+ m.posterGrid.numColumns="3"
+ m.posterGrid.numRows="2"
+' m.posterGrid.observeField("focusedItem", "OnPosterGridSelected")
+ m.gridPanel.grid = m.posterGrid
+ m.gridPanel.appendChild(m.posterGrid)
+ cn = CreateObject("roSGNode", "ContentNode")
+ for each item in m.metadataTask.metadata
+ n = CreateObject("roSGNode", "ContentNode")
+ n.HDPosterUrl = item.HDPosterUrl
+ n.SDPosterUrl = item.SDPosterUrl
+ n.ShortDescriptionLine1 = item.ShortDescriptionLine1
+ cn.appendChild(n)
+ end for
+ m.posterGrid.content = cn
end sub
sub OnLabelListSelected()