How can I do this?
LeftMouseUpAction = [! ShowMeter "image1"] [! HideMeter "image2"]
LeftMouseUpAction again = [! ShowMeter "image2"] [! HideMeter "image1"]
Thanks
It is currently April 20th, 2024, 4:01 pm
LeftMouseUpAction Question
-
- Posts: 865
- Joined: January 4th, 2018, 9:52 pm
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
Re: LeftMouseUpAction Question
One way can be:xenium wrote:How can I do this?
LeftMouseUpAction = [! ShowMeter "image1"] [! HideMeter "image2"]
LeftMouseUpAction again = [! ShowMeter "image2"] [! HideMeter "image1"]
Thanks
Code: Select all
LeftMouseUpAction = [!ToggleMeter "image1"] [!ToggleMeter "image2"]
But if something changes the hidden state, you might have some issue. So place your Hide.show carefully in other places of the code.
-
- Posts: 571
- Joined: February 28th, 2011, 3:20 pm
- Location: Vienna, Austria
Re: LeftMouseUpAction Question
You can use the !ToggleMeter bang, so:xenium wrote:How can I do this?
LeftMouseUpAction = [! ShowMeter "image1"] [! HideMeter "image2"]
LeftMouseUpAction again = [! ShowMeter "image2"] [! HideMeter "image1"]
Thanks
Code: Select all
LeftMouseUpAction=[!ToggleMeter "image1"][!ToggleMeter "image2"]
-
- Posts: 865
- Joined: January 4th, 2018, 9:52 pm
Re: LeftMouseUpAction Question
Thanks for the help !
-
- Rainmeter Sage
- Posts: 16150
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: LeftMouseUpAction Question
For sure kyriakos876's and ikarus1969's replies are good enough and toggling the images is a solution, but as usual, there are others, too. Here is my approach:
Add a variable (let's name it ImageVis) to the [Variables] section of your skin:
The value of this variable determines which image is visible at a given moment, through the following Calc measure. Add it:
With this approach you can toggle the images setting the value of the ImageVis variable. Replace the LeftMouseUpAction option of the meter with this: LeftMouseUpAction=[!SetVariable ImageVis "(1-#ImageVis#)"][!UpdateMeasure "MeasureVisibility"].
You have to do one more thing: add a DynamicVariables=1 option to the meter which has the above LeftMouseUpAction (unless not already added). This is important, because if you don't add this option, one single toggle will be made.
Maybe this approach sound a bit more complicated than that posted before, but it has an advantage: if needed, the toggle can be made, beside the meter, from other meters / measures, too.
Add a variable (let's name it ImageVis) to the [Variables] section of your skin:
Code: Select all
[Variables]
ImageVis=0
Code: Select all
[MeasureVisibility]
Measure=Calc
Formula=#ImageVis#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!ShowMeter "image1"][!HideMeter "image2"]
IfFalseAction=[!ShowMeter "image2"][!HideMeter "image1"]
DynamicVariables=1
You have to do one more thing: add a DynamicVariables=1 option to the meter which has the above LeftMouseUpAction (unless not already added). This is important, because if you don't add this option, one single toggle will be made.
Maybe this approach sound a bit more complicated than that posted before, but it has an advantage: if needed, the toggle can be made, beside the meter, from other meters / measures, too.
-
- Posts: 865
- Joined: January 4th, 2018, 9:52 pm
Re: LeftMouseUpAction Question
balala wrote:For sure kyriakos876's and ikarus1969's replies are good enough and toggling the images is a solution, but as usual, there are others, too. Here is my approach:
Add a variable (let's name it ImageVis) to the [Variables] section of your skin:The value of this variable determines which image is visible at a given moment, through the following Calc measure. Add it:Code: Select all
[Variables] ImageVis=0
With this approach you can toggle the images setting the value of the ImageVis variable. Replace the LeftMouseUpAction option of the meter with this: LeftMouseUpAction=[!SetVariable ImageVis "(1-#ImageVis#)"][!UpdateMeasure "MeasureVisibility"].Code: Select all
[MeasureVisibility] Measure=Calc Formula=#ImageVis# IfCondition=(#CURRENTSECTION#=0) IfTrueAction=[!ShowMeter "image1"][!HideMeter "image2"] IfFalseAction=[!ShowMeter "image2"][!HideMeter "image1"] DynamicVariables=1
You have to do one more thing: add a DynamicVariables=1 option to the meter which has the above LeftMouseUpAction (unless not already added). This is important, because if you don't add this option, one single toggle will be made.
Maybe this approach sound a bit more complicated than that posted before, but it has an advantage: if needed, the toggle can be made, beside the meter, from other meters / measures, too.
Thank you for your solution!
-
- Rainmeter Sage
- Posts: 16150
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
-
- Posts: 865
- Joined: January 4th, 2018, 9:52 pm
Re: LeftMouseUpAction Question
Yes, it works !balala wrote:Did it work?
-
- Rainmeter Sage
- Posts: 16150
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania