Anybody has an example of EPG Grid?
I want to customize (or use as it) this:
https://sdkdocs.roku.com/display/sdkdoc/EPGGrid
edskitter wrote:epgGridScene.xmlCode: Select all<?xml version="1.0" encoding="utf-8" ?>
<!--********** Copyright 2015 Roku Corp. All Rights Reserved. **********-->
<component name="epgGridScene" extends="Scene">
<script type="text/brightscript" >
</script>
<children>
<!-- EPG Grid -->
<customEPGGrid />
</children>
</component>
EpgGrid.xmlCode: Select all<?xml version="1.0" encoding="utf-8" ?>
<component name="customEPGGrid" extends="EPGGrid" >
<script type="text/brightscript" >
<![CDATA[
function init()
print "inside epg"
m.content = createObject("RoSGNode","ContentNode")
m.top.setFocus(true)
dateNow = CreateObject("roDateTime")
dateNow = dateNow.asSeconds() - 2000
addChannel("ABC")
addItem("ABC Show ", dateNow)
addChannel("CBS")
addItem("CBS Show ", dateNow)
addChannel("NBC")
addItem("NBC Show ", dateNow)
addChannel("NICK")
addItem("NICK Show ", dateNow)
addChannel("OUTSIDE")
addItem("Outside Show ", dateNow)
addChannel("TEST")
addItem("Test Show ", dateNow)
m.top.content = m.content
m.top.translation = [50, 300]
m.top.numRows = 5
m.top.duration = 10800
m.top.nowNextMode = false
m.top.infoGridGap = 0
m.top.channelInfoColumnLabel = "Hello"
end function
sub addChannel(channelText as string)
m.channel = m.content.createChild("ContentNode")
m.channel.TITLE = channelText
m.channel.HDSMALLICONURL = "http://css.boshanka.co.uk/wp-content/uploads/2015/04/icon-logo-design-small.png"
end sub
sub addItem(progText as string, timeStart)
For i=0 To 5 Step 1
program = m.channel.createChild("ContentNode")
program.TITLE = progText + str(i)
program.PLAYSTART = timeStart + (i * 2000)
program.PLAYDURATION = "2000"
End For
end sub
]]>
</script>
</component>
main.brsCode: Select all'********** Copyright 2015 Roku Corp. All Rights Reserved. **********
sub Main()
showChannelSGScreen()
end sub
sub showChannelSGScreen()
print "in showChannelSGScreen"
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("epgGridScene")
screen.show()
while(true)
msg = wait(0, m.port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
if msg.isScreenClosed()
print "screen closed"
return
end if
end if
end while
end sub
I can get the EPG to render but I can not get the grid to have focus to move up / down / left / right. What am I missing?
dreamer2057 wrote:I found an example. On the fifth page. Thanks to edskitter
viewtopic.php?f=34&t=88621&start=60edskitter wrote:epgGridScene.xmlCode: Select all<?xml version="1.0" encoding="utf-8" ?>
<!--********** Copyright 2015 Roku Corp. All Rights Reserved. **********-->
<component name="epgGridScene" extends="Scene">
<script type="text/brightscript" >
</script>
<children>
<!-- EPG Grid -->
<customEPGGrid />
</children>
</component>
EpgGrid.xmlCode: Select all<?xml version="1.0" encoding="utf-8" ?>
<component name="customEPGGrid" extends="EPGGrid" >
<script type="text/brightscript" >
<![CDATA[
function init()
print "inside epg"
m.content = createObject("RoSGNode","ContentNode")
m.top.setFocus(true)
dateNow = CreateObject("roDateTime")
dateNow = dateNow.asSeconds() - 2000
addChannel("ABC")
addItem("ABC Show ", dateNow)
addChannel("CBS")
addItem("CBS Show ", dateNow)
addChannel("NBC")
addItem("NBC Show ", dateNow)
addChannel("NICK")
addItem("NICK Show ", dateNow)
addChannel("OUTSIDE")
addItem("Outside Show ", dateNow)
addChannel("TEST")
addItem("Test Show ", dateNow)
m.top.content = m.content
m.top.translation = [50, 300]
m.top.numRows = 5
m.top.duration = 10800
m.top.nowNextMode = false
m.top.infoGridGap = 0
m.top.channelInfoColumnLabel = "Hello"
end function
sub addChannel(channelText as string)
m.channel = m.content.createChild("ContentNode")
m.channel.TITLE = channelText
m.channel.HDSMALLICONURL = "http://css.boshanka.co.uk/wp-content/uploads/2015/04/icon-logo-design-small.png"
end sub
sub addItem(progText as string, timeStart)
For i=0 To 5 Step 1
program = m.channel.createChild("ContentNode")
program.TITLE = progText + str(i)
program.PLAYSTART = timeStart + (i * 2000)
program.PLAYDURATION = "2000"
End For
end sub
]]>
</script>
</component>
main.brsCode: Select all'********** Copyright 2015 Roku Corp. All Rights Reserved. **********
sub Main()
showChannelSGScreen()
end sub
sub showChannelSGScreen()
print "in showChannelSGScreen"
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("epgGridScene")
screen.show()
while(true)
msg = wait(0, m.port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
if msg.isScreenClosed()
print "screen closed"
return
end if
end if
end while
end sub
I can get the EPG to render but I can not get the grid to have focus to move up / down / left / right. What am I missing?