Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Scrolling (other than lists)...

  1. #1
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    343

    Scrolling (other than lists)...

    Excuse me if something like this seems basic (I am 30+ hour spree (poker/drinking) and at work atm, trying not to nod off and brain isn't the sharpest atm either)......

    As far as I know, lists can only have 1 item height (that doesn't change between items). A list also wouldn't look quite right in the area I am trying to fill with data (unless the list background is invisible and can have altering heights).

    I am gathering up a bunch of strings (2 at a time), and need to display them to the user (all at once). I'm trying not to 'cut' parts of the string with "..." or run it off the screen. The display of the strings will look something like this:
    Title (With a little bigger size)
    String below title with
    little smaller text.
    Title (With a little bigger size)
    String below title with
    little smaller text.
    .....................................

    This can continue for 1 title/string or 10 titles/strings, or even more perhaps. The hard part is none of the titles/strings are the same size/amount of chars.

    How I would do this in vb.net is to make a label for each title with certain font size. Then make a label for each title's corresponding strings (with smaller font size). Next place the first title on a panel and first string on the same panel directly underneath (using the ending coordinates of title1). I would loop through this for the amount of titles/strings there are.

    You'll notice I said I would use a panel in vb to do this. Panel's are easy to move, and all the labels would move with it as well. All the labels would have wordwrap enabled as well. Also, the panel would have the top/bottom hidden behind other controls so it would be combined within the area, but free-flow scrolling up/down to any amount to accommodate for the amount/size of titles/strings.

    As far as OM is concerned, I don't think I can make a label with wordwrap (or at least can't find the property). I know OM won't create panels other than the default size (they use panels like vb uses forms, at least that's how I understand it). It seems like an easy concept, but hard to put down in words. I'm also posting to see if I'm missing anything before I start measuring strings/controls/tons of labels/controls to hide other controls/moving tons of controls/etc... seems like a better way but I'm dumbfounded atm.

    Here's a pic of the workable area, if that helps. Can't display anything outside the gray border or left of the text that's semi appearable.
    [IMG] Uploaded with ImageShack.us[/IMG]

  2. #2
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    527
    Are you looking for something like this:

    Name:  Capture.JPG
Views: 111
Size:  24.5 KB

    This was made using the basic built in OMList control.

    Here's the code for creating the sample above:
    Code:
            OMImage Logo = new OMImage();
            Logo.Left = 600;
            Logo.Top = 150;
            Logo.Width = 300;
            Logo.Height = 300;
            Logo.Image = theHost.getSkinImage("ArtistIcon_SelectedHighlighted");
            p.addControl(Logo);
    
            OMList l = new OMList(600, 150, 300, 300);
            l.Font = new Font(Font.GenericSansSerif, 36F);
            l.Format = eTextFormat.Outline;
            l.OutlineColor = Color.Black;
            l.ListStyle = eListStyle.MultiListText;
            l.ListItemHeight = 110;
            l.TextAlignment = Alignment.TopLeft;
            l.Background = Color.Transparent;
            l.ItemColor1 = Color.Transparent;
            OMListItem.subItemFormat sf = new OMListItem.subItemFormat();
            sf.font = new Font(Font.GenericSansSerif, 20F);
            sf.textAlignment = Alignment.BottomLeft;
            sf.highlightColor = l.HighlightColor;
            l.Add(new OMListItem("Item1", "  line2\n  line3",sf));
            l.Add(new OMListItem("Item2", "  line2\n  line3", sf));
            l.Add(new OMListItem("Item3", "  line2\n  line3", sf));
            p.addControl(l);
    Basically the part splitting the second line into two lines are the "\n" newline escape character.
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

  3. #3
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    343
    LOL, is it really that easy? After getting a little nap in (thank god), I can't believe I couldn't figure that out before .

    Questions though:

    For this line...
    Code:
    l.ListItemHeight = 110;
    It looks like this
    Code:
    ("Item1", "  line2\n  line3",sf)
    is supposed to fit into the whole 110 area? So, the listitemheight would be the total height of the main item + sub items, correct?


    For this...
    Code:
    OMList l = new OMList(600, 150, 300, 300);
    ...
            l.Add(new OMListItem("Item1", "  line2\n  line3",sf));
            l.Add(new OMListItem("Item2", "  line2\n  line3", sf));
            l.Add(new OMListItem("Item3", "  line2\n  line3", sf));
    The whole list is capped at 300, in the screenshot it's missing "line3" of the 3rd set of subitems. Is the list scrollable to see that then (you can have more items than the height of the list that was set, and scrolling would see those)?

    EDIT: what a sad day http://www.msnbc.msn.com/id/42613518...me_and_courts/
    Last edited by detlion1643; 04-15-2011 at 04:25 PM.

  4. #4
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    527
    Quote Originally Posted by detlion1643 View Post
    LOL, is it really that easy? After getting a little nap in (thank god), I can't believe I couldn't figure that out before .
    Lol. That usually helps!

    Quote Originally Posted by detlion1643 View Post
    It looks like this
    Code:
    ("Item1", "  line2\n  line3",sf)
    is supposed to fit into the whole 110 area? So, the listitemheight would be the total height of the main item + sub items, correct?
    Yes. The listitemheight property sets the height of the whole item before next is shown. If you play with this and the alignment properties your layout should be good.

    Quote Originally Posted by detlion1643 View Post
    The whole list is capped at 300, in the screenshot it's missing "line3" of the 3rd set of subitems. Is the list scrollable to see that then (you can have more items than the height of the list that was set, and scrolling would see those)?
    Yes the list is scrollable like a normal list (you can even enable scrollbars) so the missing line would be shown if you scroll the list.
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

  5. #5
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    343
    Yes. The listitemheight property sets the height of the whole item before next is shown. If you play with this and the alignment properties your layout should be good.
    Pretty sure I can make it work now.

    Thanks for the help!

  6. #6
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    527
    No prob, glad to help!
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

  7. #7
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    343
    I think I just came up with an issue with the multilist. Is it possible to have 'true' left alignment for text in either the main item or sub items, or both? Seems like no matter what combination of the .alignments I try they don't make a difference.

    I remember multilist being used in the media skin, and the album art displayed on the left hand side of the list and sub items. Is the image part optional, or will the space be there whether used or not?
    Attached Images Attached Images  

  8. #8
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    527
    Not quite sure what you mean.

    If I change the background color of the list in the code I gave you all the items are aligned all the way to the left.

    Could you post your code for your list control?
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

  9. #9
    Variable Bitrate
    Join Date
    Jul 2010
    Posts
    343
    Code:
    OMList newslist = new OMList(421, 153, 400, 365);
                    newslist.ListStyle = eListStyle.MultiList;
    newslist.Font = new Font(newslist.Font, 20);
                        newslist.ListItemHeight = 100;
                        newslist.TextAlignment = Alignment.TopLeft;
                        OMListItem.subItemFormat sf = new OMListItem.subItemFormat();
                        sf.font = new Font(newslist.Font, 14);
                        sf.textAlignment = Alignment.BottomLeft;
    newslist.Add(new OMListItem(newstitle, "     " + news + "\n     " + news + "\n     " + news, sf));
    And, as you can tell from the above picture, newstitle and news are just strings.

    I've noticed that I don't have eListStyle.MultiListText, it's just eListStyle.MultiList, I wonder if that causes problems?
    Attached Images Attached Images  

  10. #10
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    527
    What version of OM are you using for dev? Latest svn?

    That list style was added on Fri Oct 22 17:14:50 in SVN rev 461
    Last edited by Borte; 04-20-2011 at 03:35 PM.
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

Page 1 of 2 12 LastLast

Similar Threads

  1. Can someone explain lists to me?
    By wkustu in forum RR Skins
    Replies: 1
    Last Post: 01-25-2011, 01:06 PM
  2. help with custom lists
    By Nomader in forum Road Runner
    Replies: 4
    Last Post: 06-23-2010, 02:29 AM
  3. Scrolling lists in carwings iPhone Style
    By miwise in forum Road Runner
    Replies: 3
    Last Post: 04-27-2010, 09:27 AM
  4. How do I use Custom Lists?
    By Sal R. in forum Road Runner
    Replies: 21
    Last Post: 11-01-2007, 09:15 AM
  5. Lists of the Playlists ...
    By -zip- in forum Road Runner
    Replies: 4
    Last Post: 09-14-2005, 05:51 PM

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
  •