It is currently May 3rd, 2024, 12:07 am

Meter hidden overflow, or something.

Report bugs with the Rainmeter application and suggest features.
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Meter hidden overflow, or something.

Post by Chewtoy »

Code: Select all

[Rainmeter]
DynamicWindowSize=1
BackGroundMode=2
SolidColor=0,0,0,1

[Variables]

ShowIt=0

Hide=1

;-----------------

[CHide]
Measure=Calc
Formula=((#Hide#+1) > 1) ? 0 : #Hide#+1
DynamicVariables=1

[ShowIt-Check]
Measure=Calc
Formula=#ShowIt# = 1 ? 1 : 0
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterShowMeter String2]

[SHide]
Measure=Calc
Formula=#Hide# = 1 ? 0 : 1
DynamicVariables=1
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterHideMeter String2]

[AHide]
Measure=Calc
Formula=#Hide# = 1 ? 1 : 0
DynamicVariables=1

[ShowItA-Check]
Measure=Calc
Formula=#ShowIt# = 1 ? 0 : 1
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterHideMeter String4]

;---

[Button]
Meter=String
StringStyle=Bold
FontColor=255,255,255
Text="Button"
LeftMouseUpAction=!Execute [!RainmeterWriteKeyValue Variables Hide [CHide]][!RainmeterRefresh]

[String1]
Meter=String
FontColor=255,255,255
Text="String1"
X=2
Y=R
Hidden=[SHide]
DynamicVariables=1

[String2]
Meter=String
FontColor=255,255,255
Text="String2"
X=2
Y=R
DynamicVariables=1
Hidden=1

[String3]
Meter=String
FontColor=255,255,255
Text="String3"
X=2
Y=R
DynamicVariables=1
Hidden=[AHide]

[String4]
Meter=String
FontColor=255,255,255
Text="String4"
X=2
Y=R
DynamicVariables=1
Hidden=[AHide]
Ran across this while I tried to make something show or not whether the user wants it or not.
So. What we are after are the meters String2 and String4.
These two depend on the variable ShowIt. If it's 1, they should show. If it's 0, they should hide.
String2 have no problems what so ever with this. String4 has some problems with it though.

String4 is with String3, they are hidden at start, but if we click on 'Button' they are shown because the dynamic variable for Hidden says so.
But, when ShowIt=0 String4 should remain hidden. It does not.
Explaining more in depth is a bit tricky for me, so I advice to take a look at the code and try it out.
It's not a matter of order for I think I have tried every possible combination of how the calcs can be placed.

So I'm thinking that there might some sort of overflow that makes the skin ignore the last !Bang that should outrule any other value. At least that's what makes the most sense. The skins are still being read from top to bottom, right?
Now I'm betting alex or some other guru is going to tell me how wrong I am. But we'll see...
I don't think, therefore I'm not.
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Meter hidden overflow, or something.

Post by Chewtoy »

Right. Alex kindly told me that there is no bug, just dynamic variables in the working their stuff.
He also came up with an alternate solution in 1min and 38seconds...

Code: Select all

[Rainmeter]
DynamicWindowSize=1
BackGroundMode=2
SolidColor=0,0,0,1

[Variables]

ShowIt=1

Hide=1

;-----------------

[CHide]
Measure=Calc
Formula=((#Hide#+1) > 1) ? 0 : #Hide#+1
DynamicVariables=1

[ShowIt-Check]
Measure=Calc
Formula=#ShowIt# = 1 ? 1 : 0
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterShowMeter String2]



[SHide]
Measure=Calc
Formula=#Hide# = 1 ? 0 : 1
DynamicVariables=1
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterHideMeter String2]



[AHide]
Measure=Calc
Formula=#Hide# = 1 ? 1 : 0
DynamicVariables=1


[ShowItA-Check]
Measure=Calc
Formula=(#ShowIt# = 0) || #Hide# ? 1 : 0
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterHideMeter String4]

;---

[Button]
Meter=String
StringStyle=Bold
FontColor=255,255,255
Text="Button"
LeftMouseUpAction=!Execute [!RainmeterWriteKeyValue Variables Hide [CHide]][!RainmeterRefresh]

[String1]
Meter=String
FontColor=255,255,255
Text="String1"
X=2
Y=R
Hidden=[SHide]
DynamicVariables=1

[String2]
Meter=String
FontColor=255,255,255
Text="String2"
X=2
Y=R
DynamicVariables=1
Hidden=1

[String3]
Meter=String
FontColor=255,255,255
Text="String3"
X=2
Y=R
DynamicVariables=1
Hidden=[AHide]

[String4]
Meter=String
FontColor=255,255,255
Text="String4"
X=2
Y=R
DynamicVariables=1
Hidden=[ShowItA-Check]
I don't think, therefore I'm not.