Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hugetv
Visitor

How to implement a counter Button in roMessageDialog

problem with 20 buttons display shows only 9
Our system http://www.rokumanager.com
0 Kudos
5 REPLIES 5
destruk
Binge Watcher

Re: How to implement a counter Button in roMessageDialog

You'd need to use multiple-layer menus, or design a custom roscreen or roimagecanvas to utilize more buttons.
0 Kudos
hugetv
Visitor

Re: How to implement a counter Button in roMessageDialog

which would be the best way to make this possible
Our system http://www.rokumanager.com
0 Kudos
destruk
Binge Watcher

Re: How to implement a counter Button in roMessageDialog

Easiest is multiple dialog screens - have button 8 be 'more choices'
0 Kudos
hugetv
Visitor

Re: How to implement a counter Button in roMessageDialog

this code

Function ShowMessageDialog_ChooseQuality(episode) As Void
port = CreateObject("roMessagePort")
dialog = CreateObject("roMessageDialog")
dialog.SetMessagePort(port)
dialog.SetTitle("Choose Links")
dialog.SetText("Choose the video Links to play")

count = 1
for each stream in episode.streams
dialog.AddButton(count, ValidStr(stream.texturl))
count = count + 1
next
dialog.EnableBackButton(true)
dialog.Show()
While True
dlgMsg = wait(0, dialog.GetMessagePort())
If type(dlgMsg) = "roMessageDialogEvent"
if dlgMsg.isButtonPressed()
index = dlgMsg.GetIndex()
if index >= 1 and index < count
dialog.close()
retval = ShowVideoScreen(episode,episode.streams[index-1].url)
exit while
end if
else if dlgMsg.isScreenClosed()
exit while
end if
end if
end while
End Function
Our system http://www.rokumanager.com
0 Kudos
destruk
Binge Watcher

Re: How to implement a counter Button in roMessageDialog

I'd just check for more than 9 bitrates being available, and if there were more than 9, I'd split them in some logical order like displaying the top 8 and the lowest available, or every second bitrate, or every third, or something consistent.
Or -- as suggested, take the first 8, make 9 be more choices, pass the remaining bitrates to it, and loop the thing back to the first page until you're out of options.
0 Kudos