Hi,
I have 2 buttons and 4 images.
I would like that when I click consecutively on the first button, each image will appear one after the other,and when I click consecutively on the second button, each image disappears one after the other.
Like this example:
How can I do this ?
Thank you
It is currently May 6th, 2024, 2:19 am
LeftMouseUpAction consecutively
-
- Posts: 868
- Joined: January 4th, 2018, 9:52 pm
LeftMouseUpAction consecutively
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 16200
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: LeftMouseUpAction consecutively
Add a variable to the [Variables] section. For example you can name it Image:
Code: Select all
[Variables]
Image=0
Code: Select all
[Button1]
...
LeftMouseUpAction=[!SetVariable Image "(Clamp((#Image#+1),0,3))"][!UpdateMeasure "MeasureImage"][!UpdateMeter "Button1"][!UpdateMeter "Button2"]
[Button2]
...
LeftMouseUpAction=[!SetVariable Image "(Clamp((#Image#-1),0,3))"][!UpdateMeasure "MeasureImage"][!UpdateMeter "Button1"][!UpdateMeter "Button2"]
Code: Select all
[MeasureImage]
Measure=Calc
Formula=#Image#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!ShowMeter "MeterImage1"] [!HideMeter "MeterImage2"][!HideMeter "MeterImage3"][!HideMeter "MeterImage4"][!Redraw]
IfCondition2=(#CURRENTSECTION#=1)
IfTrueAction2=[!ShowMeter "MeterImage1"] [!ShowMeter "MeterImage2"][!HideMeter "MeterImage3"][!HideMeter "MeterImage4"][!Redraw]
IfCondition3=(#CURRENTSECTION#=2)
IfTrueAction3=[!ShowMeter "MeterImage1"] [!ShowMeter "MeterImage2"][!ShowMeter "MeterImage3"][!HideMeter "MeterImage4"][!Redraw]
IfCondition4=(#CURRENTSECTION#=3)
IfTrueAction4=[!ShowMeter "MeterImage1"] [!ShowMeter "MeterImage2"][!ShowMeter "MeterImage3"][!ShowMeter "MeterImage4"][!Redraw]
DynamicVariables=1
The value of the Image variable is controlling which meters are visible and which ones are hidden.
-
- Posts: 868
- Joined: January 4th, 2018, 9:52 pm
-
- Posts: 424
- Joined: February 8th, 2015, 10:07 pm
- Location: EU, Denmark.
Re: LeftMouseUpAction consecutively
Can be done without the measure.
I usually shy away from !SetOption if i can get away with it.
And one less measure is CPU recourse saved.
Add this to the meter and use the Image variable directly.
Y=(#Image# = 1 ? 10 : -1000)
DynamicVariables=1
It gets a little hard if you want to assign colors without !SetOption.
But if you don't need that, the formula in the meter should be sufficient.
https://docs.rainmeter.net/manual/formulas/
I usually shy away from !SetOption if i can get away with it.
And one less measure is CPU recourse saved.
Add this to the meter and use the Image variable directly.
Y=(#Image# = 1 ? 10 : -1000)
DynamicVariables=1
It gets a little hard if you want to assign colors without !SetOption.
But if you don't need that, the formula in the meter should be sufficient.
https://docs.rainmeter.net/manual/formulas/
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
-
- Rainmeter Sage
- Posts: 16200
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: LeftMouseUpAction consecutively
Yep, right. It has to be added. Sorry I missed it.