Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

How to invert bar display ?

Discuss anything to do with plugins

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Post Reply
furioussgamer
Posts: 25
Joined: February 15th, 2010, 10:57 am

How to invert bar display ?

Post by furioussgamer »

Hello, i'm looking to a way to invert a bar display. For example, the CPUUsage bar start from left to right. How to display it from right to left ?

hydrolisk1792
Site Admin
Posts: 305
Joined: July 23rd, 2010, 8:32 pm
Location: Las Vegas, NV USA
Contact:

Re: How to invert bar display ?

Post by hydrolisk1792 »

hello i think there is a reversal plugin like for scrolling and other things.

dperrow
Plugin Author
Posts: 276
Joined: May 27th, 2011, 2:13 pm
Location: Stirling, Scotland

Re: How to invert bar display ?

Post by dperrow »

You can try function 3 in this dll (unzip and copy the dll to your plugin folder).

Code: Select all

$dll(Scroll,x,param1,)

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 3 - param 1 = text to be reversed
                           reverses the characters in a string of text i.e. left to right becomes right to left         
    Function 20- Returns the version number of this code

Scroll.zip
You do not have the required permissions to view the files attached to this post.

furioussgamer
Posts: 25
Joined: February 15th, 2010, 10:57 am

Re: How to invert bar display ?

Post by furioussgamer »

Thank you, it works.

It's like that in lcd smartie window:
Image
And with LCD emulation:
Image
It's not perfect but it's fine.

dperrow
Plugin Author
Posts: 276
Joined: May 27th, 2011, 2:13 pm
Location: Stirling, Scotland

Re: How to invert bar display ?

Post by dperrow »

What would make it perfect then?

furioussgamer
Posts: 25
Joined: February 15th, 2010, 10:57 am

Re: How to invert bar display ?

Post by furioussgamer »

This would be perfect
Image

Instead of this
Image

dperrow
Plugin Author
Posts: 276
Joined: May 27th, 2011, 2:13 pm
Location: Stirling, Scotland

Re: How to invert bar display ?

Post by dperrow »

Okay, I've added function 4 which reverses the two bars causing the problem. It uses 2 additional custom characters.

Let me know how it goes.

Code: Select all

    Function 4 - param 1 = Bars to be reversed
                           reverses the order of bars i.e. left to right becomes right to left         
Scroll.zip
You do not have the required permissions to view the files attached to this post.

furioussgamer
Posts: 25
Joined: February 15th, 2010, 10:57 am

Re: How to invert bar display ?

Post by furioussgamer »

Yes it's much better but there is a missing part here
Image

I have highlighted in yellow
Image

dperrow
Plugin Author
Posts: 276
Joined: May 27th, 2011, 2:13 pm
Location: Stirling, Scotland

Re: How to invert bar display ?

Post by dperrow »

Hi,
i'm pretty sure this is a limitation of the $Bar function since it only uses 2 custom character definitions to represent 4 possible states.

I've created a replacement bar function within scroll to compensate for this. So we now have:

Code: Select all

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 3 - param 1 = text to be reversed
                           reverses the characters in a string of text i.e. left to right becomes right to left         

    Function 4 - param 1 = Bars to be reversed
                           reverses the order of bars i.e. left to right becomes right to left
                           only works for smartie built in bar function (uses custom characters 3 & 4))         

    Function 5 - a bar function
                      param 1 - current#total - current value and maximum value
                      param 2 - length of the bar
                           This uses an additional 2 custom chars (5 & 6) to provide all states
                           example: $dll(Scroll,5,$CPUUsage%#100,10)
                           Note the use of the # character
                           
    Function 6 - a reverse bar function (outputs a mirror of function 5))
                      param 1 - current#total - current value and maximum value
                      param 2 - length of the bar
                           This uses an additional 2 custom chars (7 & 8) to provide all states
                           example: $dll(Scroll,6,$CPUUsage%#100,10)
                           Note the use of the # character
 
    Function 20- Returns the version number of this code
Let me know how you get on with this.
Scroll.zip
You do not have the required permissions to view the files attached to this post.

hydrolisk1792
Site Admin
Posts: 305
Joined: July 23rd, 2010, 8:32 pm
Location: Las Vegas, NV USA
Contact:

Re: How to invert bar display ?

Post by hydrolisk1792 »

dperrow wrote:Hi,
i'm pretty sure this is a limitation of the $Bar function since it only uses 2 custom character definitions to represent 4 possible states.

I've created a replacement bar function within scroll to compensate for this. So we now have:

Code: Select all

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 3 - param 1 = text to be reversed
                           reverses the characters in a string of text i.e. left to right becomes right to left         

    Function 4 - param 1 = Bars to be reversed
                           reverses the order of bars i.e. left to right becomes right to left
                           only works for smartie built in bar function (uses custom characters 3 & 4))         

    Function 5 - a bar function
                      param 1 - current#total - current value and maximum value
                      param 2 - length of the bar
                           This uses an additional 2 custom chars (5 & 6) to provide all states
                           example: $dll(Scroll,5,$CPUUsage%#100,10)
                           Note the use of the # character
                           
    Function 6 - a reverse bar function (outputs a mirror of function 5))
                      param 1 - current#total - current value and maximum value
                      param 2 - length of the bar
                           This uses an additional 2 custom chars (7 & 8) to provide all states
                           example: $dll(Scroll,6,$CPUUsage%#100,10)
                           Note the use of the # character
 
    Function 20- Returns the version number of this code
Let me know how you get on with this.
Scroll.zip
If you don't mind, I would like to use this plug in as well as I think it is pretty cool and I have a pretty awesome use for it. Will this work with the Winamp bar command as well? Also can it be used on the same line as a regular bar to have them close in on each other? Cheers!

hydrolisk1792
Site Admin
Posts: 305
Joined: July 23rd, 2010, 8:32 pm
Location: Las Vegas, NV USA
Contact:

Re: How to invert bar display ?

Post by hydrolisk1792 »

dperrow wrote:Hi,
i'm pretty sure this is a limitation of the $Bar function since it only uses 2 custom character definitions to represent 4 possible states.

I've created a replacement bar function within scroll to compensate for this. So we now have:

Code: Select all

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 3 - param 1 = text to be reversed
                           reverses the characters in a string of text i.e. left to right becomes right to left         

    Function 4 - param 1 = Bars to be reversed
                           reverses the order of bars i.e. left to right becomes right to left
                           only works for smartie built in bar function (uses custom characters 3 & 4))         

    Function 5 - a bar function
                      param 1 - current#total - current value and maximum value
                      param 2 - length of the bar
                           This uses an additional 2 custom chars (5 & 6) to provide all states
                           example: $dll(Scroll,5,$CPUUsage%#100,10)
                           Note the use of the # character
                           
    Function 6 - a reverse bar function (outputs a mirror of function 5))
                      param 1 - current#total - current value and maximum value
                      param 2 - length of the bar
                           This uses an additional 2 custom chars (7 & 8) to provide all states
                           example: $dll(Scroll,6,$CPUUsage%#100,10)
                           Note the use of the # character
 
    Function 20- Returns the version number of this code
Let me know how you get on with this.
Scroll.zip
If you don't mind, I would like to use this plug in as well as I think it is pretty cool and I have a pretty awesome use for it. Will this work with the Winamp bar command as well? Also can it be used on the same line as a regular bar to have them close in on each other? Cheers!

dperrow
Plugin Author
Posts: 276
Joined: May 27th, 2011, 2:13 pm
Location: Stirling, Scotland

Re: How to invert bar display ?

Post by dperrow »

Don't use the Winamp plugin so I don't know - try it and let us know.

It should work okay with the bar function. Again, try it and let us know.

hydrolisk1792
Site Admin
Posts: 305
Joined: July 23rd, 2010, 8:32 pm
Location: Las Vegas, NV USA
Contact:

Re: How to invert bar display ?

Post by hydrolisk1792 »

dperrow wrote:Don't use the Winamp plugin so I don't know - try it and let us know.

It should work okay with the bar function. Again, try it and let us know.
Okay will do. I'm going to try it right now and see if it works with winamp and the way I'm thinking it might...

hydrolisk1792
Site Admin
Posts: 305
Joined: July 23rd, 2010, 8:32 pm
Location: Las Vegas, NV USA
Contact:

Re: How to invert bar display ?

Post by hydrolisk1792 »

Yes it works the way I thought it would :) Here is the string I came up with to make it work properly:

Code: Select all

$dll(Scroll.dll,5,$Winamppos#$WinampLength,10)$dll(Scroll.dll,6,$Winamppos#$WinampLength,10)
I have omitted all the $dll(sandr,1,,) strings from here that I have to use to make the bars and such show up on my customer displays. With those strings all in there one would get really confused lol.

Post Reply