Function showPosterScreen(screen As Object) As Integer
if validateParam(screen, "roPosterScreen", "showPosterScreen") = false return -1
m.curCategory = 0
m.curShow = 0
initCategoryList()
categoryList = getCategoryList(m.Categories)
screen.SetListNames(m.CategoryNames)
screen.SetContentList(getShowsForCategoryItem(categoryList[m.curCategory]))
screen.Show()
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roPosterScreenEvent" then
print "showPosterScreen | msg = "; msg.GetMessage() " | index = "; msg.GetIndex()
if msg.isListFocused() then
m.curCategory = msg.GetIndex()
m.curShow = 0
'get the list of shows for the currently selected item
empty_list = CreateObject("roArray", 10, true)
screen.SetContentList(empty_list)
screen.ShowMessage("retrieving...")
screen.SetContentList(getShowsForCategoryItem(categoryList[msg.GetIndex()]))
screen.SetFocusedListItem(m.curShow)
print "list focused | current category = "; m.curCategory
else if msg.isListItemFocused() then
print "list item focused | current show = "; msg.GetIndex()
else if msg.isListItemSelected() then
m.curShow = msg.GetIndex()
print "list item selected | current show = "; m.curShow
m.curShow = displayShowDetailScreen(categoryList[m.curCategory], msg.GetIndex())
screen.setFocusedListItem(m.curShow)
else if msg.isScreenClosed() then
return -1
end if
end If
end while
End Function
function posterscreen()
screen=creatobject("roposterscreen")
screen.show()
screen.setlistnames(["zero","one","two","three","four"]]
'load all content for this screen into a cache variable:
MycontentarrayCache=getAndParseDataFromMyWebsite()
screen.setcontentlist(MyContentArrayCache[0])
timer=createobject("rotimespan")
timer.mark()
while true
msg=wait(1,port)
if type(msg)="roPosterScreenEvent" then
timer.mark() 'an event has happened, set a delay before loading data
if msg.islistfocused() and timer.totalmilliseconds() >500 then
ndx=msg.getindex()
screen.setcontentlist(MycontentarrayCache[ndx])
else if msg.islistselected()
ndx=msg.getindex()
'do nothing, although you *could* do a
'screen.setcontentlist here to override the timer, since this event
'indicates the user definitely wants to see this category
else if msg.islistitemfocused()
print "a list item is focused!"
else if msg.islistitemselected()
print "a list item is selected, do something"
end if
end while
end function
if type(msg)="roPosterScreenEvent" then
timer.mark() 'an event has happened, set a delay before loading data
if msg.islistfocused() and timer.totalmilliseconds() >500 then
ndx=msg.getindex()
screen.setcontentlist(MycontentarrayCache[ndx])
else if msg.islistselected()
if type(msg)="roPosterScreenEvent" then
time_delay = timer.totalmilliseconds()
timer.mark() 'an event has happened, set a delay before loading data
if msg.islistfocused() and timer.time_delay >500 then
ndx=msg.getindex()
screen.setcontentlist(MycontentarrayCache[ndx])
else if msg.islistselected()