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 »
Multiple views for a single list

 
  • 0 Vote(s) - 0 Average
Multiple views for a single list
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#1
2011-04-16, 08:27 AM
UiList has three views: "list", "horizontal_icon" and "covers", with each type being controlled via the skin.

How can I expand this and have multiple views within each type? Eg, Videos gives you a list down the left-hand side of the screen. What if I wanted that *and* another view that was a list down the right-hand side.

I'm assuming it'll be via multiple skins, but can you (and how do you) switch between them dynamically at runtime (when the user would press "view")?

Iain
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#2
2011-04-16, 05:07 PM
Quote:I'm assuming it'll be via multiple skins, but can you (and how do you) switch between them dynamically at runtime (when the user would press "view")?
Yes, you'd need multiple skin files.

You'd do something like:

SkinHelper skinHelper1 = new SkinHelper("myplugin\\skin1.xml");
SkinHelper skinHelper2 = new SkinHelper("myplugin\\skin2.xml");

UIList uiList1 = new UiList(this, "View", "Item", new Hashtable(), skinHelper1, UiList.ViewMode.LIST);
UIList uiList2 = new UiList(this, "View", "Item", new Hashtable(), skinHelper2, UiList.ViewMode.LIST);

In your GetRenderList() method, you can add one or both.

List<UiElement> renderList = new List<UiElement>();
if (showingFirstList)
renderlist.AddRange(uiList1.GetRenderList());
if (showingSecondList)
renderlist.AddRange(uiList2.GetRenderList());
....etc...
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#3
2011-04-16, 05:21 PM
Thanks.

I can imagine things being awkward with two list objects though. Could you do it with a single list that gets re-constructed whenever the view changes (and is therefore given a different skinhelper)? Or would that cause problems with the list forgetting what was selected and so on? But I'd guess you'd have that problem with two different lists as well. Maybe the new get/set visibleIndex stuff you added recently would help there...

Iain
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#4
2011-04-16, 05:34 PM
Sure, you could reconstruct the list object when the user selected a different view if you preferred to do it that way.

uiList.Dispose();
skinHelper = new SkinHelper("myplugin\\skin2.xml");
uiList = new UiList(this, "View", "Item", new Hashtable(), skinHelper, UiList.ViewMode.LIST);
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#5
2011-04-16, 05:45 PM
Ok, that sounds good. Thanks.

One last question if you don't mind: this plugin is extending NewStyleButtonListPlugin, but when the focus changes to the button strip (via "Home" or "Left" for example) I can't get focus back to the list with "Down" like your Videos/Pictures/etc ones do. Is there something special I need to do to make that happen?

Iain
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#6
2011-04-16, 05:52 PM
imilne Wrote:One last question if you don't mind: this plugin is extending NewStyleButtonListPlugin, but when the focus changes to the button strip (via "Home" or "Left" for example) I can't get focus back to the list with "Down" like your Videos/Pictures/etc ones do. Is there something special I need to do to make that happen?
You shouldn need to do anything special. Are you overriding the ButtonStripCallback method? If so, you probably need to make sure you're calling the base.ButtonStripCallback(...)
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#7
2011-04-16, 06:44 PM
sub Wrote:You shouldn need to do anything special. Are you overriding the ButtonStripCallback method? If so, you probably need to make sure you're calling the base.ButtonStripCallback(...)

Ah, that did it. Cheers.

Iain
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#8
2011-04-16, 07:33 PM
Great.
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#9
2011-04-17, 05:26 AM
sub Wrote:Yes, you'd need multiple skin files.

You'd do something like:

SkinHelper skinHelper1 = new SkinHelper("myplugin\\skin1.xml");
SkinHelper skinHelper2 = new SkinHelper("myplugin\\skin2.xml");

Related to that -- are you opposed on principal to allowing the element name to be specified in the constructor, like we do with other UI controls? I was up to six different skin files, before resorting to dangerous Black Magic to make things work with one; making the same edit across multiple files isn't fun. Being able to indicate the element names at object creation would remove a lot of pain.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#10
2011-04-19, 12:00 PM
That was my original intention, and from memory is the case with the covers view, but I didnt get around to implementing it with the two later views. I can try to add this for the next release.
« 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
  is there a service?method which returns listings for multiple channels? reven 16 6,793 2022-04-11, 04:30 PM
Last Post: mandai
  Channels List by Channel Group Name scJohn 1 2,729 2018-01-05, 10:45 PM
Last Post: mvallevand
  Channel List (native controller) psycik 2 3,021 2017-06-19, 09:14 AM
Last Post: psycik
  Possible to have another element in details-single.xml Northpole 2 2,188 2014-07-11, 09:51 PM
Last Post: Northpole
  Multiple genres in npvr.db3 bgowland 5 2,813 2013-04-16, 09:53 PM
Last Post: ACTCMS
  List of "IEventNotification" events? reven 8 3,326 2012-11-01, 10:56 PM
Last Post: reven
  Multiple lists like in Search Screen cncb 7 3,216 2012-08-08, 09:11 PM
Last Post: cncb
  Building a list of files in media folders (npvr Music and Videos) bgowland 2 1,847 2012-02-05, 10:29 AM
Last Post: bgowland
  Update NewSyleListPlugin Button list dynamically? psycik 2 1,713 2011-12-22, 12:25 AM
Last Post: mvallevand
  Single row horizontal list in popup? cncb 4 2,152 2011-09-28, 09:48 PM
Last Post: cncb

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

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

Linear Mode
Threaded Mode