It is currently April 27th, 2024, 4:37 pm

[BUG?] !MoveMeter

Report bugs with the Rainmeter application and suggest features.
User avatar
~Faradey~
Posts: 366
Joined: November 12th, 2009, 4:47 pm
Location: Ukraine

[BUG?] !MoveMeter

Post by ~Faradey~ »

Correct me if i'm wrong but there is somewhere bug in !MoveMeter

one of my skins stopped properly working after updating from 2.3.3 1522 (x64) to current beta (2.4 beta (r1578))
after installing 2.3.3 1522 back = all good.

• 1st, dynamicly change the size of layers
• then move meter
• try to change size of layers again and you will see that relative positioning is fails

should be 2px distance between layers.

And problem as i assuming in !MoveMeter, just look at gifs i've made to show you.
2.3.3 version (good)
Image
2.4 version (fails)
Image
it's looks like after !movemeter action it actually sets X, Y and replace formula with r in it or something like this...

example code

Code: Select all

[Rainmeter]
AppVersion=2003000
Update=1000

[Metadata]
Name=Test
Description=
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0

[Variables]
BARWIDTH=388
Hb=264
FontFace=Calibri
FontFace2=wendy
FontHeight1=12
FontHeight2=9
FontColor=17,17,17,255
LineColor2=17,17,17,50
InfoColor=128,128,128,255
SColor=1,1,1,2
tint_pic=255,255,255,255
AA=1
RR=!Redraw


[cDay01]
Measure=Calc
Formula=1
[cDay02]
Measure=Calc
Formula=2
[cDay03]
Measure=Calc
Formula=3
[cDay04]
Measure=Calc
Formula=4

[Random1]
Measure=Calc
Formula=RANDOM
UpdateRandom=1
LowBound=150
HighBound=550

[Random2]
Measure=Calc
Formula=RANDOM
UpdateRandom=1
LowBound=150
HighBound=550

[CalMeterStyle]
FontColor=#FontColor#
FontFace=#FontFace#
FontSize=(#FontHeight1#-1)
AntiAlias=#AA#
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=#SColor#
SolidColor=58,58,58,61
StringAlign=CENTER
PostFix=""
W=((#BARWIDTH#-33)/7)
H=((#Hb#-77)/6)
ClipString=1
MouseOverAction=!execute [!SetOption #CURRENTSECTION# SolidColor #InfoColor#][!UpdateMeter #CURRENTSECTION#][#RR#]
MouseLeaveAction=!execute [!SetOption #CURRENTSECTION# SolidColor 58,58,58,61][!UpdateMeter #CURRENTSECTION#][#RR#]
Group=resize_M | CalStrings
DynamicVariables=1
UpdateDivider=-1

[TestMeter1]
Meter=string
MeasureName=cDay01
X=(13+(#BARWIDTH#-33)/14)
Y=29
MeterStyle=CalMeterStyle

[TestMeter2]
Meter=string
MeasureName=cDay02
X=(((#BARWIDTH#-33)/7)+2)r
Y=r
MeterStyle=CalMeterStyle

[TestMeter3]
Meter=string
MeasureName=cDay03
X=(13+(#BARWIDTH#-33)/14)
Y=(((#Hb#-77)/6)+2)r
MeterStyle=CalMeterStyle

[TestMeter4]
Meter=string
MeasureName=cDay04
X=(((#BARWIDTH#-33)/7)+2)r
Y=r
MeterStyle=CalMeterStyle


[Button1]
Meter=String
FontColor=#FontColor#
FontFace=#FontFace#
FontSize=(#FontHeight1#-1)
AntiAlias=#AA#
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=#SColor#
SolidColor=58,58,58,61
StringAlign=CENTER
PostFix=""
W=150
H=22
Text="Change Size"
X=r
Y=10R
LeftMouseUpAction=[!SetVariable BARWIDTH [Random1]][!SetVariable Hb [Random2]][!UpdateMeterGroup resize_M][#RR#]
[Button2]
Meter=String
FontColor=#FontColor#
FontFace=#FontFace#
FontSize=(#FontHeight1#-1)
AntiAlias=#AA#
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=#SColor#
SolidColor=58,58,58,61
StringAlign=CENTER
PostFix=""
W=150
H=22
Text="Move ME!"
X=r
Y=25r
Group=resize_M
DynamicVariables=1
UpdateDivider=-1
LeftMouseUpAction=[!MoveMeter ((13+(#BARWIDTH#-33)/14)+50) 29 TestMeter1][!MoveMeter ((13+(#BARWIDTH#-33)/14)+50) ((((#Hb#-77)/6)+2)+29) TestMeter3][#RR#]
Last edited by ~Faradey~ on August 1st, 2012, 3:11 pm, edited 1 time in total.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: [BUG] !MoveMeter

Post by Kaelri »

This was part of an intentional change to !MoveMeter, to make it behave more like people expect it to. As you can see in your first example, if you click "Move Me," then "Change Size," the meters go back to their original position, completely ignoring the temporary change in !MoveMeter, which caused some confusion. In 2.4, !MoveMeter permanently changes the option.

If you want to move a meter while keeping relative positions, you can use e.g. !SetOption MeterName X "(formula)r".
User avatar
~Faradey~
Posts: 366
Joined: November 12th, 2009, 4:47 pm
Location: Ukraine

Re: [BUG?] !MoveMeter

Post by ~Faradey~ »

Ok, i see now, thanx :)
I've read change log about changes and i didn't find any note about changes in !MoveMeter, just about
!SetOption now supports changing X, Y, Hidden and MeasureName(n) on meters
aww well, may be i'm blind). So now !MoveMeter (as i understand) acts like !SetOption and sets X,Y position and on the next update cycle if meter has X=#varaible# (variable=100) and moving was on X=200, it would not moves back to 100 (variable=100), in case of DynamicVariable=1 as it was on 2.3?

Could you explain more detailed how current !MoveMeter bang acts?
Is it reads formula and puts result? or it moves meter and keep formula as it is (e.g. X=(#variable#/2))?
Kaelri wrote:If you want to move a meter while keeping relative positions, you can use e.g. !SetOption MeterName X "(formula)r".
tnx, but i'm afraid i can't use it, i need to keep formula, and this, if i do so !SetOption MeterName X "(#variable#/2)r". it will put result: X=50r (in case variable=100).

Ok, do not consider it as a bug, i need to think how to convert code to work with 2.4 and 2.3. may be i don't need to keep formula in X,Y i can't say right now, i've put too much things in there (skin). I'll let you know later. :)
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: [BUG?] !MoveMeter

Post by poiru »

~Faradey~ wrote:Could you explain more detailed how current !MoveMeter bang acts?
In Rainmeter 2.4 beta and later:
  • !MoveMeter parses the parameters and sets the position of the meter. It also sets the X and Y options to the parsed value. If !Redraw is used, the new position will be shown.
  • !SetOption for X/Y works just like with other options. !Update (or !UpdateMeter and !Redraw) must be used to show the new position. !Redraw alone is not enough.
In Rainmeter 2.3.3 and earlier:
  • !MoveMeter parses the parameters and sets the position of the meter. If !Redraw is used, the new position will be shown.
  • !SetOption for X/Y does not work.
~Faradey~ wrote:tnx, but i'm afraid i can't use it, i need to keep formula, and this, if i do so !SetOption MeterName X "(#variable#/2)r". it will put result: X=50r (in case variable=100).
This is not correct. In Rainmeter 2.4 beta and later, the value of X will be (#variable#/2)r.
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: [BUG?] !MoveMeter

Post by poiru »

poiru wrote: This is not correct. In Rainmeter 2.4 beta and later, the value of X will be (#variable#/2)r.
Oops. You are indeed right. Use (#*variable*#/2)r to get what you want :)