It is currently February 25th, 2021, 10:37 pm

[!update meter *] + mass rule out

General topics related to Rainmeter.
User avatar
ShadowDragon
Posts: 38
Joined: January 28th, 2021, 4:30 pm

[!update meter *] + mass rule out

Post by ShadowDragon »

2 questions:

Question 1:

[!updateMeter *] so fa I read or [!updatemeasure *] refeshes/redraw the entire skin, not just the measures in
the list?

for example: (this sample does not work, and used for an example)

Code: Select all

action=[!ShowMeter "1"][!ShowMeter "2"][!ShowMeter "3"][!ShowMeter "4"][!ShowMeter "5"][!Updatemeter "1"][etc]
that x5 for all, or does the update meter in the bang of this meter like:

Code: Select all

action=[!ShowMeter "1"][!ShowMeter "2"][!ShowMeter "3"][!ShowMeter "4"][!ShowMeter "5"][!Updatemeter *]
and update meter 1 through 5 (if you have 8 meters in total or does those refrese as well (same apply to UpdateMeasure in that bangs.

also, wont it be usefull to update bangs like:
[!UpdateMeters "1" "2" "3" or "1 ~ 4" (1 through 4)?


Question 2
This is a tiny bit confused in the documents under shape:

Code: Select all

[MeterShape]
Meter=Shape
Shape=Ellipse 50,50,50 | StrokeWidth 0 | Fill RadialGradient MyGradient1
MyGradient1=0,0 | 155,200,232,255 ; 0.0 | 6,46,75,255 ; 1.0
Shape2=Ellipse 170,50,50 | StrokeWidth 0 | Fill RadialGradient MyGradient2
MyGradient2=0,0,20,20 | 155,200,232,255 ; 0.0 | 6,46,75,255 ; 1.0
this is a bit confusing, while " ; " is to use to rule something out (does not read and is commented out.
still it is used in the MyGradient2, how come ; is than still be readed?

also in Javascript or css, you use // to comment out a line and /* to rule a mass line to comment out and close with */
does rainmeter has something like that as well? for example ;;* and *;; to close or does that not presentted yet?

this is more for clarification than a feature. but I try to learn as much as possible.
Last edited by ShadowDragon on February 18th, 2021, 3:48 pm, edited 1 time in total.
User avatar
Active Colors
Moderator
Posts: 652
Joined: February 16th, 2012, 3:32 am

Re: [!update meter *] + mass rule out

Post by Active Colors »

I can answer your question number one, hopefully somebody else will get to your second question.

______________________________________________________
ShadowDragon wrote: February 18th, 2021, 9:40 am [!updateMeter *] so fa I read or [!updatemeasure *] refeshes/redraw the entire skin, not just the measures in the list?
[!UpdateMeter] and [!UpdateMeasure] do NOT refresh the skin and do NOT redraw the skin. They update values and options but do NOT update the visual representation.
  • [!UpdateMeter] updates a particular meter.
  • [!UpdateMeasure] updates a particular measure.
  • [UpdateMeter *] updates all meters in the skin.
  • [UpdateMeasure *] updates all measures in the skin.
To update the visual bits of your skin you use [!Redraw] bang, therefore, you now redraw the skin.

It can be not obvious from the start but you have to keep in mind these details:
  • To refresh the skin you use the corresponding bang [!Refresh].
  • [!Redraw] bang only redraws the skin.
  • [!Update] bang will update the entire skin (meters and measures) AND will redraw the visual bits.
  • [!UpdateMeter], [!UpdateMeasure], [UpdateMeter *], [UpdateMeasure *] have nothing to do with redrawing or refreshing the skin. They only update values and options but do NOT redraw the visual bits of your skin. Since [!UpdateMeter] and [!UpdateMeasure] instantly update meters and measures you (maybe) want in the same manner to instantly redraw the visual representation of a skin by accompanying those bangs with the [!Redraw] bang.
  • Update=N cycle updates and redraws the skins with the identified frequency. E.g. Update=1000 will update AND redraw all the meters and measures once per second by itself.
  • Any meters or measures with UpdateDivider=-1 will not be affected by the Update=N cycle. In this case you will need to use the [!UpdateMeter] and [!UpdateMeasure] to update them and [!Redraw] to redraw the skin. On the other hand, they WILL be updated and redrawn if you use [!Update] bang.
  • Update=-1 will never update and never redraw the skin unless you use [!UpdateMeter] [!UpdateMeasure] [!Redraw] bangs somewhere in your skin.
This should clarify the further questions in your post.

___________________________________________________________

ShadowDragon wrote: February 18th, 2021, 9:40 am also, wont it be usefull to update bangs like:
[!UpdateMeters "1" "2" "3"
That is why there is Group feature for meters and measures and corresponding [!UpdateMeterGroup]/[!UpdateMeasureGroup] bangs:

Code: Select all

[Meter1]
Meter=String
Group=MyText

[Meter2]
Meter=String
Group=MyText

[Meter3]
Meter=String
Group=MyText

[DoSomethingToMyText]
Meter=Image
LeftMouseUpAction=[!UpdateMeterGroup MyText][!Redraw]
Alternatively, use MeterStyle feature to avoid any repetitions:

Code: Select all

[SomeStyleToMyTexts]
FontFace=Tahoma
SolidColor=0,0,0
Group=MyText

[Meter1]
Meter=String
MeterStyle=SomeStyleToMyTexts

[Meter2]
Meter=String
MeterStyle=SomeStyleToMyTexts

[Meter3]
Meter=String
MeterStyle=SomeStyleToMyTexts

[DoSomethingToMyText]
Meter=Image
LeftMouseUpAction=[!UpdateMeterGroup MyText][!Redraw]
___________________________________________________

ShadowDragon wrote: February 18th, 2021, 9:40 am or "1 ~ 4" (1 through 4)
Rainmeter does not support section indexes at this moment. Maybe in the future thee will be some implementation for this. But you can still achieve such a thing with an extra Calc Measure or a Loop Measure. And how to do it is a different question.


_________________________________

It is good to know what an update cycle does and this will give you a better view when you create your skins: https://docs.rainmeter.net/manual-beta/getting-started/skin-anatomy/#HowASkinBehaves
Even more details in this post: https://forum.rainmeter.net/viewtopic.php?f=14&t=22473#p118764
Last edited by Active Colors on February 18th, 2021, 4:35 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 21546
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [!update meter *] + mass rule out

Post by jsmorley »

The ; character is only treated as a comment directive when it is used as the first character on a line. Anywhere else on the line, and it is treated the same as any other character.

There is no support for a multi-line "block" comment.
User avatar
balala
Rainmeter Sage
Posts: 12279
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [!update meter *] + mass rule out

Post by balala »

Active Colors wrote: February 18th, 2021, 11:02 am The same for [!UpdateMeter *] and [!UpdateMeasure *], they only update all the meters and measures instantly but do not redraw them. You need to accompany these bangs with [!Redraw] as well to instantly redraw the visual elements.
Well, entirely correct, however there is a small terminology mistake. The measures can't be redrawn, they don't have any visual elements. In fact neither the meters can. The skin can be redrawn, when it has to be redrawn.
In most cases the [!UpdateMeter ...] (no matter if you're using it to update certain meters or all, with a *) makes not too much sens without a [!Redraw]. [!UpdateMeasure ...] on the other hand doesn't require [!Redraw] because as said, updating a measure doesn't have a visual impact on the skin, to have to redraw it. But in some cases (when you're updating a meter in a way which has no visual effects), neither the [!UpdateMeter ...] bang doesn't require a [!Redraw] bang.
To better understand when for instance a [!Redraw] bang is required, think when the skin has to be redrawn. When a visual change is going on, [!Redraw] is required, to get the skin redrawn, to immediately see the change. When no a such visual change is going on, no need for [!Redraw]. It's quite simple...
ShadowDragon wrote: February 18th, 2021, 9:40 am Question 2
This is a tiny bit confused in the documents under shape:

Code: Select all

[MeterShape]
Meter=Shape
Shape=Ellipse 50,50,50 | StrokeWidth 0 | Fill RadialGradient MyGradient1
MyGradient1=0,0 | 155,200,232,255 ; 0.0 | 6,46,75,255 ; 1.0
Shape2=Ellipse 170,50,50 | StrokeWidth 0 | Fill RadialGradient MyGradient2
MyGradient2=0,0,20,20 | 155,200,232,255 ; 0.0 | 6,46,75,255 ; 1.0
this is a bit confusing, while " ; " is to use to rule something out (does not read and is commented out.
still it is used in the MyGradient2, how come ; is than still be readed?

also in Javascript or css, you use // to comment out a line and /* to rule a mass line to comment out and close with */
does rainmeter has something like that as well? for example ;;* and *;; to close or does that not presentted yet?

this is more for clarification than a feature. but I try to learn as much as possible.
See this as well: https://forum.rainmeter.net/viewtopic.php?f=5&t=36927&p=188140#p188160
User avatar
ShadowDragon
Posts: 38
Joined: January 28th, 2021, 4:30 pm

Re: [!update meter *] + mass rule out

Post by ShadowDragon »

that explain alot, not quiet sure hour

Code: Select all

;
is treating if not

Code: Select all

:
or

Code: Select all

?
.
but some ways also fascination.

the group measure/meter is also something I readed, but I got all sub menu without it, but didn't know
measures could have groups attached.

I try to shorten the code and see if that works as well, when using the group, this can lessen the size as well.
ty for the clarifications.
but how exacly is the "semicolor" readed as the following line.

Code: Select all

MyGradient2=0,0,20,20 | 155,200,232,255 ; 0.0 | 6,46,75,255 ; 1.0
I asume it start with RGBA color, than use RBGA with 0.0 (which I dont know), with 2nd gradiant color 1.0 (dont know)
which I asume, this code has gradient of 3 colors? if the numbers are RGBA, what is or does 0.0 or 1.0 do (not false false or true false!)

after this, I can treat it to solved :)
User avatar
balala
Rainmeter Sage
Posts: 12279
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [!update meter *] + mass rule out

Post by balala »

ShadowDragon wrote: February 18th, 2021, 1:38 pm but how exacly is the "semicolor" readed as the following line.

Code: Select all

MyGradient2=0,0,20,20 | 155,200,232,255 ; 0.0 | 6,46,75,255 ; 1.0
I asume it start with RGBA color, than use RBGA with 0.0 (which I dont know), with 2nd gradiant color 1.0 (dont know)
which I asume, this code has gradient of 3 colors? if the numbers are RGBA, what is or does 0.0 or 1.0 do (not false false or true false!)
In the above MyGradient2 option are set two colors, and there is a transition between these two colors. The first color (155,200,232,255) is set to the center of the gradient. The fact that it is on the center is set by the 0.0 parameter, which means 0%. The second color 6,46,75,255 is set to 100%, which mathematically is written as 1.0 (100% = 1.0). The semicolon (;) is the character used to delimitate the color code (for instance 155,200,232,255) and the appropriate percentage (written as a decimal number, 0.0 in the above example).
As jsmorley said, this has nothing to do with coemments. You can't comment out just a part of an option (line). Rainmeter IS NOT a programming language, so you can't do what you are doing into a programming language (C++, C#, Lua, or whatever). If the semicolon is not the first character of an option, it doesn't comment out what is written after it.
Just to try it out, you can add a third color to the avove MyGradient2 option. For example: MyGradient2=0,0,20,20 | 155,200,232,255 ; 0.0 | 255,0,0 ; 0.5 | 6,46,75,255 ; 1.0. In this case the beginning of the transition is set to the 155,200,232,255 color with the 0.0), the middle is set to red 255,0,0 by the 0.5 parameter and finally the outside of the circle is set to 6,46,75,255 by the 1.0 parameter.
User avatar
ShadowDragon
Posts: 38
Joined: January 28th, 2021, 4:30 pm

Re: [!update meter *] + mass rule out

Post by ShadowDragon »

that explain alot on gradient, but not the first 4 numbers 0, 0, 20, 20, but I understand the rest.
but I understand it moe on those wats :)

Thank you for explaining and clarifications :)
User avatar
jsmorley
Developer
Posts: 21546
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [!update meter *] + mass rule out

Post by jsmorley »

User avatar
jsmorley
Developer
Posts: 21546
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [!update meter *] + mass rule out

Post by jsmorley »

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Green=119,230,125,255
Yellow=255,222,161,255
Red=244,125,67,255
DarkBlue=65,138,217,255
LightBlue=220,234,250,255

[MeterRoundedRectangle]
Meter=Shape
X=5
Y=5
Shape=Rectangle 0,0,400,100,50 | Fill LinearGradient MyGradient | Extend MyModifiers1
MyModifiers1=StrokeWidth 10 | Stroke Color 47,47,47,255
MyGradient=180 | #Green# ; 0.1 | #Yellow# ; 0.5 | #Red# ; 1.0
AntiAlias=1

[MeterLineOfText]
Meter=String
X=0
Y=10R
FontSize=32
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=10,10,17,10
InlineSetting=GradientColor | 180 | #Green# ; 0.0 | #Yellow# ; 0.5 | #Red# ; 1.0
AntiAlias=1
Text=Some Gradient Text

[MeterSquare1]
Meter=Shape
X=2
Y=10R
Shape=Rectangle 2,2,70,70 | StrokeWidth 4 | Stroke Color 47,47,47,255 | Fill LinearGradient 180Grad
180Grad=180 | #DarkBlue# ; 0.0 | #LightBlue# ; 1.0

[MeterSquare2]
Meter=Shape
X=8R
Y=0r
Shape=Rectangle 2,2,70,70 | StrokeWidth 4 | Stroke Color 47,47,47,255 | Fill LinearGradient 360Grad
360Grad=360 | #DarkBlue# ; 0.0 | #LightBlue# ; 1.0

[MeterSquare3]
Meter=Shape
X=8R
Y=0r
Shape=Rectangle 2,2,70,70 | StrokeWidth 4 | Stroke Color 47,47,47,255 | Fill LinearGradient 90Grad
90Grad=90 | #DarkBlue# ; 0.0 | #LightBlue# ; 1.0

[MeterSquare4]
Meter=Shape
X=8R
Y=0r
Shape=Rectangle 2,2,70,70 | StrokeWidth 4 | Stroke Color 47,47,47,255 | Fill LinearGradient 270Grad
270Grad=270 | #DarkBlue# ; 0.0 | #LightBlue# ; 1.0

[MeterSquare5]
Meter=Shape
X=8R
Y=0r
Shape=Rectangle 2,2,70,70 | StrokeWidth 4 | Stroke Color 47,47,47,255 | Fill LinearGradient RotateGrad
RotateGrad=45 | #DarkBlue# ; 0.0 | #DarkBlue# ; 0.5 | #LightBlue# ; 0.5 | #LightBlue# ; 1.0
DynamicVariables=1

[MeterCombinedAndGradient]
Meter=Shape
X=20R
Y=2
Shape=Rectangle 0,0,130,130,65 | StrokeWidth 4 | Stroke Color 47,47,47,255 | Fill LinearGradient MyGradient
Shape2=Rectangle 65,50,130,130,65
Shape3=Combine Shape | Union Shape2
Shape4=Rectangle 15,197,70,70 | StrokeWidth 4 | Stroke Color 47,47,47,255 | Fill LinearGradient 180Grad
Shape5=Rectangle 15,216,165,30 
Shape6=Combine Shape4 | Union Shape5
MyGradient=230 | #Green# ; 0.0 | #Yellow# ; 0.6 | #Red# ; 1.0
180Grad=180 | #DarkBlue# ; 0.0 | #LightBlue# ; 1.0
1.jpg


Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

; Coordinates: xCenter, yCenter, xOffset, yOffset,  xRadius, yRadius

[Variables]
Green=119,230,125,255
Yellow=255,222,161,255
Red=244,125,67,255
DarkBlue=26,69,112,255
LightBlue=190,212,235,255

[MeterShape1]
Meter=Shape
Shape=Rectangle 40,1,100,100,50 | StrokeWidth 2 | Fill RadialGradient MyGradient1
MyGradient1=0,0 | #LightBlue# ; 0.0 | #DarkBlue# ; 1.0
Shape2=Rectangle 151,1,100,100,50 | StrokeWidth 2 | Fill RadialGradient MyGradient2
MyGradient2=0,0,20,20 | #LightBlue# ; 0.0 | #DarkBlue# ; 1.0

[MeterShape2]
Meter=Shape
Y=10R
Shape=Rectangle 1,0,300,60,20 | StrokeWidth 2 | Fill RadialGradient MyGradient
MyGradient=0,32 | #LightBlue# ; 0.0 | #DarkBlue# ; 1.0

[MeterShape3]
Meter=Shape
Y=10R
Shape=Rectangle 1,0,300,60,20 | StrokeWidth 2 | Fill RadialGradient MyGradient
MyGradient=0,0,0,0,170,50 | #LightBlue# ; 0.0 | #DarkBlue# ; 1.0

[MeterShape4]
Meter=Shape
Y=10R
Shape=Rectangle 1,0,300,60,20 | StrokeWidth 2 | Fill RadialGradient MyGradient
MyGradient=0,-32 | #LightBlue# ; 0.0 | #DarkBlue# ; 1.0

[MeterShape5]
Meter=Shape
Shape=Rectangle 340,30,100,100,50 | StrokeWidth 2 | Fill RadialGradient MyGradient1
Shape2=Rectangle 370,70,100,100,50 | StrokeWidth 2 | Fill RadialGradient MyGradient1 | Scale 2.0,2.0,0,0,0,0
Shape3=Rectangle 320,163,100,100,50 | StrokeWidth 2 | Fill RadialGradient MyGradient1 | Scale 1.5,1.5,0,0,0,0
MyGradient1=0,0,-20,-20 | #LightBlue# ; 0.0 | #DarkBlue# ; 1.0

2.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 12279
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [!update meter *] + mass rule out

Post by balala »

ShadowDragon wrote: February 18th, 2021, 3:48 pm that explain alot on gradient, but not the first 4 numbers 0, 0, 20, 20, but I understand the rest.
The first two numbers (0,0) are representing the coordinates of the center. The last two are the offests. 20,20 means that the gradient origin is shifted 20 pixels to right (the first 20) and 20 pixels down (the second 20), relative to the gradient ellipse's center.
See jsmorley's code above for examples.