Ok, my initial problem, making off screen grid content come into focus, is detailed https://forums.roku.com/viewtopic.php?f=34&t=99550 which I found some what of a solution. The solution causes a second problem that really baffles. The setup, a markupgrid with 4 visible columns, 4 rows and a total of 10 columns. When grid loads, all 4 columns and rows populate as planned. As the grid is traversed and the 4th column is reached, the following code, which defines the column widths, is executed:
m.columnFocused=m.ProgramMarkupGrid.itemFocused MOD m.ProgramMarkupGrid.numColumns
temp=[]
IF m.columnFocused = 3 or m.columnFocused= 6 or m.columnFocused = 8
counter= m.columnFocused - 1
for i= 0 to m.programmarkupgrid.numcolumns - 1
if i <= counter
temp[i]= -2 'use -2 to prevent content overlap, 0 doesn't work
else
temp[i]= 312 'set column width to 312
end if
end for
else
temp=m.programmarkupgrid.columnwidths
end if
?"column focus "m.columnFocused
?"Content Item "m.ProgramMarkupGrid.itemFocused
?"row focused "m.rowFocused
?temp
m.ProgramMarkupGrid.columnwidths=temp
As the focus reaches 3 (4th column) previous cell widths set to -2 and others to 312. This continues across the grid.
Problem: If focus is changed from Row 0 to any other row and the focus has extended past 4th column, the content disappears from the grid. Scrolling to any row other than 0 and it vanishes. If I start in Row 0, scroll to column 5, everything is visible, if I scroll down to Row 1 in column 5, all vanishes. I can scroll to Row 2 or Row 3 and still gone. If I scroll back to Row 0, the content for Rows 1,2 3 reappears. So, in effort to figure this out I tried many things, one being setting the temp
= 0 instead of -2. Well, the content shows up but you are left with the first column with content overlap. I have also used a for print statment at end of code to check if there was content. I can run it, scroll all day, the content correctly shows up in debugger but never on screen unless the value is 0 instead of -2. The -2 is what I discovered makes the left side of the grid columns completely go away so there is no overlap or cell collision, As I move back to Row 0 and the content reappears, it's almost as it's rolled up from the bottom of the grid, as if it were pushed down off the grid.
Question: Is there any other methods of scrolling a markupgrid that doesn't require changing cell widths? If so please share. If not, has anybody else had the problem as described? I really can't see a problem with the code that would cause a Row change to effect it as it does.