Developers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tmann
Visitor

Setting focus on Sliding Panels

I'm converting some old legacy channels to RSG.  I want to emulate the Roku player screen design by having a base labellist that feeds various types of panels on the right.  My first attempt is to create the postergrid and have focus pass to it.  

I have it partially working, it displays and you can right arrow to the grid and scroll around the grid.  Then you can left arrow back to the original labellist but things go awry at that point.  

After left arrowing back to the original labellist, if you try to right arrow over to the grid a second time, it slides and shows the grid on the left but the grid never gets focus. 

What am I missing or doing wrong?


Here is my code:

<component name = "MainMenu" extends = "OverhangPanelSetScene" >

<script type = "text/brightscript" >

    sub init()
m.top.id = "MainMenu"
m.top.backgroundURI = "pkg:/images/background.png"
m.top.overhang.color = "0x081874FF"
m.top.overhang.showOptions = true
m.top.overhang.optionsColor = "0x081874FF"
m.top.overhang.optionsAvailable = false
m.top.overhang.logoUri = "pkg:/images/overhang_logo.png"

devInfo = createObject("roDeviceInfo")
m.UIResolution = devInfo.getUIResolution()
m.scenesize = m.top.sceneBoundingRect()

m.MainMenuList = m.top.panelSet.createChild("MainMenuList")
m.MainMenuItem = m.top.panelSet.createChild("BrowseMoviesGrid")
m.MainMenuList.list.observeField("itemFocused", "ShowMenuItem")
m.MainMenuItem.observeField("focusedChild","SlideMenuItem")

m.MainMenuList.setFocus(true)

end sub


sub ShowMenuItem()

MenuItemContent = m.MainMenuList.list.content.getChild(m.MainMenuList.list.itemFocused)
m.MenuItemBox = createObject("RoSGNode","MenuItemBox")

end sub


sub SlideMenuItem()

if not m.top.panelSet.isGoingBack
  m.top.panelSet.appendChild(m.MenuItemBox)
  m.MainMenuItem.setFocus(true)
else
  m.MainMenuList.setFocus(true)
end if 

end sub
Tags (1)
0 Kudos
Community is Being Upgraded!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

We're sorry for this disruption — we’re excited to share what’s next!