It is currently April 18th, 2024, 6:01 am
RoundLineMeter Location
-
- Rainmeter Sage
- Posts: 16143
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
-
- Posts: 445
- Joined: March 17th, 2011, 4:54 am
Re: RoundLineMeter Location
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]
[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]
-
- Rainmeter Sage
- Posts: 16143
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: RoundLineMeter Location
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.
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.
-
- Posts: 445
- Joined: March 17th, 2011, 4:54 am
Re: RoundLineMeter Location
My problem is that the above code does not do a refresh!
-
- Rainmeter Sage
- Posts: 16143
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: RoundLineMeter Location
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.
-
- Posts: 445
- Joined: March 17th, 2011, 4:54 am
Re: RoundLineMeter Location
According to JSMorley on page 1, it should ReFresh without using !ReFresh. Thats what I need.
-
- Rainmeter Sage
- Posts: 16143
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: RoundLineMeter Location
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.
So, I recomand to leave the LeftMouseUpAction as it is. It will do its job in both cases: with and without refresh.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: RoundLineMeter Location
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...
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...
-
- Posts: 445
- Joined: March 17th, 2011, 4:54 am
Re: RoundLineMeter Location
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?
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?
-
- Rainmeter Sage
- Posts: 16143
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: RoundLineMeter Location
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.