Results 1 to 8 of 8

Thread: How to create a list

  1. #1
    Maximum Bitrate
    Auto Apps:loading...
    lambosprit's Avatar
    Join Date
    Sep 2006
    Location
    UK
    Posts
    809

    How to create a list

    My skype plugin lists the friends you have and in RR their on line status as an icon. How would I create a list in OM and is it possible to link an icon to each row in the list? If not what ways might I implement this? I can't see anything listed in the online documentation.

    Also do i create this list for skins to use as per RR or do I have to define the skin use as well? I think I'm getting confused about the difference between a data provider and a skin plugin. I feel mine is both but not sure.

  2. #2
    Raw Wave
    Auto Apps:loading...
    justchat_1's Avatar
    Join Date
    Jul 2008
    Location
    Boston, Ma or NY,NY
    Posts
    2,359
    I think yours is a skin and a bluetooth plugin if i remember right. The skin just displays some of the bluetooth data.

    The list component in OM is called OMList and can display pretty much anything you've seen in rr or cf by changing around some of its properties. What you describe is just an imageList style (theres a style property) which displays a line of text and an icon. You could also do a multi line style which displays two lines or text for each icon or other various combinations. A list displays OMListItem's which you can add. Each OMListItem has fields for things like text, color, font, image (the icon you were mentioning) and even sort strings and subitems.

  3. #3
    Maximum Bitrate
    Auto Apps:loading...
    lambosprit's Avatar
    Join Date
    Sep 2006
    Location
    UK
    Posts
    809
    Quote Originally Posted by justchat_1 View Post
    I think yours is a skin and a bluetooth plugin if i remember right. The skin just displays some of the bluetooth data.

    The list component in OM is called OMList and can display pretty much anything you've seen in rr or cf by changing around some of its properties. What you describe is just an imageList style (theres a style property) which displays a line of text and an icon. You could also do a multi line style which displays two lines or text for each icon or other various combinations. A list displays OMListItem's which you can add. Each OMListItem has fields for things like text, color, font, image (the icon you were mentioning) and even sort strings and subitems.
    I'm talking about my skype plugin. In RR it provides a list of friends with on line status which it sounds like you support. I found some code in the contacts plugin but dont know how I link to the list.

    I assume I create one in the initialise function. But how would I refer to it when I want to refresh it? The line dim l As OMList = (OMList)manager[screen][0]
    seems relevent but vb doesn't like it. Can you explain what its doing?

    this is the code I have for the refresh sub. Its the first line vb doesn't like

    dim l As OMList = (OMList)manager[screen][0]
    'start by clearing the current custom list
    l.Clear()
    'RR_Execute("CLCLEAR;ALL")
    currClType = "Friends"
    For Each item In friends
    Dim img As OImage
    'RR_Execute("CLADD;" & item.Value & ";" & item.Key)
    usrToCall = item.Value
    'RR_Execute("CLSETIMG;" & i + 1 & ";" & usrStatus)
    img = OImage.FromFile(usrStatus)
    l.Add(New OMListItem(item.Value.ToString, item.Key.ToString, img))
    Next

    usrstatus returns the path to an appropriate icon.
    I would like to create 4-5 lists.

  4. #4
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    529
    Quote Originally Posted by lambosprit View Post
    Also do i create this list for skins to use as per RR or do I have to define the skin use as well?
    When you use an OMList (or any other control) then you're usually working on the skin side of things.


    Quote Originally Posted by lambosprit View Post
    I think I'm getting confused about the difference between a data provider and a skin plugin. I feel mine is both but not sure.
    A data provider would normally be one plugin that provides data for the skin plugin to layout and display to the user.
    Weather your plugin is both or not depends on where you place the separation between data and skin. As of now there is no "official" guidelines for where to separate the two. It all depends on how you're getting the data and how you're using them.

    Try to build your plugin the way you'd like for now and then we can help out in trying to separate it later. I think it might be easier to understand by taking this approach.
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

  5. #5
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    529
    Quote Originally Posted by lambosprit View Post
    I'm talking about my skype plugin. In RR it provides a list of friends with on line status which it sounds like you support. I found some code in the contacts plugin but dont know how I link to the list.

    I assume I create one in the initialise function. But how would I refer to it when I want to refresh it? The line dim l As OMList = (OMList)manager[screen][0]
    seems relevent but vb doesn't like it. Can you explain what its doing?

    this is the code I have for the refresh sub. Its the first line vb doesn't like

    dim l As OMList = (OMList)manager[screen][0]
    'start by clearing the current custom list
    l.Clear()
    'RR_Execute("CLCLEAR;ALL")
    currClType = "Friends"
    For Each item In friends
    Dim img As OImage
    'RR_Execute("CLADD;" & item.Value & ";" & item.Key)
    usrToCall = item.Value
    'RR_Execute("CLSETIMG;" & i + 1 & ";" & usrStatus)
    img = OImage.FromFile(usrStatus)
    l.Add(New OMListItem(item.Value.ToString, item.Key.ToString, img))
    Next

    usrstatus returns the path to an appropriate icon.
    I would like to create 4-5 lists.
    It's easier if you give your controls a name in the initialize method like this:
    (Code is in C#)
    Code:
    OMList myList = new OMList(225, 162, 563, 316);
    myList.Name = "myList";
    Then you can later access it like this:
    Code:
    OMList myList = (OMList)manager[screen]["myList"];
    If the code contained in the square brackets are a number instead of string then it references to the id number of the control. Where the id number is controlled by the order the controls are loaded in. It's usually easier to use named controls.
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

  6. #6
    Maximum Bitrate
    Auto Apps:loading...
    lambosprit's Avatar
    Join Date
    Sep 2006
    Location
    UK
    Posts
    809
    Quote Originally Posted by Borte View Post
    It's easier if you give your controls a name in the initialize method like this:
    (Code is in C#)
    Code:
    OMList myList = new OMList(225, 162, 563, 316);
    myList.Name = "myList";
    Then you can later access it like this:
    Code:
    OMList myList = (OMList)manager[screen]["myList"];
    that makes sense but what's "screen"? I know its a number but where do I get it from?

  7. #7
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    347
    that makes sense but what's "screen"? I know its a number but where do I get it from?
    As far as I've found out, since I've been playing with the plugin codes, anytime you created an eventhandler for a control (in OM called userInteraction), OMControl sender and int screen are always available.

    Ex)
    Code:
    OMList list = new OMList(100,100,100,100);
    list.Name = "myList";
    list.onClick += new userInteraction(list_click);
    
    private void list_click(OMControl sender, int screen); //no need to pass sender,screen it's already available
    {
    OMList list = (OMList)manager[screen]["myList"];
    //anything that consumes part of list now only shows on current screen it was clicked from
    //ex list.add("HELLO") - adds hello to the list but only for the screen in which the list was clicked
    }

  8. #8
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    529
    Quote Originally Posted by lambosprit View Post
    that makes sense but what's "screen"? I know its a number but where do I get it from?
    Screen is the actual screen that you want to access the control on. When ever something is sent from the framework (events or anything else) then the screen number that the event generated from is also sent along. This is whats known as "screen".
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

Similar Threads

  1. Release new phoco integration preview
    By Robby BMW in forum Road Runner
    Replies: 544
    Last Post: 09-12-2009, 05:29 AM
  2. What you need to know to create a skin
    By malcom2073 in forum RevFE
    Replies: 15
    Last Post: 09-04-2009, 10:37 AM
  3. Custom List creation
    By lambosprit in forum Road Runner
    Replies: 11
    Last Post: 05-12-2009, 07:46 PM
  4. Odd problem with the browser list.
    By slackervn in forum Road Runner
    Replies: 3
    Last Post: 09-10-2006, 12:38 PM
  5. "state of the art" parts list?
    By kbyrd in forum Newbie
    Replies: 13
    Last Post: 04-29-2005, 11:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •