Page 1 of 1

Width - Keeping all your characters in line

Posted: February 26th, 2006, 6:50 am
by ReverseEngineered
link: width-1.0.zip

That's right, another plugin fresh out of the linker. This is another one from my "string" library that I am developing.

What this plugin does is allow you to format a string such that it takes up an exact width. This can be done by filling in the extra spaces with a character of your choice, or optionally by truncating larger strings to fit. You can choose how the text should be justified within the field (left, right, or center), what character to use to fill (a space, by default), whether or not to truncate long lines, and most importantly, the width to make it.

Where might you use this? Well, I like the default Screen 2, except for a few things. For one, as the percentages vary between 1 and 3 digits, they shift all over the place. Normally numbers like that are right justified within a column, but there's no way to do this in Smartie: the most we have is using $Fill to make sure the bar graphs don't move as this happens.

Well, now you can control this perfectly! Use it to make columns, even stretching between lines, that line up perfectly and exactly how you want them. You could even use this to make cool effects (perhaps you want every blank space to actually be a block, or a custom character).

The most important thing you can do with an LCD is display text on it. The second most important thing is to make it look nice, and that's what Width is for. What's your Width?

Posted: December 29th, 2007, 3:11 am
by shinobi_h2o
Dude, thank you very much!!

I was looking for this plugin, according to this post: http://forums.lcdsmartie.org/viewtopic. ... 3207#13207


This is exactly what I need!!
Thanks a lot, bro!

Keep up the good work! =))

Re: Width - Keeping all your characters in line

Posted: February 23rd, 2012, 11:39 pm
by 5teviewonders
This would be really handy. Anyone have a copy they could repost or know of an alternative?

Re: Width - Keeping all your characters in line

Posted: July 29th, 2014, 8:26 pm
by Bill
I could also really use this plugin. Does anyone have a copy?

Re: Width - Keeping all your characters in line

Posted: July 31st, 2014, 12:37 pm
by dperrow
Don't have a copy of width but this might do what you need.
Scroll.zip
unzip the dll into your smartie plugins folder.

It's called scroll and has 3 functions:

Scrolling area function and fixed width area function

Function 1 - param 1 = id#width, param2=text (different id's allows multiple scroll areas)
Function 2 - param 1 = width#justification#susbt, param2=text
justification (optional)=NONE,LEFT,RIGHT,CENTRE,CENTER (default is left)
subst (optional) default is space and is the character to substitute for filler
Function 20- Returns the version number of this code

e.g. for a fixed with area of 10 characters with characters centred in the area use:

$dll(scroll,2,10#CENTER,some text)

Hope this helps.

Re: Width - Keeping all your characters in line

Posted: August 1st, 2014, 9:52 pm
by Bill
Looks like it should work. I'll give it a try.

BTW, I didn't see this on the forum anywhere. However I did see another scroll.dll. (Swap, Scroll and If plugins)
I'm new to the forum, but this seems a little confusing and disorganized to me.

Re: Width - Keeping all your characters in line

Posted: August 1st, 2014, 10:23 pm
by dperrow
You wouldn't find it because I only wrote it yesterday!

The plugins are generally developed and donated by users so there will be a bit of disorganisation, duplication etc.