SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-06-2011, 05:56 AM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
EnsureVisibilityForVariable in 2D tables

How does this method use the index (last parameter) for tables? If I've got a 3x3 table, and want a specific item to get focused in the middle location :

Code:
X X X
X 0 X
X X X
Is that index 4 in this case?

I can't seem to get any rhyme or reason when calling this method on 2D tables....

btl.
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #2  
Old 04-06-2011, 08:52 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Yep, that's index 4..... it works from top to bottom like:

x-0 x-3 x-6
x-1 o-4 x-7
x-2 x-5 x-8

As a previous post where I got shot down I'd get element 4 then use that to set the focus but no doubt that will be the wrong way to do it
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #3  
Old 04-06-2011, 09:14 AM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
Interesting - I would have counted left to right not top to bottom.

Next question - how do you get a table to be free-flowing enough that any element can be in any position?

Code:
g h i
j k l
m n o
can turn into

Code:
i j k
l m n
o p q
I typically see an entire row scroll at a time, rather than the elements moving around one at a time if that makes sense.
btl.
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #4  
Old 04-06-2011, 09:39 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by jaminben View Post
Yep, that's index 4..... it works from top to bottom like:

x-0 x-3 x-6
x-1 o-4 x-7
x-2 x-5 x-8

As a previous post where I got shot down I'd get element 4 then use that to set the focus but no doubt that will be the wrong way to do it
Actually it counts differently based on horziontal or vertical scrolling.
Reply With Quote
  #5  
Old 04-06-2011, 09:41 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by bialio View Post
Interesting - I would have counted left to right not top to bottom.

Next question - how do you get a table to be free-flowing enough that any element can be in any position?

Code:
g h i
j k l
m n o
can turn into

Code:
i j k
l m n
o p q
I typically see an entire row scroll at a time, rather than the elements moving around one at a time if that makes sense.
btl.
I don't understand the question I guess. If it needs to scroll it slays will scroll a row/column as that is the table function.
Reply With Quote
  #6  
Old 04-06-2011, 09:41 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
So you want the focus item to be static in the center all the time and have items move around the focused item?

If so two methods come to mind....

1. First set the focus to the item in the table.... then use listener widgets in your table (up,down,left and right) with a SendEvent to UI component to make the table scroll around, I guess you'd also have to use SetFocus as well to make sure the focus didn't stray away from the position you want it at.

2. Create your table with a UIValue attribute, add some up, down, left, right listener widgets to "RefreshArea" for the panel container in the next step (or you can use a FocusGained hook). Then create a panel widget outside of the table.... maybe using Auto arrange = SquareGrid although not essential. Now add 9 sub panels with each sub panel using a GetDataFromTableFocusedOffset(GetUIComponentForVariable("UIValue", "YourValue"), *, true) where * = table position.

I used the second method to make my showcase view as seen in our thread and youtube clips.
Attached Images
File Type: jpg Like This.jpg (144.9 KB, 250 views)
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #7  
Old 04-06-2011, 09:50 AM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
I don't necessarily want the focus item to be static, I just want the location in the table of the elements to be fluid.

I've had good luck with center scrolling by having a table where each cell is a panel, and just there is a button only in the location where I want to be fixed. I haven't tried it with a 2d table though.

Your method #2 looks interesting - I'll play around with that some and see where it will take me.
btl.
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #8  
Old 04-06-2011, 09:54 AM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
Quote:
Originally Posted by PLUCKYHD View Post
I don't understand the question I guess. If it needs to scroll it slays will scroll a row/column as that is the table function.
For example, to clarify what I'm asking, lets say there is a table with 100 items in it, 9 of those visible at any one time (3x3 grid).

The items are then put into the table 3 per row, with the first index being a multiple of 3....

0 1 2
3 4 5
6 7 8

etc.

What if I want item 45 to be in the middle column - it's normally going to be in the first column since it's a multiple of 3.

btl.
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #9  
Old 04-06-2011, 10:01 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by PLUCKYHD View Post
Actually it counts differently based on horziontal or vertical scrolling.
Hmmm, interesting...... so currently my table is set to scroll horizontally (table has 3 rows and 9 columns) and its numbering as I posted above. But if I change to scroll vertically it will number from left to right?

This would be my prefered method as it makes more sense to see items run along the top, then middle and lastly the bottom..... Actually I can't get my head around this.... what happens if its wrapped? how will it know where to start the media item for the next row?

Edit

Scrap that.... it needs to scroll horizontally so I guess it will always be numbered top to bottom..... I think?
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders

Last edited by jaminben; 04-06-2011 at 10:13 AM.
Reply With Quote
  #10  
Old 04-06-2011, 10:13 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by bialio View Post
For example, to clarify what I'm asking, lets say there is a table with 100 items in it, 9 of those visible at any one time (3x3 grid).

The items are then put into the table 3 per row, with the first index being a multiple of 3....

0 1 2
3 4 5
6 7 8

etc.

What if I want item 45 to be in the middle column - it's normally going to be in the first column since it's a multiple of 3.

btl.
You'll need to build your own table out of panels to do that. The default table can't do this ie you can adjust the location of items. You can but it would require you doing it manually by adjusting you array that you are passing into the table but at that point better of just making your own table out of panels.
Reply With Quote
  #11  
Old 04-06-2011, 10:17 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by jaminben View Post
Hmmm, interesting...... so currently my table is set to scroll horizontally (table has 3 rows and 9 columns) and its numbering as I posted above. But if I change to scroll vertically it will number from left to right?
Correct if you loOk at your elements I'm the table they get ordered in the same way
Quote:
This would be my prefered method as it makes more sense to see items run along the top, then middle and lastly the bottom..... Actually I can't get my head around this.... what happens if its wrapped? how will it know where to start the media item for the next row?

Edit

Scrap that.... it needs to scroll horizontally so I guess it will always be numbered top to bottom..... I think?
right it the same as the order you see your elements in
Reply With Quote
  #12  
Old 04-06-2011, 10:20 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by bialio View Post
I've had good luck with center scrolling by having a table where each cell is a panel, and just there is a button only in the location where I want to be fixed. I haven't tried it with a 2d table though.
The way you are doing it works but using the focusable condition in the item widget is a cleaner way. Then you don't have to draw a item widget and a panel widget just but your condition in the focusable condition box of the item widget. I can't believe Ben is not using this the methods he mentions above work but require way to much effort and extra coding

Last edited by PLUCKYHD; 04-06-2011 at 10:22 AM.
Reply With Quote
  #13  
Old 04-06-2011, 10:21 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by PLUCKYHD View Post
Correct if you loOk at your elements I'm the table they get ordered in the same way

right it the same as the order you see your elements in
Sorry bialio, I don't mean to take over your thread.

So basically if I use my method 2 from above and do what bialio suggested and manually place my items in panels outside of the table and in multiples of 3 it will work?
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #14  
Old 04-06-2011, 10:24 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by jaminben View Post
Sorry bialio, I don't mean to take over your thread.

So basically if I use my method 2 from above and do what bialio suggested and manually place my items in panels outside of the table and in multiples of 3 it will work?
See above post to bialo. If you are manually placing your items you don't need a table...
Reply With Quote
  #15  
Old 04-06-2011, 10:30 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by PLUCKYHD View Post
See above post to bialo. If you are manually placing your items you don't need a table...
Ok, I see what you mean.... but that would mean quite alot of calculation to get the correct element in the correct place where as using theGetDataFromTableFocused would do all that for you or am I missing the point?

Either way I can't be arsed to make a wall which would work like that at this point as it would take alot of time getting the animations to work nicely for each panel.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #16  
Old 04-06-2011, 10:50 AM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
Quote:
So basically if I use my method 2 from above and do what bialio suggested and manually place my items in panels outside of the table and in multiples of 3 it will work?
So that's not necessarily what I suggested

I have it like this (in this example we've got a cover flow type table - 5 items on screen, fixed focus at location 2):
Code:
Array
     Table
           Cell
                 Panel
                      if (TableRow - HScrollIndex)
                            > 2
                                Item
                                     Panel2 (has any UI elements in it)
                                     Action Chains
                                     Hooks etc
                            > else
                                Panel2 (link to Panel2)
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient

Last edited by bialio; 04-06-2011 at 10:53 AM.
Reply With Quote
  #17  
Old 04-06-2011, 11:07 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by bialio View Post
So that's not necessarily what I suggested
Thats not the bit I was referring to.... I ment the bit where you said about doing it like:

0 1 2
3 4 5
6 7 8

Not that it matters as it would be way to much work to get it looking good.

Although in saying that I do already use the example you just posted in a standard poster flow view except I pull out the focused item and place it in its own panel outside the table so it can be animated independently (poping effect without the table scroll animation) which works pretty good
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders

Last edited by jaminben; 04-06-2011 at 11:13 AM.
Reply With Quote
  #18  
Old 04-06-2011, 11:25 AM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
AH - that's a nice trick. Sometimes the animation effect of the table does get a bit old....

btl.
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #19  
Old 04-06-2011, 11:40 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by bialio View Post
AH - that's a nice trick. Sometimes the animation effect of the table does get a bit old....
Yea, agreed.....

I wouldn't actually mind having a go at making a screen for phoenix just to see how it works (although I wouldn't spend too much time on it).... thats if you ever get bored with it

I guess I could grab the SageTVPluginsDev.xml from you know where if I really wanted it (if thats the most recent version?)
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #20  
Old 04-06-2011, 11:45 AM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
It is.
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tables and animation Ikarius SageTV Studio 3 09-14-2009 05:55 AM
Creating Arrays for tables PLUCKYHD SageTV Studio 37 05-31-2009 12:12 AM
Resizing Tables bialio SageTV Studio 5 01-22-2008 01:17 PM
Troubling Tables kuch68 SageTV Studio 5 09-13-2006 01:06 PM


All times are GMT -6. The time now is 12:57 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.