It is currently September 21st, 2021, 5:24 pm

Using Measure Bangs [solution found]

Help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 634
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using Measure Bangs

Post by CodeCode »

Um, ok.

MeterText shows some info. It shows in mouse CLICK.

A button in and of itself, hides MeterText on mouseover. This works fine.

A new button needs to know if #aState#=1. If it equal to 1, then the mouseover will show metertext. If it is equal to 0 then essentially nothing happens.

The text and buttons are separate entities in and of themselves. The mouseover is NOT on the text, it is on a button.

So the logic is really simple. Just how to I trigger the MeasureTri to determine if #aState#=1 to show the text. Nothing else matters really.

Just the button in visual space >x< and waaaay over here is the text >text<.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
jsmorley
Developer
Posts: 22288
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using Measure Bangs

Post by jsmorley »

CodeCode wrote: July 25th, 2021, 12:58 pm Um, ok.

MeterText shows some info. It shows in mouse CLICK.

A button in and of itself, hides MeterText on mouseover. This works fine.

A new button needs to know if #aState#=1. If it equal to 1, then the mouseover will show metertext. If it is equal to 0 then essentially nothing happens.

The text and buttons are separate entities in and of themselves. The mouseover is NOT on the text, it is on a button.

So the logic is really simple. Just how to I trigger the MeasureTri to determine if #aState#=1 to show the text. Nothing else matters really.

Just the button in visual space >x< and waaaay over here is the text >text<.
Well, I suspect I'm not getting this at all, but if I go with the assumption that you are setting the variable #aState# somewhere else, and you just want the MouseOverAction to check the value of #aState# and take some action based on it, it's like this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
aState=1

[MeasureTri]
Measure=Calc
IfCondition=(#aState# = 0)
IfTrueAction=[!HideMeter MeterText]
IfCondition2=(#aState# = 1)
IfTrueAction2=[!ShowMeter MeterText]
DynamicVariables=1
UpdateDivider=-1

[MeterText]
Meter=String
FontSize=15
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Hello World
MouseOverAction=[!UpdateMeasure MeasureTri]
Now mind you, this in an of itself does nothing, as it does not include the bit that changes the value of #aState#.
User avatar
CodeCode
Posts: 634
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using Measure Bangs

Post by CodeCode »

jsmorley wrote: July 25th, 2021, 1:03 pm Well, I suspect I'm not getting this at all, but if I go with the assumption that you are setting the variable #aState# somewhere else, and you just want the MouseOverAction to check the value of #aState# and take some action based on it, it's like this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
aState=1

[MeasureTri]
Measure=Calc
IfCondition=(#aState# = 1)
IfTrueAction=[!ShowMeter MeterText]
DynamicVariables=1
UpdateDivider=-1

[MeterText]
Meter=String
FontSize=15
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Hello World
MouseOverAction=[!UpdateMeasure MeasureTri]
Note the change to [MeasureTri].

But, yes. That is what I am trying to accomplish.

Note, the code above - is changed from Jsmorley's post to only test IfCondition=(#aState# = 1) .

Then in the separate button image, MouseOverAction=[!UpdateMeasure MeasureTri]

However, it isnt working like that.

The MeasureTri 'looks' correct from my view. But the mouse over isnt working.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
jsmorley
Developer
Posts: 22288
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using Measure Bangs

Post by jsmorley »

But nothing in your example is ever changing the value of #aState#...

Try this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
aState=1

[MeasureTri]
Measure=Calc
IfCondition=(#aState# = 0)
IfTrueAction=[!HideMeter MeterText][!UpdateMeter *][!Redraw]
IfCondition2=(#aState# = 1)
IfTrueAction2=[!ShowMeter MeterText][!UpdateMeter *][!Redraw]
DynamicVariables=1
UpdateDivider=-1

[MeterText]
Meter=String
FontSize=15
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Hello World

[MeterHideShow]
Meter=Image
Y=40
W=50
H=50
SolidColor=255,255,255,255
DynamicVariables=1
MouseOverAction=[!SetVariable aState (1-#aState#)][!UpdateMeasure MeasureTri]

Animation.gif
You do not have the required permissions to view the files attached to this post.
User avatar
CodeCode
Posts: 634
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using Measure Bangs

Post by CodeCode »

Ok, we do not need to worry about how a$tate is set. Only that is will either be '1' or '0'. So I cannot 'need' to set aState at all.

If it is '1', then the [MeasureTri] needs to be triggered to show [MeterText]. If aState=0 nothing happens, as in no need to rehide the MeterText.
Still [!UpdateMeasure MeasureTri] does not work.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
jsmorley
Developer
Posts: 22288
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using Measure Bangs

Post by jsmorley »

I'm not sure I see the need for the MeasureTri at all to be honest...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
aState=0

[MeterText]
Meter=String
FontSize=15
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Hidden=#aState#
DynamicVariables=1
Text=Hello World

[MeterHideShow]
Meter=Image
Y=40
W=50
H=50
SolidColor=255,255,255,255
DynamicVariables=1
MouseOverAction=[!SetVariable aState (1-#aState#)][!UpdateMeter *][!Redraw]
User avatar
CodeCode
Posts: 634
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using Measure Bangs

Post by CodeCode »

Well, I'll explain the links and set up this way.

the variable aState will be either '1' or '0'. It hides or shows two groups of Meters. It is set my mouseclick in a separate line of logic, and there is no need to "handle" aState. it just is the value that it is - either '1' or '0'.

There are two separate image meters - 'buttons' essentially. They always show in this case.
The text meter is in another location and has no need to be managed with any kind of mouse actions.

Button1 hides metertext on mouse over - this is already working and there is no need to go further on Button1.

Button2 shows meter text on mouse over only if aState=1.

Since the aState handles other visuals - two groups of meters showing different graphical information.

If one visual is showing and aState=1 then metertext will show on mouse over.

If the other visual is showing and aState=0 then metertext will NOT show.

MeasureTri is how i imagined this third trigger state would need to work. But I am frequently wrong. There may be a much simpler way. I just cannot see it without the IfCondition testing the value of aState=1 or not.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
jsmorley
Developer
Posts: 22288
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using Measure Bangs

Post by jsmorley »

Well, I guess I don't understand why this doesn't work for you...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
aState=1

[MeasureTri]
Measure=Calc
IfCondition=(#aState# = 0)
IfTrueAction=[!HideMeter MeterText][!UpdateMeter *][!Redraw]
IfCondition2=(#aState# = 1)
IfTrueAction2=[!ShowMeter MeterText][!UpdateMeter *][!Redraw]
DynamicVariables=1
UpdateDivider=-1

[MeterText]
Meter=String
FontSize=15
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Hello World

[MeterCheckState]
Meter=Image
Y=40
W=50
H=50
SolidColor=255,255,255,255
DynamicVariables=1
MouseOverAction=[!UpdateMeasure MeasureTri]
This code makes no assumptions about "how" the value of #aState# is changed. On MouseOverAction it will just fire the MeasureTri measure, which will evaluate the current value of #aState#, and take the appropriate action. Obviously, this little example does exactly NOTHING.

I'm sorry, but I just can't keep up with the ever changing requirements for this. Now it feels like we have two tests we need to do, to see if some "other visual" is "showing" and then check the state of #aState#". I'm just lost, and not sure I can really help.
User avatar
CodeCode
Posts: 634
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using Measure Bangs

Post by CodeCode »

I don't know why... but this is what seems to work:

Code: Select all

[MeasureTri]
Measure=Calc
IfCondition=(#aState# = 0)
IfTrueAction=[!SetOption MeterText Text ""][!UpdateMeter *][!Redraw]
DynamicVariables=1
UpdateDivider=-1

Code: Select all

[MeterText]
...
MouseOverAction=[!ShowMeter "MeterText"][!Update]
Sorry to be any cause of frustration. This certainly was not futile since I got a working version going, after the whole thread so far... :oops:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 634
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using Measure Bangs

Post by CodeCode »

So, yes. Solution found.

There actually is a real hecking lot of things going on. But now, with the logic spelled out as "this way should work", I was able to get my mouse overs etc all working to my intent.

Thank you so much Jsmorley, for putting up with this in trying to get a solution. My visualisation is realised, and I think it is pretty flash, really, now that it is working correctly (or at least to my intentional appearance).

EDIT: Closing Note.

MouseOverAction=[!UpdateMeasure MeasureTri]

This is what I needed to know, to "Fire" the #aState#='1' or '0' test.
Last edited by CodeCode on July 25th, 2021, 2:32 pm, edited 1 time in total.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.