Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: JdGordon on July 02, 2008, 11:28:08 AM

Title: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: JdGordon on July 02, 2008, 11:28:08 AM
it appears I closed the previous stick too early...

%P %pb and %m have all been changed recently so if your WPS isnt loading its most likely because of that...

http://www.rockbox.org/twiki/bin/view/Main/CustomWPS
http://www.rockbox.org/twiki/bin/view/Main/CustomWPS
http://www.rockbox.org/twiki/bin/view/Main/CustomWPS

(for the lazy)

%P and %m have been removed

%pb is now %pb|bmp|x|y|width|height| or just %pb

use viewports and conditional viewports to replace %m

For crying out loud... yes its the same link above 3 times... I could have made it 4 and I could have made it 1... I purposly chose 3... why? we'll never know, im an enigma.. but its 3, and will remain 3... which also happens to be the same amount of times its been discussed in IRC... what is so special about the number 3?
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: pondlife on July 24, 2008, 07:45:08 AM
As jswetzen said elsewhere:

Quote
The old format was:
%P|filename.bmp|
%pb|height|left-position|right-position|y-position(optional)|

and the new one is:
%pb|filename.bmp|x|y|width|height|

which means that:
x = left-position
y = y-position
width = right-position - left-position
height = height
and the filename is copied from the %P tag.

Please upload your corrected WPSes to the wiki.

pondlife
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: JdGordon on September 09, 2008, 04:40:33 AM
removed the sticky but bumping to keep this on the front page for a little while longer.
Hopefully everyone has got the point by now :p
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: mmadia on September 19, 2008, 10:00:06 PM
any chance of getting an example for rewriting a %m line in the new syntax?
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: Boofus on September 19, 2008, 10:19:00 PM
or maybe at least an explanation of what the old %m syntax was??  I can't find it anywhere in the docs.

Boo
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: Llorean on September 19, 2008, 10:39:36 PM
The CustomWPS wiki page has the new syntax, and you can view older versions of it from the controls at the bottom of the page to get back to the previous syntax.
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: BdN3504 on September 20, 2008, 10:04:12 AM
The %m teg was used to define scrolling margins.
Example:

%s%m|25|151| Disaster is coming.

This would display "Disaster is coming." beginning at 25 pixels on the left and cut it off at 151 pixels on the right and then start scrolling. This tag is obsolote because you can do scrolling with viewports now.
To get the same results, you simply have to create a viewport with similar dimensions.
E.g.:

%V|25|10|126|12|-|-|-|
%sDisaster is coming.

126=151-25

The y position of the viewport is arbitrary. You have to try out some values, to see, if the line with the %m tag is on the same level as the viewport.
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: Boofus on September 20, 2008, 06:04:41 PM
Thanks to both you, VERY much

Boo
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: mmadia on September 20, 2008, 07:36:14 PM
Thank you.   

If anyone is curious, %m Margin Tag is last documented in CutomWPS's revision #107 
http://www.rockbox.org/twiki/bin/view/Main/CustomWPS?rev=107#Margin

Now just to beat a dead horse, are the following still in use?
 Hold Switches ( %mh, %mr), 
 Repeat Mode ( %mm ), and
 Playback Mode (%mp )
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: Llorean on September 20, 2008, 08:47:41 PM
None of those were mentioned as changed.
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: mmadia on September 20, 2008, 09:14:19 PM
Gotcha.  I wanted to make sure as those tags do have a %m in them. 

( and yes, i understand now that those tags are wholly unrelated to margin tags  )
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: pixelma on October 01, 2008, 07:45:46 PM
The %m teg was used to define scrolling margins.
Example:

%s%m|25|151| Disaster is coming.

[colours changed to stress something.]

Note that this second red number (including the additional "|") was never a valid variable in official Rockbox, the "official" margin tag only let you set a left margin. There was a patch though for specifying a right margin too and it was used in some unsupported builds and themes. So you would have to caclulate with the screen width minus the left margin to get the viewports width if you have a margin tag with only the left margin specified and want to mimic this old behaviour or as maximum width.
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: karashata on October 01, 2008, 08:09:59 PM
I believe the viewports were designed to automatically assume the width and height as "LCD width - x-pos" and "LCD height - y-pos" in absence of width and height definitions...
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: kugel. on October 04, 2008, 07:21:46 AM
True, with absence being a "-" instead of a value. This also applies for the font and color parameters.
Font will be normal font (as if you've chosen 1 as value), colors will default to global settings fore- and background color.
E.g. %V|23|10|-|-|-|-|-|
Title: Re: BROKEN THEMES: CHECK %P, %pb %m AND CustomWPS wiki page
Post by: pixelma on October 11, 2008, 07:10:53 AM
I believe the viewports were designed to automatically assume the width and height as "LCD width - x-pos" and "LCD height - y-pos" in absence of width and height definitions...
Right, I'm sorry, somehow forgot about it. But calculating this for yourself can still be helpful if you want to know the maximum width or as a basis to calculate a slightly smaller viewport width... ;)

As jswetzen said elsewhere:

Quote
The old format was:
%P|filename.bmp|
%pb|height|left-position|right-position|y-position(optional)|

and the new one is:
%pb|filename.bmp|x|y|width|height|
To add: in the old format all arguments were optional, e.g. you could only specify a different height for your progress bar and the rest was taken from the default. But you had to keep the order, I mean that if you wanted only the y-position to be different, you had to specify everything else before it (height, left-position, right-position) - couldn't have worked otherwise. This is still possible with the new syntax, only that you use a "-" now, where you don't want anything else than the default. See also http://forums.rockbox.org/index.php?topic=18967.msg136930#msg136930 .