It is currently April 26th, 2024, 8:37 pm

ShowMeterGroup Problem

Get help with creating, editing & fixing problems with skins
User avatar
xenium
Posts: 867
Joined: January 4th, 2018, 9:52 pm

ShowMeterGroup Problem

Post by xenium »

Hi
I have the following example:

a measure and 2 meters with the same position:

Code: Select all

[MeasureT1Min]
.
.
.
IfMatch=^$
IfMatchAction=[!ShowMeter "MeterT1Min"][!HideMeter "MeterT1Max"]
IfNotMatchAction=[!HideMeter "MeterT1Min"][!ShowMeter "MeterT1Max"]


[MeterT1Max]
Group=T1
x=10
y=10
.
.
Hidden=1

[MeterT1Min]
Group=T1
x=10
y=10
.
.
Hidden=1

2 buttons:

Code: Select all

[Button1]
LeftMouseUpAction=[!HideMeterGroup "T1"]

[Button2]
LeftMouseUpAction=[!ShowMeterGroup "T1"]

The problem is that [Button2] displays both Meters at the same time.

I would like [Button2] to display the Meter according to IfMatch from [MeasureT1Min].


Thanks
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: ShowMeterGroup Problem

Post by pul53dr1v3r »

xenium wrote: November 15th, 2019, 10:47 am
Hi Xenium.

i noticed that both of the meters have the same group names Group=T1.
Try to change it.
User avatar
xenium
Posts: 867
Joined: January 4th, 2018, 9:52 pm

Re: ShowMeterGroup Problem

Post by xenium »

Pul53dr1v3r wrote: November 15th, 2019, 11:07 am Hi Xenium.

i noticed that both of the meters have the same group names Group=T1.
Try to change it.
Hi Pul53dr1v3r.
It must have the same group name
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: ShowMeterGroup Problem

Post by pul53dr1v3r »

xenium wrote: November 15th, 2019, 11:24 am Hi Pul53dr1v3r.
It must have the same group name
does anything change when you refresh the skin?
User avatar
xenium
Posts: 867
Joined: January 4th, 2018, 9:52 pm

Re: ShowMeterGroup Problem

Post by xenium »

I think I solved the problem.
I added to Button1, [!DisableMeasure "MeasureT1Min"]
and to Button2, [!EnableMeasure "MeasureT1Min"].


But the above solution does not work in the following situation
and for # CURRENTSECTION # = 2 (again the two meters are displayed at the same time)

Code: Select all

[MeasureShowDays]
Measure=Calc
Formula=#Days#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeterGroup "T1"][!HideMeterGroup "T2"][!DisableMeasure "MeasureT1Min"][!Redraw]
IfCondition2=(#CURRENTSECTION#=1)
IfTrueAction2=[!ShowMeterGroup "T1"][!HideMeterGroup "T2"][!EnableMeasure "MeasureT1Min"][!Redraw]
IfCondition3=(#CURRENTSECTION#=2)
IfTrueAction3=[!ShowMeterGroup "T1"][!ShowMeterGroup "T2"][!EnableMeasure "MeasureT1Min"][!Redraw]
DynamicVariables=1
User avatar
xenium
Posts: 867
Joined: January 4th, 2018, 9:52 pm

Re: ShowMeterGroup Problem

Post by xenium »

The problem has been solved !
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: ShowMeterGroup Problem

Post by pul53dr1v3r »

xenium wrote: November 15th, 2019, 2:16 pm The problem has been solved !
i was unable to test anything in practice so far, but now even if you have solved it, i'd add this approach (if it's what you wanted to achieve):

with different group names:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
MiddleMouseDownAction=[!Refresh]
Group=test

[Variables]
TestVar=0

[meterBg]
Meter=Shape
Shape=Rectangle 0,0,100,100,5 | Fill Color 0,0,0,120

[MeasureT1Min]
Measure=String
String=#TestVar#
IfMatch=0
IfMatchAction=[!ShowMeterGroup "T1"][!HideMeterGroup "T2"][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!ShowMeterGroup "T2"][!HideMeterGroup "T1"][!UpdateMeter *][!Redraw]

[MeterT1Max]
Meter=String
FontColor=255,0,0
FontSize=8
Group=T2
Text=Max
x=10
y=10
Hidden=1

[MeterT1Min]
Meter=String
FontColor=255,0,0
FontSize=8
Group=T1
x=r
y=r
Text=Min
Hidden=1

[Button1]
Meter=Image
SolidColor=0,0,0
LeftMouseUpAction=[!WriteKeyValue "Variables" "TestVar" "0"][!SetVariable "TestVar" "0"][!RefreshGroup "test"]
X=10
Y=50
W=10
H=10
DynamicVariables=1

[Button2]
Meter=Image
LeftMouseUpAction=[!WriteKeyValue "Variables" "TestVar" "1"][!SetVariable "TestVar" "1"][!RefreshGroup "test"]
SolidColor=0,0,0
X=50
Y=r
W=10
H=10
DynamicVariables=1
with the same group names:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
MiddleMouseDownAction=[!Refresh]
Group=test

[Variables]
TestVar=0

[meterBg]
Meter=Shape
Shape=Rectangle 0,0,100,100,5 | Fill Color 0,0,0,120

[MeasureT1Min]
Measure=String
String=#TestVar#
IfMatch=0
IfMatchAction=[!ShowMeter "MeterT1Min"][!HideMeter "MeterT1Max"]
IfNotMatchAction=[!HideMeter "MeterT1Min"][!ShowMeter "MeterT1Max"]

[MeterT1Max]
Meter=String
FontColor=255,0,0
FontSize=8
Group=T1
Text=Max
x=10
y=10
Hidden=1

[MeterT1Min]
Meter=String
FontColor=255,0,0
FontSize=8
Group=T1
x=r
y=r
Text=Min
Hidden=1

[Button1]
Meter=Image
SolidColor=0,0,0
LeftMouseUpAction=[!WriteKeyValue "Variables" "TestVar" "0"][!SetVariable "TestVar" "0"][!RefreshGroup "test"]
X=10
Y=50
W=10
H=10
DynamicVariables=1

[Button2]
Meter=Image
LeftMouseUpAction=[!WriteKeyValue "Variables" "TestVar" "1"][!SetVariable "TestVar" "1"][!RefreshGroup "test"]
SolidColor=0,0,0
X=50
Y=r
W=10
H=10
DynamicVariables=1
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: ShowMeterGroup Problem

Post by Yamajac »

Use !togglemetergroup

!showmetergroup will show that meter group, so all meters of that group will show.