It is currently October 21st, 2018, 11:22 am

Trying to set tooltip depending on a measure

Help with creating, editing & fixing problems with skins
DavidFw1960
Posts: 27
Joined: December 27th, 2016, 1:32 am

Trying to set tooltip depending on a measure

DavidFw1960 » May 16th, 2018, 12:53 am

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.
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 18124
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Trying to set tooltip depending on a measure

jsmorley » May 16th, 2018, 1:15 am

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

Re: Trying to set tooltip depending on a measure

DavidFw1960 » May 16th, 2018, 4:44 am

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

Re: Trying to set tooltip depending on a measure

ikarus1969 » May 16th, 2018, 8:52 am

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: 27
Joined: December 27th, 2016, 1:32 am

Re: Trying to set tooltip depending on a measure

DavidFw1960 » May 16th, 2018, 9:14 am

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: 6843
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to set tooltip depending on a measure

balala » May 16th, 2018, 12:45 pm

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: 27
Joined: December 27th, 2016, 1:32 am

Re: Trying to set tooltip depending on a measure

DavidFw1960 » May 17th, 2018, 12:00 am

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: 6843
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to set tooltip depending on a measure

balala » May 17th, 2018, 12:02 pm

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: 27
Joined: December 27th, 2016, 1:32 am

Re: Trying to set tooltip depending on a measure

DavidFw1960 » May 17th, 2018, 10:30 pm

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: 6843
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trying to set tooltip depending on a measure

balala » May 18th, 2018, 12:34 pm

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).