Page 1 of 1

Trying to set tooltip depending on a measure

Posted: May 16th, 2018, 12:53 am
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.

Re: Trying to set tooltip depending on a measure

Posted: May 16th, 2018, 1:15 am
by jsmorley
Try DynamicVariables=1 on the String measure.

Re: Trying to set tooltip depending on a measure

Posted: May 16th, 2018, 4:44 am
by DavidFw1960
Tried dynamicvariables as suggested. Same result.

Re: Trying to set tooltip depending on a measure

Posted: May 16th, 2018, 8:52 am
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.

Re: Trying to set tooltip depending on a measure

Posted: May 16th, 2018, 9:14 am
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)

Re: Trying to set tooltip depending on a measure

Posted: May 16th, 2018, 12:45 pm
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)

Re: Trying to set tooltip depending on a measure

Posted: May 17th, 2018, 12:00 am
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.

Re: Trying to set tooltip depending on a measure

Posted: May 17th, 2018, 12:02 pm
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.

Re: Trying to set tooltip depending on a measure

Posted: May 17th, 2018, 10:30 pm
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.

Re: Trying to set tooltip depending on a measure

Posted: May 18th, 2018, 12:34 pm
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).