NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 15 16 17 18 19 … 93 Next »
Bending ListView to my will (a variation on a theme)

 
  • 0 Vote(s) - 0 Average
Bending ListView to my will (a variation on a theme)
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#1
2011-04-11, 11:35 AM
OK, having beaten the menu UI elements into submission, it's time to move on to the list view. So, a couple of questions if I may!

Is the a view mode in which the the list item uses the full horizontal length of the element? The closest I have found is ViewMode.LIST, but that leaves 50% (as a guess, I didn't measure) to the right for whatever metadata. One if my lists is episode titles, which get quite long, and don't have much for interesting metadata. I'd like to use the available real-estate instead of truncating, if possible. If there is nothing built in, is there a base class I can inherit to make rolling my own easier?

Next, would it be possible to have get/set methods for the "first visible item index" added to the listview? When returning from a lower level, I like to recreate the list as it was, instead of repositioning the selected index to the top. For example, if the user selects "Drama" (fourth from the top) from a list of genres, views that dramatic list, then returns, I want to reselect 'drama', and put it fourth from the top again.

Of course, if this is already possible, a point in the right direction would be appreciated.

Thanks once again!
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,087
Threads: 957
Joined: May 2006
#2
2011-04-11, 12:24 PM
The ratio of list to meta views is controlled by the skin.

You set the inital list value with the second parameter
uiList.SetListObjects(itemList, Index);

You get it with uiList.GetSelectionIndex()

and you move it with uiList.SetSelectionIndex(#)

Martin
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#3
2011-04-11, 12:39 PM (This post was last modified: 2011-04-11, 12:40 PM by Ommina.)
Ugh, the skin. That makes perfect sense now that you mention it. . . ok, that crosses item one of the list then. Thanks!

As for uiList.GetSelectionIndex(), that is the selected index though - whereas what I need is the index of the first visible item. Going back to the example, the selected index will let me reselect 'drama', but without knowing the index of the top item on the list, I can't position things so drama is fourth from the top. At best I could put drama at the top and select it, but that's not how the user left the screen.

Or am I missing something?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,785
Threads: 769
Joined: Nov 2003
#4
2011-04-11, 04:58 PM
This patch adds a GetVisibleIndex(). It wont be widely available until the next release though, so be careful depending on it at this stage.
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#5
2011-04-11, 10:03 PM
sub Wrote:This patch adds a GetVisibleIndex(). It wont be widely available until the next release though, so be careful depending on it at this stage.

Thank you very much for the GetVisibleIndex. However (he adds, sheepishly), I need a SetVisibleIndex to go along with it. Right now it just taunts me with no place to store it!

And at the speed at which I'm progressing right now, I don't think there is much chance of me releasing anything to the public in the immediate future. I've learned much over the weekend, but a long way to go!
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#6
2011-04-12, 01:23 AM
I'm feeling slight pangs of guilt for the ongoing posts / requests. Please be patient with me.

Returning to item one (the view mode). I can successfully get the full length of the element by just not having a ListSelectionMetaData in the skin file, and then increasing the size attribute of ListItemNormal and ListItemSelected. This is great until I actually DO want to use the metadata element. I do want the metadata element displayed when I display a list of series titles, but not when I display the list of episode titles for a selected series.

Further, some lists use two lines of text per ListItem instead of one, meaning I need to double the height of the item.

But now I'm back to having to set the ListItemNormal element size attributes in code. (Or, I suppose, create separate skin files for the various combinations, and switch around the supplied SkinHelper. I guess that could work as a workaround. Hm.)

Please don't hate me. . .
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,785
Threads: 769
Joined: Nov 2003
#7
2011-04-12, 01:32 AM
Ommina Wrote:Thank you very much for the GetVisibleIndex. However (he adds, sheepishly), I need a SetVisibleIndex to go along with it. Right now it just taunts me with no place to store it!

And at the speed at which I'm progressing right now, I don't think there is much chance of me releasing anything to the public in the immediate future. I've learned much over the weekend, but a long way to go!
Attached. Now has SetVisibleIndex method.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,785
Threads: 769
Joined: Nov 2003
#8
2011-04-12, 01:36 AM
Ommina Wrote:I'm feeling slight pangs of guilt for the ongoing posts / requests. Please be patient with me.

Returning to item one (the view mode). I can successfully get the full length of the element by just not having a ListSelectionMetaData in the skin file, and then increasing the size attribute of ListItemNormal and ListItemSelected. This is great until I actually DO want to use the metadata element. I do want the metadata element displayed when I display a list of series titles, but not when I display the list of episode titles for a selected series.

Further, some lists use two lines of text per ListItem instead of one, meaning I need to double the height of the item.

But now I'm back to having to set the ListItemNormal element size attributes in code. (Or, I suppose, create separate skin files for the various combinations, and switch around the supplied SkinHelper. I guess that could work as a workaround. Hm.)

Please don't hate me. . .
You'd probably need to use multiple UiList objects, with different layouts defined in the skin files, and in GetRenderList() selectively use return whichever layout you want to use.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,087
Threads: 957
Joined: May 2006
#9
2011-04-12, 02:45 AM
sub Wrote:Attached. Now has SetVisibleIndex method.


So if I understand this SetVisibleIndex is the first item showing and SetSelectionIndex is the menu selection. To override defaults I expect will be very important to read the number of rows from the skin in case a skin changes things and also plan for changes from icon/list/wall modes.

Martin
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#10
2011-04-12, 02:49 AM
sub Wrote:You'd probably need to use multiple UiList objects, with different layouts defined in the skin files, and in GetRenderList() selectively use return whichever layout you want to use.

First - thanks for the SetVisibleIndex().

Second - I will go with the multiple UiList objects. I actually prefer it since it lets me switch between views conveniently, although I'm mildly worried about the proliferation of xml files for the various combinations. We'll see how it goes, thank you for your help!
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  That listview Fade Effect Ommina 0 1,348 2011-04-26, 11:42 PM
Last Post: Ommina
  Bending ButtonStrip to my will - Setting button attributes at runtime Ommina 7 3,350 2011-04-10, 04:43 PM
Last Post: sub
  Cape-City's myHTPC Theme / Skin for GB-PVR Cape-City 5 2,334 2005-09-28, 08:14 PM
Last Post: nitrogen_widget
  Scan Theme fini 15 5,538 2004-12-01, 08:24 AM
Last Post: blader_se
  new theme fini 42 13,116 2004-11-25, 01:14 AM
Last Post: fini
  Here A pic Of Spiderman Skin theme.. darrin75 1 1,863 2004-11-22, 07:06 AM
Last Post: darrin75

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode