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 02-01-2011, 02:27 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Setting DefaultFocus for large list?

How do you set the DefaultFocus for a very large list. In playing around with that it looks like it only apply to the subset of list items currently displayed on the screen?

For example say I have a list of numbers 1-10, but only 5 are showed on the screen at a time. How do I set the default focus to be 7?
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma
Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire
SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT


Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink)
Reply With Quote
  #2  
Old 02-01-2011, 02:47 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Look into the MenuNeedsDefaultFocus hook and/or use SetFocusForVariable("VarName", value) for the table item to receive focus.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #3  
Old 02-01-2011, 03:19 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
I prefer doing it slightly differently, mainly because I like to be able to re-use the same method for other items which need to gain focus at various times in my screens.

Code:
FocusItem = GetDataFromTableVisiblePosition(GetUIComponentForVariable("UIValue", "MediaFiles"), 0, true)
     EnsureVisibilityForVariable("MediaItem", FocusItem, 0)
          SetFocusForVariable("MediaItem", FocusItem)
Where 0 in the first line gets the item I want to focus and "MediaItem" is the table compenent.

Just an alternative to Andys method.
__________________
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
  #4  
Old 02-01-2011, 03:36 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
And a harder way
Reply With Quote
  #5  
Old 02-01-2011, 03:42 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Can't be that hard if I managed to work it out.... he's still going to have to use two out of those three lines so one additional one isn't going to make too much difference.

__________________
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
  #6  
Old 02-01-2011, 03:51 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by jaminben View Post
Can't be that hard if I managed to work it out.... he's still going to have to use two out of those three lines so one additional one isn't going to make too much difference.

you don't have to use ensure focus only you want it in a certain spot. SetFocus will scroll the table if the item isn't visible
Reply With Quote
  #7  
Old 02-01-2011, 03:56 PM
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
you don't have to use ensure focus only you want it in a certain spot. SetFocus will scroll the table if the item isn't visible
You sure about that? SetFocus as far as I know will only focus items that are actually visable on screen at that time.....so seeing as his table is 5 items long and he needs to focus item 7 he's going to have to use EnsureFocus to make sure the item is visable before he can SetFocus to that item.

I think anyway
__________________
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
  #8  
Old 02-01-2011, 04:15 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by PLUCKYHD View Post
SetFocus will scroll the table if the item isn't visible
Quote:
Originally Posted by jaminben View Post
You sure about that?
Yes - it is in the API docs and is how I use it.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #9  
Old 02-01-2011, 04:17 PM
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 Opus4 View Post
Yes - it is in the API docs and is how I use it.
Ok, that put me in my place then
__________________
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
  #10  
Old 02-01-2011, 04:25 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by jaminben View Post
Ok, that put me in my place then
Come on Andy you know Ben doesn't RTFM
Reply With Quote
  #11  
Old 02-01-2011, 04:31 PM
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
Come on Andy you know Ben doesn't RTFM
Hmmm, there's a manual? Where's that then?

__________________
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
  #12  
Old 02-01-2011, 06:30 PM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by PLUCKYHD View Post
SetFocus will scroll the table if the item isn't visible
Quote:
Originally Posted by jaminben View Post
You sure about that? SetFocus as far as I know will only focus items that are actually visable on screen at that time.....
Quote:
Originally Posted by Opus4 View Post
Yes - it is in the API docs and is how I use it.
what about if your trying to set focus to a scollable panel with lots of item widgets in it but not a table? This doesn't seem to work. The focus gets set to the correct item widget but the panel does not scroll to make it visible... If i arrow down (I am trying to set focus to the first item in the vertically scrollable panel when i am displaying the bottom of the list) then the panel scrolls and i can see the focused item....

EDIT: If I issue a SageCommand("Down"), then a SageCommand("Up") after the SetFocusForVariable(), i can work around it without any real noticable effects....
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer

Last edited by razrsharpe; 02-01-2011 at 06:36 PM.
Reply With Quote
  #13  
Old 02-01-2011, 07:05 PM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
Quote:
Originally Posted by jaminben View Post
You sure about that? SetFocus as far as I know will only focus items that are actually visable on screen at that time.....so seeing as his table is 5 items long and he needs to focus item 7 he's going to have to use EnsureFocus to make sure the item is visable before he can SetFocus to that item.

I think anyway
My experience is aligned with jaminben - I almost always have to ensure visibility in order for focus things to work. But I don't have plain vanilla tables that are filled with buttons (only) for each cell, so maybe that's it.

btl.
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #14  
Old 02-01-2011, 07:47 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by bialio View Post
My experience is aligned with jaminben - I almost always have to ensure visibility in order for focus things to work. But I don't have plain vanilla tables that are filled with buttons (only) for each cell, so maybe that's it.

btl.
Doesn't matter what the table is filled with it should scroll. I have seen the issue with panels like Razor but my tables allows scroll. The ensure is only used to set a certain position.
Reply With Quote
  #15  
Old 02-01-2011, 09:00 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
About the only time I use EnsureVisibilityForVariable() is when I want an item to be in a specific location in the table; otherwise, SetFocusForVariable() should scroll the to-be-focused item into view if it isn't already in view.

I confirmed how this is supposed to work, so if you have an example of code where it isn't working, you should look into submitting it to SageTV.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #16  
Old 02-01-2011, 09:10 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by Opus4 View Post
About the only time I use EnsureVisibilityForVariable() is when I want an item to be in a specific location in the table; otherwise, SetFocusForVariable() should scroll the to-be-focused item into view if it isn't already in view.

I confirmed how this is supposed to work, so if you have an example of code where it isn't working, you should look into submitting it to SageTV.

- Andy
I found in most cases when it doesn't work you aren't passing the right variables at least for me that was the issue.
Reply With Quote
  #17  
Old 02-02-2011, 11:56 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
If I get time over the weekend I will knock together an STVi for Sage to test because like bialio and by the sounds of it evilpenguin its not doing what its supposed to do. Sometimes I can get it too work but the majority of the time it doesn't unless the item I want to focus is on-screen at the time.

I'm glad I'm not the only one that has had problems with this and its the reason I was convinced I needed to use an EnsureVisability, I can even remember sending Plucky a screen shot of my code to check and by all accounts he said it should work....but it didn't.
__________________
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
  #18  
Old 02-02-2011, 12:23 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by jaminben View Post
If I get time over the weekend I will knock together an STVi for Sage to test because like bialio and by the sounds of it evilpenguin its not doing what its supposed to do. Sometimes I can get it too work but the majority of the time it doesn't unless the item I want to focus is on-screen at the time.

I'm glad I'm not the only one that has had problems with this and its the reason I was convinced I needed to use an EnsureVisability, I can even remember sending Plucky a screen shot of my code to check and by all accounts he said it should work....but it didn't.
If you are constricting focus to a center or something it won't work.
Reply With Quote
  #19  
Old 02-02-2011, 12:26 PM
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
If you are constricting focus to a center or something it won't work.
No, it was just a general focus for an item in a table list not a fixed focus for a menu item.

EDIT

Of course the quick test menu I just made worked fine...I'll have to see if I can remember what I was doing before where it wouldn't 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

Last edited by jaminben; 02-02-2011 at 12:34 PM.
Reply With Quote
  #20  
Old 02-19-2011, 07:32 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
I've come across my problem again with SetFocusForVariable() and am looking for some guidance. I've attached two screenshots, one shows the item I want to focus being on the screen at the time I push the button... this works. The next screenshot shows the item not on screen at the time I push the button and it doesn't work.

How can I get my table to scroll to the correct position / item? You'll have the ignore the CreateArray as that's just for demonstrating what I want to do.... the normal data which feeds my table (an Array of Hash's) just doesn't work which is why I thought about using an Attribute widget with TableRow as the Value and trying to reference this for the SetFocus.
Attached Images
File Type: jpg Set Focus 1.jpg (72.5 KB, 262 views)
File Type: jpg Set Focus 2.jpg (73.2 KB, 255 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

Last edited by jaminben; 02-19-2011 at 07:46 AM.
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
triangles are too large.. drewg SageTV Beta Test Software 2 11-03-2010 12:47 PM
Large Info Thumbnails benjamintm SageMC Custom Interface 3 09-03-2008 12:19 AM
Large Music Library groggory SageTV Media Extender 3 05-06-2008 06:18 AM
"DefaultFocus" not working any more dflachbart SageTV Studio 1 03-05-2008 09:52 PM
Large Recording Stutter Goodspike SageTV Software 0 08-27-2006 07:38 AM


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.