[Approved] - fadelabel text wrapping and button control with fadelabel (new features)

Discussion in 'Archive' started by ajp8164, July 17, 2009.

  1. ajp8164

    ajp8164 Portal Pro

    Joined:
    January 9, 2008
    Messages:
    575
    Likes Received:
    583
    Gender:
    Male
    Occupation:
    Consulting Software Engineer
    Location:
    Atlanta, GA
    Ratings:
    +584 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    This patch offers the following two new features. I developed them together to meet a single (combined) objective and so I will only offer a single patch ;-) The features are:

    1. Fade label text wrap around feature - allows the fade label to scroll continuously without a break (back filling of spaces). This feature is very useful in combination with the recently released MPInfoService for RSS feeds.
    2. Button control with fade label feature - allows the button control to use a fade label instead of a (standard) label. This feature allows a long text string to scroll in a short (width) button control. When used in combination with the fade label wrap around feature the button will never be blank (as would happen with the default behavior of the fade label.
    This patch is designed to *not* affect existing control behaviors (i.e., it is backward compatible).

    Button control changes - this patch gives the button control the following new skin attributes

    scrollStartDelaySec - specifies the amount of time, in seconds, until text scrolling starts once the button *receives focus*. Obtaining focus is the trigger to start consideration for scrolling (otherwise all buttons on the screen might scroll at the same time = very annoying). If scrollWrapString is not specified then the fadelabel in the button control behaves as a "legacy" fadelabel (no text wrapping).
    scrollWrapString - specifies two things; (a) that the fade label should wrap text back to front and, (b) the text string that should be used to join the back of the label to the front. If you want text to wrap around you must specify at least one character (e.g., a space). An empty string turns off wrapping behavior. This attribute has no effect if scrollStartDelaySec < 0.

    Fade label control changes - this patch gives the fadelabel control the following new skin attributes



    wrapString - identical behavior to the button control scrollWrapString attribute.

    Up down Button control changes - this patch gives the up down button control the same behavior as the button control (since the up down button control inherits from button control).

    Example:

    In the attached image a button control is defined by the transparent rectangle. The button control text is the longer, light-blue text (being scrolled). Notice the " | " before the word "LONG" - this is the value of the scrollWrapString attribute on the button control. The skin code for this button follows. Incidentally, the TV icon and "TV" label are simply overlays defined in other controls.

    [​IMG]

    Code (Text):
    1.             <control>
    2.                 <description>tv settings button</description>
    3.                 <type>button</type>
    4.                 <id>1001</id>
    5.                 <label>LONG DESCRIPTION GOES HERE FOR THESE SETTINGS</label>
    6.                 <font>h3</font>
    7.                 <textXOff>90</textXOff>
    8.                 <textYOff>50</textYOff>
    9.                 <textcolor>#buttonDescTextColor</textcolor>
    10.                 <textcolorNoFocus>#buttonDescTextColor</textcolorNoFocus>
    11.                 <textureFocus>list-nofocus.png</textureFocus>
    12.                 <textureNoFocus>-</textureNoFocus>
    13.                 [B]<scrollStartDelaySec>1</scrollStartDelaySec>
    14.                 <scrollWrapString> | </scrollWrapString>[/B]
    15.                 <width>600</width>
    16.                 <height>96</height>
    17.             </control>
     

    Attached Files:

    • Like Like x 2
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. misterd
    • Team MediaPortal

    misterd Retired Team Member

    Joined:
    April 4, 2006
    Messages:
    1,597
    Likes Received:
    280
    Ratings:
    +298 / 0
    Home Country:
    Germany Germany
    Added the patch to SVN.

    :D

    MisterD
     
    • Like Like x 1
  4. Dadeo
    • Team MediaPortal

    Dadeo Docs Group Manager

    Joined:
    November 26, 2006
    Messages:
    5,340
    Likes Received:
    2,802
    Location:
    Himalayas, India
    Ratings:
    +3,053 / 0
    Home Country:
    Canada Canada
    Show System Specs
    Another great one ajp8164! You have saved us tons of headaches. aMPed is designed for users with smaller screens and can be used with large fonts (18pt) so sometimes text is too long for the buttons. You have saved the day for us! Thank you so much for doing patches for skinners!

    Any chance of also fixing the hardcoded height of fadelabels? Sorry I don't have the knowledge to do it myself. As Pileave reported in https://forum.team-mediaportal.com/bugreports-74/fadelabels-cut-off-bottom-text-67694/ In line 417 in GUIFadeLabel.cs in SVN, there is a hardcoded height of 60.

    One more request, if you are taking requests that is :) Is there any way you can enable text to align vertically on buttons? If there was a aligny tag that could be used to center text vertically on a button, or even in listcontrols, then text would look good no matter what font size a user selects.

    At present you can only use textYOff tags and a separate references.xml file for each font size is required for text to look good on buttons and listcontrols.

    Of course, it would be awesome if such a tag could be used everywhere that the align tag can, but I don't want to ask for too much. LOL
     
  5. tourettes
    • Team MediaPortal

    tourettes Retired Team Member

    Joined:
    January 7, 2005
    Messages:
    17,301
    Likes Received:
    4,595
    Ratings:
    +4,810 / 3
    Please keep this part of the forum clean (no feature request or anything similar!). If this forum gets crowded it reduces the team developers interest into checking the patches (and that is not a good thing).

    So, please start a improvement suggestion post instead. It will be our all bes tinterest.
     
  6. Dadeo
    • Team MediaPortal

    Dadeo Docs Group Manager

    Joined:
    November 26, 2006
    Messages:
    5,340
    Likes Received:
    2,802
    Location:
    Himalayas, India
    Ratings:
    +3,053 / 0
    Home Country:
    Canada Canada
    Show System Specs
  7. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,457
    Likes Received:
    4,241
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,385 / 0
    Home Country:
    Australia Australia
    Just had a quick test and noticed that:

    1. The defined 'WrapString' is displayed at the end of the label even though a scroll is not required e.g. "test is a test |"
    2. Its also not continuously scrolling.
    3. The space " | " is trimmed at the end e.g. "this is a test |this is a test"

    Surely I must be doing something wrong as that would of been noticed.
     
  8. ajp8164

    ajp8164 Portal Pro

    Joined:
    January 9, 2008
    Messages:
    575
    Likes Received:
    583
    Gender:
    Male
    Occupation:
    Consulting Software Engineer
    Location:
    Atlanta, GA
    Ratings:
    +584 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    On (1.), you are right about the wrapString is being displayed when scrolling is not needed. I have a patch for that waiting to be posted (I am waiting for some of my patches to get into svn because I have several that overlap and it's getting complicated for me to keep them straight for posting).

    Not sure what you mean in (2.) and (3.) Could you please elaborate? Thanks!
     
  9. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,457
    Likes Received:
    4,241
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,385 / 0
    Home Country:
    Australia Australia
    2) When the fade label scrolls the text it will stop and start again. I expect it to continuously scroll without restarting, similar to how an item in the List Facade scrolls when there is not enough room.

    3) I have attached a picture to illustrate, what you see is that there is no space proceeding the separator string "|"
     

    Attached Files:

    • 15-06-44.jpg
      15-06-44.jpg
      File size:
      12.7 KB
      Uploaded:
      August 7, 2009
      Views:
      114
  10. ajp8164

    ajp8164 Portal Pro

    Joined:
    January 9, 2008
    Messages:
    575
    Likes Received:
    583
    Gender:
    Male
    Occupation:
    Consulting Software Engineer
    Location:
    Atlanta, GA
    Ratings:
    +584 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    Okay, I understand your question (2.) - this is the intended design for this feature. Once the text wraps back around to the beginning it stalls scrolling for the specified delay seconds time and then starts again. I can look into what it will take to avoid the scroll delay time if you would like.

    On (3.), could yo please post your skin xml file. I cannot seem to replicate this behavior.

    Thanks!
     
  11. ltfearme
    • Premium Supporter

    ltfearme Community Plugin Dev

    Joined:
    June 10, 2007
    Messages:
    6,457
    Likes Received:
    4,241
    Gender:
    Male
    Occupation:
    Software Test Engineer
    Location:
    Sydney
    Ratings:
    +5,385 / 0
    Home Country:
    Australia Australia
    I think it would be a nice addition to atleast have the option to override it on the control e.g. <continousScroll>true</continuousScroll>. This could default to off.

    I can't reproduce this at home either, will try again at work and will report back if I can.

    Thanks
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!