It is currently April 28th, 2024, 12:30 am

Toggle C°\F° on click

Get help with creating, editing & fixing problems with skins
Lightz39
Posts: 98
Joined: August 1st, 2012, 12:48 am

Toggle C°\F° on click

Post by Lightz39 »

Hey all, so right now I'm trying to get it so when you click the temperature on my tile it swaps to the other system. What I am trying to do is have two meters, the first when clicked changes the value in variables to f, hides its self, shows the other meter and refreshes the skin. The second meter would then change the variable to m, hide and show the original meter. The problem I am having so the hide and show bangs aren't working. The first one will change the unit to ferinheight but it won't hide its self and show the other meter. Any ideas why? Or maybe even a better toggle method?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Toggle C°\F° on click

Post by jsmorley »

There is more to it than changing an F to a C though. How do you plan to convert all the values in your skin from Imperial to Metric?
Lightz39
Posts: 98
Joined: August 1st, 2012, 12:48 am

Re: Toggle C°\F° on click

Post by Lightz39 »

Basically I have a variable that is either m or f and i want these toogles to switch it. This already works with writekeyvalue.

EDIT: More info the variable changes the weather.com xml feed from metric to ferinheight
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Toggle C°\F° on click

Post by jsmorley »

Lightz39 wrote:Basically I have a variable that is either m or f and i want these toogles to switch it. This already works with writekeyvalue.

EDIT: More info the variable changes the weather.com xml feed from metric to ferinheight
If you are using the mouse action to change the URL on the WebParser measure with !WriteKeyValue and refreshing, there is no need for two different meters and hiding / showing anything is there?
Lightz39
Posts: 98
Joined: August 1st, 2012, 12:48 am

Re: Toggle C°\F° on click

Post by Lightz39 »

What I am trying to say is when the weather is displaying celcius and I click my temperature I can make it go to Ferinheight but from here I can't get it to go back to celcius when I click it again.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Toggle C°\F° on click

Post by jsmorley »

I think what I would do is create two variables.

[Variables]
Var1=m
Var2=f

[MeasureOne]
Measure=Plugin
Plugin=WebParser
URL=http://SomeWeatherSite.com?u=#Var1#

[MeterToToggle]
Meter=Image
W=20
H=20
SolidColor=255,255,255,255
LeftMouseUpAction=[!WriteKeyValue Variables Var1 #Var2#][!WriteKeyValue Variables Var2 #Var1#][!Refresh]

Thanks to Kaelri and Smurfier for brainstorming this on IRC.
Lightz39
Posts: 98
Joined: August 1st, 2012, 12:48 am

Re: Toggle C°\F° on click

Post by Lightz39 »

So what this would do is basically reverse the variables so originally var1=m and var2=f would become var1=f and var=m after clicking the meter? Thank you for the help by the way. I do appreciate it. Great community.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Toggle C°\F° on click

Post by jsmorley »

Lightz39 wrote:So what this would do is basically reverse the variables so originally var1=m and var2=f would become var1=f and var=m after clicking the meter? Thank you for the help by the way. I do appreciate it. Great community.
That is correct. It would reverse the variables and then !Refresh. The WebParser measure is always using #Var1#.
Lightz39
Posts: 98
Joined: August 1st, 2012, 12:48 am

Re: Toggle C°\F° on click

Post by Lightz39 »

Perfect, exactly what I was hoping to accomplish. :D Cheers.