NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 5 6 7 8 9 … 93 Next »
Noobie Here!

 
  • 0 Vote(s) - 0 Average
Noobie Here!
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,668
Threads: 767
Joined: Nov 2003
#21
2014-03-11, 07:10 PM
jrockow Wrote:Error Fetching Event Details:

'System.Collections.Generic.List<NUtility.ScheduledRecording>' does not contain a definition for 'CachedEventDetails' and no extension method 'CachedEventDetails' accepting a first argument of type 'System.Collections.Generic.List<NUtility.ScheduledRecording>' could be found (are you missing a using directive or an assembly reference?)

CODE: If recordings. IsNot Nothing AndAlso recordings.CachedEventDetails <> "" Then
You're trying to do it on the list of recordings (ie "List<ScheduledRecording>"), not on an individual recording in that list. You need to do it on the recording.


Quote:Error Loading New Skin Element:

Value of type 'System.Collections.Generic.List(Of NUtility.UiElement)' cannot be converted to 'NUtility.UiElement'.

Code: renderList.Insert(0, descriptionStatic.GetRenderList())
[/quote]Sorry, as mentioned - I didn't compile the code. I think it needs to be renderList.InsertRange(0, descriptionStatic.GetRenderList()).
jrockow
Offline

Senior Member

Posts: 713
Threads: 110
Joined: Nov 2005
#22
2014-03-12, 07:55 PM
sub,

Next question:
If I want to display 2 columns side by side, left side would be name of show and how many episodes have been recorded.
If you cursor right (on an item selected in the left column) the focus will change to the right hand side where the individual episodes will be displayed.
At that point I will display the subtitle, description, etc in another window.
I will also playback the shows after it has been selected in the right hand pane.

All this to say, do I need 2 different "listviews" in my skin file?
I'm stuck trying to figure out how to cursor from one column to another.

Thanx.
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,668
Threads: 767
Joined: Nov 2003
#23
2014-03-12, 08:08 PM
When you start looking at multiple lists, you're getting quite complicated, and the base class that provides a single list isn't going to help you too much. At that stage you need to start creating and managing your own lists, and the navigation etc.

You can look at the C:\Users\Public\NPVR\Skin\Default\Search\search.xml file for an example of multiple list views

some snippets of code:
Code:
private UiList listShowNames;
        private UiList listShowTimes;

Code:
private void Initialise()
        {
            ....
            // show names
            listShowNames = new UiList(this, "ShowName", "View", "Item", new Hashtable(), skinHelper, UiList.ViewMode.LIST);

            // show times
            listShowTimes = new UiList(this, "ShowTime", "View", "Item", new Hashtable(), skinHelper, UiList.ViewMode.LIST);    
            ....
        }

Code:
public List<UiElement> GetRenderList()
        {
            List<UiElement> renderList = new List<UiElement>();
            renderList.AddRange(listShowNames.GetRenderList());
            renderList.AddRange(listShowTimes.GetRenderList());
            return renderList;
        }

You'd need handle the navigation from one list to the other using the ExitLeft/ExitRight callback notifications from the UiList:
Code:
public void ExitLeft()
        {
            if (listShowNames.Selected)
            {
                listFirstLetter.Selected = true;
                listShowNames.Selected = false;
                listShowTimes.Selected = false;
            }
            else if (listShowTimes.Selected)
            {
                listFirstLetter.Selected = false;
                listShowNames.Selected = true;
                listShowTimes.Selected = false;
            }            
        }

        public void ExitRight()
        {
            if (listFirstLetter.Selected && listShowNames.GetListObjects() != null && listShowNames.GetListObjects().Count > 0)
            {
                listFirstLetter.Selected = false;
                listShowNames.Selected = true;
                listShowTimes.Selected = false;
            }
            else if (listShowNames.Selected && listShowTimes.GetListObjects() != null && listShowTimes.GetListObjects().Count > 0)
            {
                listFirstLetter.Selected = false;
                listShowNames.Selected = false;
                listShowTimes.Selected = true;
            }
        }
jrockow
Offline

Senior Member

Posts: 713
Threads: 110
Joined: Nov 2005
#24
2014-03-13, 02:50 AM
Can you give me a coding example of how I would actually write text to the ShowName and ShowTime fields.
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,668
Threads: 767
Joined: Nov 2003
#25
2014-03-13, 06:40 AM
Here is some dummy code showing the type of steps you'd do to load the list. You can load whatever attributes you want into the list items, then display them with <Text> nodes in your skin file definitions for the list items.

Code:
List<UiList.ListObject> showNames = new List<UiList.ListObject>();
foreach (ScheduledRecording recording in ScheduledRecording.LoadAll())
{
     UiList.ListItem item = new UiList.ListItem();
     item["@name"] = recording.Title;
     item["@subtitle"] = recording.Subtitle;
     ....etc....
    
     showNames.Add(item);
}

// tell list to show these items
listShowNames.SetListObjects(showNames, 0);
jrockow
Offline

Senior Member

Posts: 713
Threads: 110
Joined: Nov 2005
#26
2014-03-13, 12:52 PM
I have a question about the last statement....

If I use listShowNames.SetListObjects(showNames, 0)

I get an error when I try to run..
"Object reference not set to an instance of an object"

If I change it to uiList.SetListObjects(showNames, 0)
it runs OK, but I don't get any text to appear in the field.
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,668
Threads: 767
Joined: Nov 2003
#27
2014-03-13, 04:48 PM
jrockow Wrote:I have a question about the last statement....

If I use listShowNames.SetListObjects(showNames, 0)

I get an error when I try to run..
"Object reference not set to an instance of an object"
It sounds like you've tried to call SetListObjects() before you've created it (listShowNames).
jrockow
Offline

Senior Member

Posts: 713
Threads: 110
Joined: Nov 2005
#28
2014-03-13, 06:20 PM
I created my left hand column list, but I don't appear to have any cursor control; i.e. UP, DOWN, etc.
Do I need to code those? If so, can you give me an example.

Also, the button list at the top of my old Test3 form is not showing up any longer.
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,668
Threads: 767
Joined: Nov 2003
#29
2014-03-13, 06:37 PM
The NewStyleButtonListPlugin base class, which that Test3 plugin uses, provides all this for developers only needing a single list. As mentioned, when you start to have custom layouts, like multiple lists etc, they you pretty much need to do this stuff manually.

This means passing events to any controls you've created. For example, something like:
Code:
public override bool OnKeyDown(KeyEventArgs e)
{
     bool handled = Base.OnKeyDown(e);
     if (listShowNames.Selected)
     {
           handled = listShowNames.OnKeyDown(e);
     }
     else if (listShowTimes.Selected)
     {
           handled = listShowTimes.OnKeyDown(e);
     }
     return handled;
}
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,668
Threads: 767
Joined: Nov 2003
#30
2014-03-13, 06:38 PM
Quote:Also, the button list at the top of my old Test3 form is not showing up any longer.
Your GetRenderList() probably needs:
Code:
renderList.AddRange(uiButtonStrip.GetRenderList());
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (17): « Previous 1 2 3 4 5 … 17 Next »
Jump to page 


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

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

Linear Mode
Threaded Mode