It is currently September 21st, 2019, 4:12 pm

RoundLineMeter Location

Help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 8634
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: RoundLineMeter Location

balala » February 16th, 2016, 8:25 pm

Glad to help.
bill98
Posts: 445
Joined: March 17th, 2011, 4:54 am

Re: RoundLineMeter Location

bill98 » February 17th, 2016, 8:04 am

Is this the method you use to do a refresh? It is not working for me. See the LeftMouse trigger.

[Icon15]
Meter=Image
Hidden=1
Group=LauncherI
UpdateRate=10000
x=(#XC1#+200-#IconS#/2+#StripeICtr#*Cos(22.5*10/(180/PI())))
y=(#YC1#+200-#IconS#/2+#StripeICtr#*Sin(22.5*10/(180/PI())))
w=#IconS#
h=#IconS#
DynamicVariables=1
ImageName=#IconSrc#\#IconM15#
LeftMouseUpAction=[!SetVariable LNO "15"][!WriteKeyValue Variables "LNO" "15" #@#VariablesM2.inc][!UpDateMeter Icon15][!ReDraw][!HideMeterGroup LauncherI][!ShowMeterGroup "LauncherD"]
ToolTipTitle=#aTitle15#
ToolTipType=1
ToolTipIcon=INFO
ToolTipHidden=#IDef#
ToolTipText=#SubTTL15#
RightMouseUpAction=[!HideMeterGroup LauncherI][!UpdateMeasure mLauncher2Active]
User avatar
balala
Rainmeter Sage
Posts: 8634
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: RoundLineMeter Location

balala » February 17th, 2016, 11:35 am

A refresh can be done with the [!Refresh] bang. You didn't use it on the above code. But if I'm not wrong, don't even have to, because at the click, the !SetVariable bang will set the value of the LNO variable (for imediate use, without a refresh) and the !WriteKeyValue will write it to the VariablesM2.inc (for use it after a refresh). This means that you don't have to refresh the skin to use the new value of the variable (because of the !SetVariable bang), but if you refresh it, the new value of the variable will be re-read and used (this will be done as a result of the !WriteKeyValue bang).
Just a note I have about your code: on the !WriteKeyValue bang it would be a good idea to include the name of the file into quotation marks ([!WriteKeyValue Variables "LNO" "15" "#@#VariablesM2.inc"]). In fact, if the path of the file contains spaces, this is absolutely needed.
bill98
Posts: 445
Joined: March 17th, 2011, 4:54 am

Re: RoundLineMeter Location

bill98 » February 18th, 2016, 2:26 am

My problem is that the above code does not do a refresh!
User avatar
balala
Rainmeter Sage
Posts: 8634
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: RoundLineMeter Location

balala » February 18th, 2016, 7:17 am

You didn't use nowhere the [!Refresh] bang, which should do the refresh. When should it be done? When you click to the [Icon15] meter? To do it, you'll have to add thet [!Refresh] bang, let's say, at the end of the LeftMouseUpAction (if you want to do that refresh on click). But in this case, the !SetVariable, !UpDateMeter, !ReDraw, !HideMeterGroup and !ShowMeterGroup bangs are useless, they will not take effect.
bill98
Posts: 445
Joined: March 17th, 2011, 4:54 am

Re: RoundLineMeter Location

bill98 » February 18th, 2016, 2:11 pm

According to JSMorley on page 1, it should ReFresh without using !ReFresh. Thats what I need.
User avatar
balala
Rainmeter Sage
Posts: 8634
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: RoundLineMeter Location

balala » February 18th, 2016, 2:48 pm

You're making a confusion. If you read carefully jsmorley's post, you'll see that you don't have to refresh your skin to get "immediate results from your change", but "if you DO refresh or reload the skin, the change is also "persistent'." So, in fact the refresh is optional but not absolutely needed. Your LeftMouseUpAction on the [Icon15] meter, will set immediately the LNO variable (with the !SetVariable bang - the result of this bang can be immediately used - but be careful because you need the DynamicVariables=1 option on the measure/meter where you want to use the LNO variable) but will also permanently store its value (this will be done by the !WriteKeyValue bang). All this are done without the need of refresh the skin.
So, I recomand to leave the LeftMouseUpAction as it is. It will do its job in both cases: with and without refresh.
User avatar
jsmorley
Developer
Posts: 19474
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RoundLineMeter Location

jsmorley » February 18th, 2016, 3:02 pm

The skin .ini and any @Include .inc files are read one time when the skin is loaded or refreshed. So if you make changes to the physical .ini or .inc files, using !WriteKeyValue or even with Lua or with some other external process, you will need to !Refresh the skin in order to re-read the changed .ini or .inc files and act on the changes.

However you can often avoid a complete skin refresh, which is both destructive to any other changes you might have dynamically made to options or variables in memory using !SetOption or !SetVariable, and is relatively CPU expensive.

You do that by in effect doing "both" in your action.

[!SetVariable SomeVar "SomeValue"][!WriteKeyValue Variables SomeVar "SomeValue"][!UpdateMeasure *][!UpdateMeter *][!Redraw]

That way the change to the variable is made in "memory" and will be acted upon immediately, while at the same time it is physically written to the skin .ini file, so that if you DO refresh or reload the skin, the change you made is "persistent".

The same would be true with !SetOption:

[!SetOption SomeMeter FontSize "12"][!WriteKeyValue SomeMeter FontSize "12"][!UpdateMeter "SomeMeter"][!Redraw]

I'm not sure how balala and I can make this any more clear... ;-)
bill98
Posts: 445
Joined: March 17th, 2011, 4:54 am

Re: RoundLineMeter Location

bill98 » February 18th, 2016, 9:27 pm

Maybe I am missing something. I though I was doing exactly what you said but it still does not refresh. The meter is shown at the topof page 3. The LeftMouse trigger seems to follow your example exactly,but does not work.
Your example:

[!SetVariable SomeVar "SomeValue"][!WriteKeyValue Variables SomeVar "SomeValue"][!UpdateMeasure *][!UpdateMeter *][!Redraw]

My meter from page one:

[Icon15]
Meter=Image
Hidden=1
Group=LauncherI
UpdateRate=10000
x=(#XC1#+200-#IconS#/2+#StripeICtr#*Cos(22.5*10/(180/PI())))
y=(#YC1#+200-#IconS#/2+#StripeICtr#*Sin(22.5*10/(180/PI())))
w=#IconS#
h=#IconS#
DynamicVariables=1
ImageName=#IconSrc#\#IconM15#
LeftMouseUpAction=[!SetVariable LNO "15"][!WriteKeyValue Variables "LNO" "15" #@#VariablesM2.inc][!UpDateMeter Icon15][!ReDraw][!HideMeterGroup LauncherI][!ShowMeterGroup "LauncherD"]
ToolTipTitle=#aTitle15#
ToolTipType=1
ToolTipIcon=INFO
ToolTipHidden=#IDef#
ToolTipText=#SubTTL15#
RightMouseUpAction=[!HideMeterGroup LauncherI][!UpdateMeasure mLauncher2Active]

Am I missing something or have I done it wrong?
User avatar
balala
Rainmeter Sage
Posts: 8634
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: RoundLineMeter Location

balala » February 18th, 2016, 9:56 pm

Once again: you're making a confusion. When you click to the LeftMouseUpAction, you don't absolutely have to refresh your skin. The LeftMouseUpAction uses the !SetVariable bang to immediately set the new value for the LNO variable AND the !WriteKeyValue to permanently write the same new value into the #@#VariablesM2.inc file (and once again: please include the path under the !WriteKeyValue between quotation marks, because if it contain spaces - and probably it is - without those quotation marks, it won't work). Permanently writing the variable into the file is needed to keep its new value, even if a refresh is done. But this not means that you necessarily need to refresh.