Announcement

Collapse
No announcement yet.

Scrolling (other than lists)...

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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]
    Current Worklog: TBA - '05 Rav4 (Mobo Dead).
    www.rav4world.com - Forums for Rav4 owners
    www.flavorfeasts.com - Cooking website/forums
    -Basic forums live atm, come contribute!

  • #2
    Are you looking for something like this:

    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	24.5 KB
ID:	2280326

    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

    Comment


    • #3
      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, 04:25 PM.
      Current Worklog: TBA - '05 Rav4 (Mobo Dead).
      www.rav4world.com - Forums for Rav4 owners
      www.flavorfeasts.com - Cooking website/forums
      -Basic forums live atm, come contribute!

      Comment


      • #4
        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!

        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.

        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

        Comment


        • #5
          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!
          Current Worklog: TBA - '05 Rav4 (Mobo Dead).
          www.rav4world.com - Forums for Rav4 owners
          www.flavorfeasts.com - Cooking website/forums
          -Basic forums live atm, come contribute!

          Comment


          • #6
            No prob, glad to help!
            Failure is not an option...
            __________________________________________________ ______________________________
            The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

            Comment


            • #7
              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 Files
              Current Worklog: TBA - '05 Rav4 (Mobo Dead).
              www.rav4world.com - Forums for Rav4 owners
              www.flavorfeasts.com - Cooking website/forums
              -Basic forums live atm, come contribute!

              Comment


              • #8
                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

                Comment


                • #9
                  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 Files
                  Current Worklog: TBA - '05 Rav4 (Mobo Dead).
                  www.rav4world.com - Forums for Rav4 owners
                  www.flavorfeasts.com - Cooking website/forums
                  -Basic forums live atm, come contribute!

                  Comment


                  • #10
                    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, 03:35 PM.
                    Failure is not an option...
                    __________________________________________________ ______________________________
                    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

                    Comment


                    • #11
                      Using 0.8 installed on XP, c# express 2010...
                      Tried a revision about 3 weeks ago, but don't use it...

                      I've never used revisions to dev against? Tried my plugin once on a revision about 3 weeks ago (placed in skins/default/#.dll - same as I do for 0.8), it didn't show in the list for setting the main menu buttons, and I was like, oh well, I'll just keep doing what I used to because it worked.... Although, I didn't change the plugin to reflect any of the new framework/graphic dll's for the revision so maybe that's why it didn't show?

                      Anyways, could I just reference the new graphics/framework dll's if I download those from the revisions? This should provide the list style to use, but it might cause unexpected errors when trying to use it against the old framework/graphics dll's...

                      Hmm, is it worth it to keep dev'ing against 0.8? I know it's outdated but since that's the last stable release and many probably don't feel like using updated svn builds almost everyday, I figured I might as well keep going at it...
                      Current Worklog: TBA - '05 Rav4 (Mobo Dead).
                      www.rav4world.com - Forums for Rav4 owners
                      www.flavorfeasts.com - Cooking website/forums
                      -Basic forums live atm, come contribute!

                      Comment


                      • #12
                        Originally posted by detlion1643 View Post
                        Although, I didn't change the plugin to reflect any of the new framework/graphic dll's for the revision so maybe that's why it didn't show?
                        Yeah. 0.9 changed the way plugins was handled so older plugins will not work in 0.9 unless it's recompiled against 0.9 core.

                        Originally posted by detlion1643 View Post
                        Anyways, could I just reference the new graphics/framework dll's if I download those from the revisions? This should provide the list style to use, but it might cause unexpected errors when trying to use it against the old framework/graphics dll's...
                        You could try but I don't think that will work. There's been a lot of changes since 0.8.

                        Originally posted by detlion1643 View Post
                        Hmm, is it worth it to keep dev'ing against 0.8? I know it's outdated but since that's the last stable release and many probably don't feel like using updated svn builds almost everyday, I figured I might as well keep going at it...
                        I'd step up to the latest svn since that gives you way more options and your plugin will also be compatible when we release 0.9.

                        You don't have to always use the latest svn but grab the current one and compile your plugin against that one and it should work better.
                        There's quite a bit of tweaks and fixes in there (too much to list) but there might also be some bugs since the code is not officially release but it is stable enough to develop on.
                        Failure is not an option...
                        __________________________________________________ ______________________________
                        The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

                        Comment

                        Working...
                        X