It is currently May 2nd, 2024, 10:29 pm

How to make calc measure works only when you click on the bu

Get help with creating, editing & fixing problems with skins
User avatar
fabularasa
Posts: 76
Joined: February 26th, 2011, 12:51 am
Location: Poland

How to make calc measure works only when you click on the bu

Post by fabularasa »

How to make calc measure works only when you click on the button, eg (If you don't click it shows nothing 1 nor 2)

Code: Select all


...

[Website]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[www]
StringIndex=1
Substitute="one":"-1","two":"1"

...

[CalcMeasure]
Measure=Calc
Formula=[OneOrTwo]
IfBelowValue=0
IfBelowAction=!execute [!RainmeterHideMeter 1][!RainMeterShowMeter 2][!RainmeterRedraw]
IfAboveValue=0
IfAboveAction=!execute [!RainMeterShowMeter 1][!RainMeterHideMeter 2][!RainmeterRedraw]
DynamicVariables=1 
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: How to make calc measure works only when you click on th

Post by Brian »

Add Disabled=1 to your calc measure. If you use an image meter for your button, add a LeftMouseUpAction, then enable your calc measure. If you use the button meter, then use ButtonCommand instead of LeftMouseUpAction.

Here is some examples.
LeftMouseUpAction=!EnableMeasure CalcMeasure or ButtonCommand=!EnableMeasure CalcMeasure

Hope that made sense.

-Brian
User avatar
fabularasa
Posts: 76
Joined: February 26th, 2011, 12:51 am
Location: Poland

Re: How to make calc measure works only when you click on th

Post by fabularasa »

Doesn't work. It disabled the measure but it didn't enable it after LeftMouseDownAction=!EnableMeasure [CalcMeasure]
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: How to make calc measure works only when you click on th

Post by Brian »

LeftMouseUpAction should work.

Could you post your entire code so we can see what exactly is happening?

-Brian
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: How to make calc measure works only when you click on th

Post by smurfier »

fabularasa wrote:Doesn't work. It disabled the measure but it didn't enable it after LeftMouseDownAction=!EnableMeasure [CalcMeasure]
If that is your exact text then you need to remove the brackets so that it reads:
LeftMouseDownAction=!EnableMeasure CalcMeasure

Just an fyi, if you want to have the same meter both activate and deactivate the same measure, just use !ToggleMeasure instead.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
fabularasa
Posts: 76
Joined: February 26th, 2011, 12:51 am
Location: Poland

Re: How to make calc measure works only when you click on th

Post by fabularasa »

Button - [Button6HoursOff]

On skin press 6H (AccuWeather 6 GODZIN)


File: http://www.mediafire.com/?7r04q3ay8ladrjl
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: How to make calc measure works only when you click on th

Post by Brian »

Here is the problem:LeftMouseDownAction=!EnableMeasure CheckHour6DayNight CheckHour1DayNight. EnableMeasure does not work that way, you need an !Execute to run multiple commands.

You have to do it like this: LeftMouseUpAction=!Execute [!EnableMeasure CheckHour6DayNight][!EnableMeasure CheckHour1DayNight]

Also, you can only have ONE type of mouse action per meter. (ie. LeftMouseUpAction, LeftMouseDownAction)

FYI - mouse UP actions work better than down actions just in case you accidentally go to move your skin around the screen and have clicked that meter.

-Brian
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: How to make calc measure works only when you click on th

Post by smurfier »

LeftMouseDownAction=!EnableMeasure CheckHour6DayNight CheckHour1DayNight

This will try to Enable the measure CheckHour6DayNight in the config CheckHour1DayNight.

I imagine you're looking for:
LeftMouseDownAction=!Execute [!EnableMeasure CheckHour6DayNight][!EnableMeasure CheckHour1DayNight]

I also suggest you take a look at Meter/Measure Groups.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
fabularasa
Posts: 76
Joined: February 26th, 2011, 12:51 am
Location: Poland

Re: How to make calc measure works only when you click on th

Post by fabularasa »

Code: Select all

LeftMouseUpAction=!Execute [!EnableMeasure CheckHour6DayNight][!EnableMeasure CheckHour1DayNight]
OK but works only once when I click on 6H. When I close 6H tab and then click again on 6H it dosen't work.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: How to make calc measure works only when you click on th

Post by smurfier »

Are you disabling those measures when you close the 6H tab?
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .