It is currently May 6th, 2024, 1:54 pm

[Solved] Autoscale Tooltips?

Get help with creating, editing & fixing problems with skins
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

[Solved] Autoscale Tooltips?

Post by Seahorse »

I'm trying to add a tooltip that shows free memory, used etc.. If you take the result from [PhysicalMemUsed] measure you get stuff like "4293439488".

My first though was to see if I could apply Autoscale, but that doesn't seem to affect tooltips, particularly as I am using a background image to anchor it.

Cunning plan 2 - reduce this via a calc like:

Code: Select all

[PhysMemUsedCalc]
Measure=Calc
Formula=(MeasurePhysMemUsed/1024/1024/1024)
Now I get "1.91234" which I can append GB to, but I have 4 extra decimal places and I don't know of a way to reduce these.

Code: Select all

ToolTipText=Used: [PhysMemUsedCalc] GB


Gives "Used: 1.91234 GB" which is too ugly for my eyes!

So, is there another way of doing what I am attempting, a way of reducing decimal places displayed or is it possible to have a meter that doesn't display anything at all, have that use Autoscale and have it feed the tooltip?

I presume I missing a trick here somewhere?
Last edited by Seahorse on July 7th, 2011, 8:07 pm, edited 2 times in total.
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

User avatar
santa_ryan
Posts: 397
Joined: June 22nd, 2010, 4:11 am

Re: Autoscale Tooltips?

Post by santa_ryan »

This would work for what you want. It's not exactly "proper" as it doesn't do autoscale, but it would work.

Code: Select all

[Variables]
Accuracy=2
;Amount of decimals to be displayed.

[PhysMemUsedCalc]
Measure=Calc
Formula=ROUND((MeasurePhysMemUsed/1024/1024/1024),#Accuracy#)
I have three rules when I'm trying to help you.
  • Don't get mad when you don't understand something
  • Be VERY specific with what you ask for.
    The more specific you are, the higher the quality of support you receive.
  • Do not just copy and paste what I put in examples and come back saying it doesn't work.
    It does work, but I purposely left blanks that you need to fill for your specific needs.
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: Autoscale Tooltips?

Post by Seahorse »

Almost. there, it now displays 2.19000, the zeros remain static... O.O
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Autoscale Tooltips?

Post by jsmorley »

Seahorse wrote:Almost. there, it now displays 2.19000, the zeros remain static... O.O
I'm not at home to test, but I think if you add Substitute="000":"" to the calc measure and DynamicVariables=1 to the meter, it might fix that. The issue is that calc measures always return numeric values with 5 decimal places. So if you use the value directly in a string meter, you will always get .00000 even on a whole number. Since you are rounding to 2 decimal places in this case, you will always get the last 3 decimal places as zeros, which you should be able to substitute off. You need DynamicVariables on the meter though, so it sees the "substituted" value rather than the original one when you use the [MeassureName].
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: Autoscale Tooltips?

Post by Seahorse »

Already have Dynamic Variables set, but the substitution does the job :D Example code for ref:

Code: Select all

[Variables]
Accuracy=2
;Amount of decimals to be displayed.

[MeasurePhysMemUsed]
Measure=PhysicalMemory
UpdateDivider=2

[PhysMemUsedCalc]
Measure=Calc
Formula=ROUND((MeasurePhysMemUsed/1024/1024/1024),#Accuracy#)
Substitute="000":""

[MeterBackground]
Meter......
Stuff.....
ToolTipText=Used: [PhysMemUsedCalc] GB
ToolTipType=1
ToolTipTitle=RAM Details
ToolTipIcon=INFO
DynamicVariables=1
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: [Solved] Autoscale Tooltips?

Post by Seahorse »

Since 2.1 r848

Code: Select all

Substitute="000":""
no longer required.
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt