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

ajp8164

Portal Pro
January 9, 2008
575
1,166
Atlanta, GA
United States of America United States of America
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.



Code:
			<control>
				<description>tv settings button</description>
				<type>button</type>
				<id>1001</id>
				<label>LONG DESCRIPTION GOES HERE FOR THESE SETTINGS</label>
				<font>h3</font>
				<textXOff>90</textXOff>
				<textYOff>50</textYOff>
				<textcolor>#buttonDescTextColor</textcolor>
				<textcolorNoFocus>#buttonDescTextColor</textcolorNoFocus>
				<textureFocus>list-nofocus.png</textureFocus>
				<textureNoFocus>-</textureNoFocus>
				[B]<scrollStartDelaySec>1</scrollStartDelaySec>
				<scrollWrapString> | </scrollWrapString>[/B]
				<width>600</width>
				<height>96</height>
			</control>
 

Attachments

Dadeo

Docs Group Manager
  • Premium Supporter
  • November 26, 2006
    5,340
    3,321
    Himalayas, India
    Canada Canada
    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
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    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.
    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.
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,700
    7,084
    Sydney
    Australia Australia
    Country flag
    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.
     

    ajp8164

    Portal Pro
    January 9, 2008
    575
    1,166
    Atlanta, GA
    United States of America United States of America
    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.
    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!
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,700
    7,084
    Sydney
    Australia Australia
    Country flag
    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 "|"
     

    Attachments

    ajp8164

    Portal Pro
    January 9, 2008
    575
    1,166
    Atlanta, GA
    United States of America United States of America
    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!
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,700
    7,084
    Sydney
    Australia Australia
    Country flag
    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.
    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.

    On (3.), could yo please post your skin xml file. I cannot seem to replicate this behavior.
    I can't reproduce this at home either, will try again at work and will report back if I can.

    Thanks
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    Top Bottom