It is currently March 28th, 2024, 2:09 pm

Trying to set tooltip depending on a measure

Get help with creating, editing & fixing problems with skins
Post Reply
DavidFw1960
Posts: 42
Joined: December 27th, 2016, 1:32 am

Trying to set tooltip depending on a measure

Post by DavidFw1960 »

Really sorry to be such a nuisance!

I am trying to modify https://github.com/DavidFW1960/Aussie-Broadband-Usage-Meter/blob/master/ABBUsage/ABB.ini so that if it's an unlimited plan, the tooltip text is different. Here's my mods:

Code: Select all

[Popup]
Meter=Image
X=12
Y=10
W=200
H=95
LeftMouseDoubleClickAction=["https://my.aussiebroadband.com.au/"]
ToolTipTitle=Aussie Broadband Usage
ToolTipType=1
ToolTipIcon=#@#Images\Abbicon.ico
;ToolTipText="Allowance: [MeasureAllowanceGB] GB every [MeasureRollover]#CRLF#Down: [MeasureDownloadedGB] GB Up: [MeasureUploadedGB] GB#CRLF#Total: [MeasureTotalUsedGB] GB Remaining: [MeasureQuotaLeftGB] GB#CRLF#Data used: [PercentUsedData]% Left: [PercentRemainingData]%#CRLF#Today is day [MeasureToday] #CRLF#Used: [MeasureDaysUsedPart] days, [MeasureUsedPerDay] GB/Day#CRLF#Month used: [PercentMonthUsed]% Left: [PercentMonthLeft]%#CRLF#Per Day Start: [MeasureQuotaPerDayStart] GB Remaining: [MeasureQuotaPerDayRemaining] GB#CRLF#Quota Remaining Today: [AvailableDataToday] GB"
DynamicVariables=1
MouseActionCursor=0

[MeasureToolTipText]
Measure=String
IfCondition=(MeasureAllowanceGB >= 100000)
IfTrueAction=[!SetOption Popup ToolTipText "Allowance: Unlimited GB every [MeasureRollover]#CRLF#Down: [MeasureDownloadedGB] GB Up: [MeasureUploadedGB] GB#CRLF#Total: [MeasureTotalUsedGB] GB #CRLF#Today is day [MeasureToday] #CRLF#Used: [MeasureDaysUsedPart] days, [MeasureUsedPerDay] GB/Day#CRLF#Month used: [PercentMonthUsed]% Left: [PercentMonthLeft]%#CRLF#"]
IfFalseAction=[!SetOption Popup ToolTipText "Allowance: [MeasureAllowanceGB] GB every [MeasureRollover]#CRLF#Down: [MeasureDownloadedGB] GB Up: [MeasureUploadedGB] GB#CRLF#Total: [MeasureTotalUsedGB] GB Remaining: [MeasureQuotaLeftGB] GB#CRLF#Data used: [PercentUsedData]% Left: [PercentRemainingData]%#CRLF#Today is day [MeasureToday] #CRLF#Used: [MeasureDaysUsedPart] days, [MeasureUsedPerDay] GB/Day#CRLF#Month used: [PercentMonthUsed]% Left: [PercentMonthLeft]%#CRLF#Per Day Start: [MeasureQuotaPerDayStart] GB Remaining: [MeasureQuotaPerDayRemaining] GB#CRLF#Quota Remaining Today: [AvailableDataToday] GB"]
OnUpdateAction=[!UpdateMeter "Popup"][!Redraw]
If I uncomment the tooltiptext in [popup] and comment out the [measuretooltiptext] section, it is exactly right display for a plan with a quota:
Untitled.png
But if I try and use the [measuretooltiptext] section it looks like this:
Untitled1.png
I have no idea what I am doing wrong.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Trying to set tooltip depending on a measure

Post by jsmorley »

Try DynamicVariables=1 on the String measure.
DavidFw1960
Posts: 42
Joined: December 27th, 2016, 1:32 am

Re: Trying to set tooltip depending on a measure

Post by DavidFw1960 »

Tried dynamicvariables as suggested. Same result.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Trying to set tooltip depending on a measure

Post by ikarus1969 »

Strange thing is that not all Measures are missing when set by if If-conditions; just the measures that gives you GB-usage and/or percentage.
For example the "[MeasureDaysUsedPart]" gives you a value.

If have no specific hint for you but could you please list the measures that are contained in the If-Conditions in the "[MeasureToolTipText]" measure? Just to have a look.
DavidFw1960
Posts: 42
Joined: December 27th, 2016, 1:32 am

Re: Trying to set tooltip depending on a measure

Post by DavidFw1960 »

Thing is the only number that is right is the 6th - the rollover date.
You can see the full .ini file if you click on the link in my first post (it’s all on github including the rmskin file)
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to set tooltip depending on a measure

Post by balala »

DavidFw1960 wrote:If I uncomment the tooltiptext in [popup] and comment out the [measuretooltiptext] section, it is exactly right display for a plan with a quota:

Untitled.png

But if I try and use the [measuretooltiptext] section it looks like this:

Untitled1.png
Try to "escape" the measure names in the !SetOption bangs of the IfTrueAction and IfFalseAction options of the [MeasureToolTipText] measure:

Code: Select all

[MeasureToolTipText]
Measure=String
IfCondition=(MeasureAllowanceGB >= 100000)
IfTrueAction=[!SetOption Popup ToolTipText "Allowance: Unlimited GB every [*MeasureRollover*]#CRLF#Down: [*MeasureDownloadedGB*] GB Up: [*MeasureUploadedGB*] GB#CRLF#Total: [*MeasureTotalUsedGB*] GB #CRLF#Today is day [*MeasureToday*] #CRLF#Used: [*MeasureDaysUsedPart*] days, [*MeasureUsedPerDay*] GB/Day#CRLF#Month used: [*PercentMonthUsed*]% Left: [*PercentMonthLeft*]%#CRLF#"]
IfFalseAction=[!SetOption Popup ToolTipText "Allowance: [*MeasureAllowanceGB*] GB every [*MeasureRollover*]#CRLF#Down: [*MeasureDownloadedGB*] GB Up: [*MeasureUploadedGB*] GB#CRLF#Total: [*MeasureTotalUsedGB*] GB Remaining: [*MeasureQuotaLeftGB*] GB#CRLF#Data used: [*PercentUsedData*]% Left: [*PercentRemainingData*]%#CRLF#Today is day [*MeasureToday*] #CRLF#Used: [*MeasureDaysUsedPart*] days, [*MeasureUsedPerDay*] GB/Day#CRLF#Month used: [*PercentMonthUsed*]% Left: [*PercentMonthLeft*]%#CRLF#Per Day Start: [*MeasureQuotaPerDayStart*] GB Remaining: [*MeasureQuotaPerDayRemaining*] GB#CRLF#Quota Remaining Today: [*AvailableDataToday*] GB"]
OnUpdateAction=[!UpdateMeter "Popup"][!Redraw]
(See the * characters around the names of the measures above)
DavidFw1960
Posts: 42
Joined: December 27th, 2016, 1:32 am

Re: Trying to set tooltip depending on a measure

Post by DavidFw1960 »

Yes!!!!!

That worked. Thanks very much. :17good

Any idea why it worked in the first instance without the escaping? So weird. I was going crazy!

Thanks again.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to set tooltip depending on a measure

Post by balala »

DavidFw1960 wrote:Any idea why it worked in the first instance without the escaping? So weird. I was going crazy!
I can't say precisely, but I suppose first time the options are set properly, but later when the value of the measures are changing, they are not any more.
Glad you got it working.
DavidFw1960
Posts: 42
Joined: December 27th, 2016, 1:32 am

Re: Trying to set tooltip depending on a measure

Post by DavidFw1960 »

Should I include the line:
DynamicVariables=1 on the String measure.
at the end of the string measure? It's working without that but JSmorley suggested that in the first instance and it made no difference so I removed it. It's working without it anyway.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to set tooltip depending on a measure

Post by balala »

DavidFw1960 wrote:Should I include the line:
DynamicVariables=1 on the String measure.
at the end of the string measure?
If it does work even without the option, I'd renounce to it (just additionally I'd say that it's not necessary to add that option to the end, you can add it anywhere in the measure).
Post Reply