It is currently May 8th, 2024, 10:57 pm

Help make this "stopwatch" skin working (button behavior)

Get help with creating, editing & fixing problems with skins
Olympus112
Posts: 28
Joined: October 17th, 2023, 5:03 am

Re: Help make this "stopwatch" skin working (button behavior)

Post by Olympus112 »

Thanks, inserting [!Radraw] parameter in the concerned lines (hope that in the right places, as far as I didn't misunderstand the suggestion) maked it work again fine with the Update value changes.

This is how the code look like at the moment:

Code: Select all

[Rainmeter]
;Update=50
Update=1000
MouseOverAction=[!ShowMeter Menu][!ShowMeter Close][!ShowMeter MoveBack][!ShowMeter MoveUp][!Redraw]
MouseLeaveAction=[!HideMeter Menu][!HideMeter Close][!ShowMeter MoveBack][!ShowMeter MoveUp][!Redraw]
OnRefreshAction=[!ShowMeter StopWatchDigits][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!ZPos "2"]

[Metadata]
Author=Original Skin: vlesun (vlesun@newmail.ru) & balala / Modern Stopwatch Modded Skin: Olympus112 (with the help of: eclectic-tech & balala & ikarus1969 & Yincognito & ZXCVBOT: THX!)

[MeterShape]
Meter=Shape
Shape2=Rectangle 257,3,35,35,0 | Fill Color 60,66,76,255  | StrokeWidth 5
Shape=Rectangle 3,1,291,150,20 | Fill Color 215,18,18,255 | StrokeWidth 1
AntiAlias=1

[MeterBackground]
Meter=Image
ImageName=#@#bg_night - Lighter06 - Blocky Edge - Try 3.png
Container=MeterShape
UpdateDivider=-1
AntiAlias=1

[Variables]
color.Skin=00000001
color.Title=FFFFFFFF
color.Text=FFFFFFFF
text.Size=8
font.Name=Segoe UI
Snooze=#CURRENTPATH##@#Ding.wav

Running=0

Reset0="[!DisableMeasure MeasureStopwatch][!DisableMeasure MeasureCounterStopwatch][!UpdateMeasure MeasureStopwatch][!UpdateMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStart]"

Reset1="[!DisableMeasure MeasureStopwatch][!DisableMeasure MeasureCounterStopwatch][!UpdateMeasure MeasureStopwatch][!UpdateMeasure MeasureCounterStopwatch][!EnableMeasure MeasureStopwatch][!EnableMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStop]"

[sTimer]
FontColor=#color.Text#
FontEffectColor=00000020
FontFace=#font.Name#
FontSize=#text.Size#
StringAlign=CENTER
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
AntiAlias=1

[sStopWatch]
FontColor=#color.Text#
FontEffectColor=00000020
FontFace=#font.Name#
FontSize=42
StringAlign=CENTER
StringCase=NONE
StringEffect=SHADOW
AntiAlias=1

;--------------------------------------------------------------------
;Interface
;--------------------------------------------------------------------

; [MeterTimerWindow]
; Meter=Image
; ImageName=#@#bgtimer.png

; [MeterStopwatchWindow]
; Meter=Image
; ImageName=#@#bgstopwatch.png
; Hidden=1

; [MeterSettingsTab]
; Meter=Image
; X=2
; Y=3
; ImageName=#@#Settings.png
; Hidden=1

; [MeterAlarmBeforeTab]
; Meter=Image
; X=2
; Y=3
; ImageName=#@#AlarmBefore.png
; Hidden=1

;--------------------------------------------------------------------
;Counter for stopwatch
;--------------------------------------------------------------------

[MeasureCounterStopwatchTime]
Measure=Time
AverageSize=20

[MeasureCounterStopwatch]
Measure=Calc
Formula=( MeasureCounterStopwatch = 0 ? ( MeasureCounterStopwatchTime - MeasureStopwatch / 10 ) : MeasureCounterStopwatch )
Disabled=1

[MeasureStopwatch]
Measure=Calc
Formula=( MeasureCounterStopwatch = 0 ? MeasureStopwatch : (MeasureCounterStopwatchTime - MeasureCounterStopwatch) *10 )

;--------------------------------------------------------------------
;Stopwatch
;--------------------------------------------------------------------

[MeasureStopwatchDigit1]
Measure=Calc
Formula=MeasureStopwatch%10
MaxValue=3

[MeasureStopwatchDigit1-2]
Measure=Calc
Formula= ( MeasureStopwatchDigit1 > 9 ? 9 : MeasureStopwatchDigit1 )

[MeasureStopwatchDigit2]
Measure=Calc
Formula=(FLOOR(MeasureStopwatch/10))%60
RegExpSubstitute=1
Substitute="^(.)$":"0\1"

[MeasureStopwatchDigit3]
Measure=Calc
Formula=(FLOOR(MeasureStopwatch/600))%60
RegExpSubstitute=1
Substitute="^(.)$":"0\1"

[MeasureStopwatchDigit4]
Measure=Calc
Formula=(FLOOR(MeasureStopwatch/36000))%100
MaxValue=2
RegExpSubstitute=1
Substitute="^(.)$":"0\1"

[BeepHourly]
Measure=Calc
Formula=((( MeasureStopwatchDigit3=0 ) ? 1 : 0 ) + (( MeasureStopwatchDigit4<>0 ) ? 1 : 0 ))
IfEqualAction=!execute [PLAY #Snooze#]
IfEqualValue=2

;--------------------------------------------------------------------
;Buttons for Stopwatch
;--------------------------------------------------------------------

[MeterTimerStart]
Meter=Image
ImageName=#@#Start Cutted Smaller.png
X=111
Y=107
MeterStyle=sTimer
;Text=Start
;MouseActionCursor=1
;LeftMouseUpAction=[!EnableMeasure MeasureStopwatch][!EnableMeasure MeasureCounterStopwatch][!HideMeter MeterTimerStart][!ShowMeter MeterTimerStop][!SetVariable Running 1]
MouseOverAction=[!ShowMeter MeterTimerStartDarker][!Redraw]
MouseLeaveAction=[!HideMeter MeterTimerStartDarker][!Redraw]

[MeterTimerStartDarker]
Meter=Image
ImageName=#@#Start Cutted Smaller - Darker.png
X=111
Y=107
MeterStyle=sTimer
;Text=Start
MouseActionCursor=1
LeftMouseUpAction=[!EnableMeasure MeasureStopwatch][!EnableMeasure MeasureCounterStopwatch][!HideMeter MeterTimerStart][!ShowMeter MeterTimerStop][!SetVariable Running 1][!WriteKeyValue Rainmeter Update 16]
Hidden=1

[MeterTimerStop]
Meter=Image
ImageName=#@#Stop Cutted Smaller 2.png
X=111
Y=107
MeterStyle=sTimer
;Text=Stop
;MouseActionCursor=1
;LeftMouseUpAction=[!DisableMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!SetVariable Running 0][!WriteKeyValue Rainmeter Update "1000"]
;MouseActionCursor=1
DynamicVariables=1
MouseOverAction=[!ShowMeter MeterTimerStopDarker][!Redraw]
MouseLeaveAction=[!HideMeter MeterTimerStopDarker][!Redraw]

[MeterTimerStopDarker]
Meter=Image
ImageName=#@#Stop Cutted Smaller 2 - Darker.png
X=111
Y=107
MeterStyle=sTimer
;Text=Stop
MouseActionCursor=1
LeftMouseUpAction=[!DisableMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!SetVariable Running 0][!WriteKeyValue Rainmeter Update 1000]
MouseActionCursor=1
DynamicVariables=1
Hidden=1

[MeterTimerReset]
Meter=Image
ImageName=#@#Reset Button Small Yellow 1.png
X=210
Y=112
MeterStyle=sTimer
;Text=Reset
;MouseActionCursor=1
;LeftMouseUpAction=[#Reset[#Running]]
Hidden=1
DynamicVariables=1
;MouseOverAction=[!ShowMeter App1Text][!ShowMeter MeterTimerResetDarker]
;MouseLeaveAction=[!HideMeter App1Text][!HideMeter MeterTimerResetDarker]
MouseOverAction=[!ShowMeter MeterTimerResetDarker]
MouseLeaveAction=[!HideMeter MeterTimerResetDarker]


[MeterTimerResetDarker]
Meter=Image
ImageName=#@#Reset Button Small Yellow 1 - Darker 3.png
X=210
Y=112
MeterStyle=sTimer
;Text=Reset
MouseActionCursor=1
LeftMouseUpAction=[#Reset[#Running]]
Hidden=1
DynamicVariables=1
MouseOverAction=[!ShowMeter App1Text][!HideMeter MeterTimerReset]
MouseLeaveAction=[!HideMeter App1Text][!ShowMeter MeterTimerReset]
Hidden=1

[StopWatchDigits]
Meter=String
MeasureName=MeasureStopwatchDigit4
MeasureName2=MeasureStopwatchDigit3
MeasureName3=MeasureStopwatchDigit2
MeasureName4=MeasureStopwatchDigit1-2
X=150
Y=10
MeterStyle=sStopWatch
Text=%1:%2:%3
AntiAlias=1
Hidden=1

[Menu]
Meter=IMAGE
ImageName=#@#Menu Buttons Plain 4.png
X=270
Y=4
;X=267
;Y=8
Hidden=1

[Close]
Meter=BUTTON
ButtonImage=#@#Close.png
X=270
Y=4
;X=267
;Y=8
ButtonCommand=!DeactivateConfig
Hidden=1
SolidColor=0,0,0,1
MouseOverAction=[!ShowMeter App4Text]
MouseLeaveAction=[!HideMeter App4Text]

[MoveUp]
Meter=BUTTON
ButtonImage=#@#Move UP.png
X=270
Y=27
;X=267
;Y=31
ButtonCommand=[!zpos 2]
Hidden=1
SolidColor=0,0,0,1
MouseOverAction=[!ShowMeter App3Text]
MouseLeaveAction=[!HideMeter App3Text]

[MoveBack]
Meter=BUTTON
ButtonImage=#@#Move Down 01.png
X=270
Y=47
;X=267
;Y=51
ButtonCommand=[!zpos -2]
Hidden=1
SolidColor=0,0,0,1
MouseOverAction=[!ShowMeter App2Text]
MouseLeaveAction=[!HideMeter App2Text]

[App1Text]
Meter=String
FontFace=#font.Name#
;FontColor=241,209,78
;FontColor=255,162,23
FontColor=255,180,45
FontSize=10
FontWeight=800
Text=Reset
x=243
y=121
Text=Valami
DynamicVariables=1
Hidden=1
AntiAlias=1

[App2Text]
Meter=String
FontFace=#font.Name#
FontColor=249,154,65
FontSize=10
FontWeight=800
Text=Move to Desktop
StringAlign=Center
x=150
;x=165
y=76
Text=Valami
DynamicVariables=1
Hidden=1
AntiAlias=1

[App3Text]
Meter=String
FontFace=#font.Name#
FontColor=11,210,226
FontSize=10
FontWeight=800
Text=Move to Topmost
StringAlign=Center
x=150
;x=160
y=76
Text=Valami
DynamicVariables=1
Hidden=1
AntiAlias=1

[App4Text]
Meter=String
FontFace=#font.Name#
FontColor=255,72,72
FontSize=10
FontWeight=800
Text=Close
StringAlign=Center
x=150
;x=246
y=76
Text=Valami
DynamicVariables=1
Hidden=1
AntiAlias=1
If you can check it please, let me know if there are still any need for some improvement or correction!
ZXCVBOT

Re: Help make this "stopwatch" skin working (button behavior)

Post by ZXCVBOT »

Bellisimo! You completed the Windows 7-Stopwatch! :cheer:
Olympus112
Posts: 28
Joined: October 17th, 2023, 5:03 am

Re: Help make this "stopwatch" skin working (button behavior)

Post by Olympus112 »

ZXCVBOT wrote: October 26th, 2023, 3:05 pm Bellisimo! You completed the Windows 7-Stopwatch! :cheer:
Thanks, but why "Windows 7"?
ZXCVBOT

Re: Help make this "stopwatch" skin working (button behavior)

Post by ZXCVBOT »

The look and feel of buttons.
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help make this "stopwatch" skin working (button behavior)

Post by Yincognito »

ZXCVBOT wrote: October 26th, 2023, 12:56 pmPS: Do you mean that MYiniMeter v2 is coming :bounce: ?????????? Cause it's been too long!
Well, not exactly coming, more like, erm, preparing to come (hopefully, not forever)... :lol:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help make this "stopwatch" skin working (button behavior)

Post by Yincognito »

Olympus112 wrote: October 26th, 2023, 2:12 pmIf you can check it please, let me know if there are still any need for some improvement or correction!
I don't normally do that, since in many cases I have the habit of preferring to rewrite the whole skin instead of the more tedious approach of correcting things line by line, especially when there are more things to improve / correct. Anyway, I suppose the lower update is needed here for functional reasons, considering that it's the only way to approximate the milliseconds - but keep in mind the update stuff + redraw or just redraw if it's about hiding / showing as the way to get immediate effects for future cases.

What I will do though for now is provide a single shape alternative for the background container:

Code: Select all

[MeterShape]
Meter=Shape
Shape=Path CustomPath | StrokeWidth 1 | Stroke Color 255,0,0,255 | Fill Color 0,0,0,255
CustomPath=3,25 | LineTo 3,128 | CurveTo 25,151,3,151 | LineTo 271,151 | CurveTo 293,128,293,151 | LineTo 293,2 | LineTo 25,2 | CurveTo 3,25,3,2
AntiAlias=1
This draws a Path Shape (esentially, a free form shape made of other shape elements separated by the | symbol) replicating your drawing earlier. I also changed coordinates a bit to get rid of the unwanted effects near the top right corner. If you're confused by the curve elements, take a look at its syntax (an element's starting coordinates are omitted when used in paths, because they are the ones where the previous path element ends) and the example. Basically, the values I used in the curves above are the coordinates of the other two points in an isosceles right triangle (with the first point being the one corresponding to the omitted starting coordinates).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Olympus112
Posts: 28
Joined: October 17th, 2023, 5:03 am

Re: Help make this "stopwatch" skin working (button behavior)

Post by Olympus112 »

Yincognito: Thanks, I see no difference in the Skin's look, so I guess I will use your solution regarding the MaterShape section.

Tho' one thing still seems to be a bit "buggy" from my point of view: When I load up the Skin at the first time and press on "Start" the counting seems to be delayed for like 2-5 seconds, so the first 2-5 seconds get counted a bit delayed. After I Stop the counting, or Reset it, I begins just like it should, without delay. I wonder if that could be the cause of the recently added [!WriteKeyValue Rainmeter Update "1000"] and [!WriteKeyValue Rainmeter Update "16"] parameters...? As it didn't happened before I have added these parameters.

Any suggestions to get this working more perfectly?

Thanks again!

So here is the bit newer 2.1 version:
Modern Stopwatch V2.1.zip
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help make this "stopwatch" skin working (button behavior)

Post by Yincognito »

Olympus112 wrote: October 27th, 2023, 9:44 amI wonder if that could be the cause of the recently added [!WriteKeyValue Rainmeter Update "1000"] and [!WriteKeyValue Rainmeter Update "16"] parameters...? As it didn't happened before I have added these parameters.
If it didn't happened before adding those, why not removing them? I mean, the Update has to stay under a second (like your initial 50) at all times for functional purposes related to counting time, so there would be no reason to change it.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help make this "stopwatch" skin working (button behavior)

Post by balala »

Olympus112 wrote: October 27th, 2023, 9:44 am Any suggestions to get this working more perfectly?
Why do you want to use an Update value set to 16 on a skin which doesn1t have to be updated more than once per second? I definitely would use the default Update=1000. On most skins (and all all clock, stopwatch, countdown skins, excepting the ones which have set an animation for instance) you shouldn't use another Update then the default one. Definitely don't see why to rewrite the Update when you click a button. Note that it's completely useless to rewrite the Update value, because this can't be altered dynamically, so doesn1t really matter what are you writing there with a !WriteKeyValue bang, the skis still uses the value set when you refreshed / loaded the skin. Doesn't worth to rewrite this option. This rewrite can cause the delay I think.
But my biggest concern is that I think the code is way too complicated. It would be simplified extremely, if you'd renounce to lot of measures and meters. For instance why to calculate the digits of the time shown one by one? There are simpler ways to do this. Here is what would I do:
  • Remove the [MeasureCounterStopwatchTime] and [MeasureCounterStopwatch] measures.Are usless.
  • Replace the [MeasureStopwatch] measure by the following much simpler one:

    Code: Select all

    [MeasureStopwatch]
    Measure=Calc
    Formula=( MeasureStopwatch + 1 )
    Disabled=1
    See this measure is disabled. It'll be enabled when you click the Start button and in that moment it'll start counting from 0.
  • The above measure returns a number. We have to convert this number to a time (or have to add a time format). This can be easily done by an Uptime measure. For instance the following one. Add it to your code:

    Code: Select all

    [MeasureTime]
    Measure=Uptime
    SecondsValue=[MeasureStopwatch]
    Format=%3!02i!:%2!02i!:%1!02i!
    DynamicVariables=1
    This measure returns the elapsed seconds with a time format, set by the Format option.
  • The above measure makes completely useless the [MeasureStopwatchDigit1], [MeasureStopwatchDigit1-2], [MeasureStopwatchDigit2], [MeasureStopwatchDigit3] and [MeasureStopwatchDigit4] measures. Remove them.
  • The LeftMouseUpAction options of the [MeterTimerStartDarker] and [MeterTimerStopDarker] meters can be simplified as well. Replace them by the following options:

    Code: Select all

    [MeterTimerStartDarker]
    ...
    LeftMouseUpAction=[!EnableMeasure MeasureStopwatch][!UnpauseMeasure MeasureStopwatch][!HideMeter MeterTimerStart][!ShowMeter MeterTimerStop][!SetVariable Running 1]
    ...
    
    ...
    [MeterTimerStopDarker]
    ...
    LeftMouseUpAction=[!PauseMeasure MeasureStopwatch][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!SetVariable Running 0]
    ...
    (take care not to alter the other, here not-posted, options of these meters)
  • Finally replace the MeasureName and the Text options of the [StopWatchDigits] meter as it follows:

    Code: Select all

    [StopWatchDigits]
    ...
    MeasureName=MeasureTime
    ...
    Text=%1
    ...
  • Replace the LeftMouseUpAction option of the [MeterTimerResetDarker] meter by the following one:

    Code: Select all

    [MeterTimerResetDarker]
    ...LeftMouseUpAction=[!UnpauseMeasure MeasureStopwatch][!UpdateMeasure MeasureStopwatch][!DisableMeasure MeasureStopwatch]
This is all. This way the code simplifies. The Update value into the [Rainmeter] section has to be set back to Update=1000, make sure to have this value written there.
Just in case, i paste here the whole code. I left commented out the removed options, to let you easier follow what did I alter in the code. Obviously further improvements are still possible (and most probably even needed), but this I think lets you to take a look to this newer approach.
So, here is the whole code:

Code: Select all

[Rainmeter]
Update=1000
MouseOverAction=[!ShowMeter Menu][!ShowMeter Close][!ShowMeter MoveBack][!ShowMeter MoveUp][!Redraw]
MouseLeaveAction=[!HideMeter Menu][!HideMeter Close][!ShowMeter MoveBack][!ShowMeter MoveUp][!Redraw]
OnRefreshAction=[!ShowMeter StopWatchDigits][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!ZPos "2"]

[Metadata]
Author=Original Skin: vlesun (vlesun@newmail.ru) & balala / Modern Stopwatch Modded Skin: Olympus112 (with the help of: eclectic-tech & balala & ikarus1969: THX!)

;[MeterShape]
;Meter=Shape
;Shape2=Rectangle 257,3,35,35,0 | Fill Color 60,66,76,255  | StrokeWidth 5
;Shape=Rectangle 3,1,291,150,20 | Fill Color 215,18,18,255 | StrokeWidth 1
;AntiAlias=1

[MeterShape]
Meter=Shape
Shape=Path CustomPath | StrokeWidth 1 | Stroke Color 255,0,0,255 | Fill Color 0,0,0,255
CustomPath=3,25 | LineTo 3,128 | CurveTo 25,151,3,151 | LineTo 271,151 | CurveTo 293,128,293,151 | LineTo 293,2 | LineTo 25,2 | CurveTo 3,25,3,2
AntiAlias=1

[MeterBackground]
Meter=Image
ImageName=#@#bg_night - Lighter06 - Blocky Edge - Try 3.png
Container=MeterShape
UpdateDivider=-1
AntiAlias=1

[Variables]
color.Skin=00000001
color.Title=FFFFFFFF
color.Text=FFFFFFFF
text.Size=8
font.Name=Segoe UI
Snooze=#CURRENTPATH##@#Ding.wav

Running=0

Reset0="[!DisableMeasure MeasureStopwatch][!DisableMeasure MeasureCounterStopwatch][!UpdateMeasure MeasureStopwatch][!UpdateMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStart]"

Reset1="[!DisableMeasure MeasureStopwatch][!DisableMeasure MeasureCounterStopwatch][!UpdateMeasure MeasureStopwatch][!UpdateMeasure MeasureCounterStopwatch][!EnableMeasure MeasureStopwatch][!EnableMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStop]"

[sTimer]
FontColor=#color.Text#
FontEffectColor=00000020
FontFace=#font.Name#
FontSize=#text.Size#
StringAlign=CENTER
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
AntiAlias=1

[sStopWatch]
FontColor=#color.Text#
FontEffectColor=00000020
FontFace=#font.Name#
FontSize=42
StringAlign=CENTER
StringCase=NONE
StringEffect=SHADOW
AntiAlias=1

;--------------------------------------------------------------------
;Interface
;--------------------------------------------------------------------

; [MeterTimerWindow]
; Meter=Image
; ImageName=#@#bgtimer.png

; [MeterStopwatchWindow]
; Meter=Image
; ImageName=#@#bgstopwatch.png
; Hidden=1

; [MeterSettingsTab]
; Meter=Image
; X=2
; Y=3
; ImageName=#@#Settings.png
; Hidden=1

; [MeterAlarmBeforeTab]
; Meter=Image
; X=2
; Y=3
; ImageName=#@#AlarmBefore.png
; Hidden=1

;--------------------------------------------------------------------
;Counter for stopwatch
;--------------------------------------------------------------------

;[MeasureCounterStopwatchTime]
;Measure=Time
;AverageSize=20

;[MeasureCounterStopwatch]
;Measure=Calc
;Formula=( MeasureCounterStopwatch = 0 ? ( MeasureCounterStopwatchTime - MeasureStopwatch / 10 ) : MeasureCounterStopwatch )
;Disabled=1

[MeasureStopwatch]
Measure=Calc
Formula=( MeasureStopwatch + 1 )
Disabled=1
;Formula=( MeasureCounterStopwatch = 0 ? MeasureStopwatch : (MeasureCounterStopwatchTime - MeasureCounterStopwatch) *10 )

[MeasureTime]
Measure=Uptime
SecondsValue=[MeasureStopwatch]
Format=%3!02i!:%2!02i!:%1!02i!
DynamicVariables=1

;--------------------------------------------------------------------
;Stopwatch
;--------------------------------------------------------------------

;[MeasureStopwatchDigit1]
;Measure=Calc
;Formula=MeasureStopwatch%10
;MaxValue=3

;[MeasureStopwatchDigit1-2]
;Measure=Calc
;Formula= ( MeasureStopwatchDigit1 > 9 ? 9 : MeasureStopwatchDigit1 )

;[MeasureStopwatchDigit2]
;Measure=Calc
;Formula=(FLOOR(MeasureStopwatch/10))%60
;RegExpSubstitute=1
;Substitute="^(.)$":"0\1"

;[MeasureStopwatchDigit3]
;Measure=Calc
;Formula=(FLOOR(MeasureStopwatch/600))%60
;RegExpSubstitute=1
;Substitute="^(.)$":"0\1"

;[MeasureStopwatchDigit4]
;Measure=Calc
;Formula=(FLOOR(MeasureStopwatch/36000))%100
;MaxValue=2
;RegExpSubstitute=1
;Substitute="^(.)$":"0\1"

;[BeepHourly]
;Measure=Calc
;Formula=((( MeasureStopwatchDigit3=0 ) ? 1 : 0 ) + (( MeasureStopwatchDigit4<>0 ) ? 1 : 0 ))
;IfEqualAction=!execute [PLAY #Snooze#]
;IfEqualValue=2

;--------------------------------------------------------------------
;Buttons for Stopwatch
;--------------------------------------------------------------------

[MeterTimerStart]
Meter=Image
ImageName=#@#Start Cutted Smaller.png
X=111
Y=107
MeterStyle=sTimer
;Text=Start
;MouseActionCursor=1
;LeftMouseUpAction=[!EnableMeasure MeasureStopwatch][!EnableMeasure MeasureCounterStopwatch][!HideMeter MeterTimerStart][!ShowMeter MeterTimerStop][!SetVariable Running 1]
MouseOverAction=[!ShowMeter MeterTimerStartDarker][!Redraw]
MouseLeaveAction=[!HideMeter MeterTimerStartDarker][!Redraw]

[MeterTimerStartDarker]
Meter=Image
ImageName=#@#Start Cutted Smaller - Darker.png
X=111
Y=107
MeterStyle=sTimer
;Text=Start
MouseActionCursor=1
LeftMouseUpAction=[!EnableMeasure MeasureStopwatch][!UnpauseMeasure MeasureStopwatch][!HideMeter MeterTimerStart][!ShowMeter MeterTimerStop][!SetVariable Running 1]
;[!EnableMeasure MeasureCounterStopwatch][!HideMeter MeterTimerStart][!ShowMeter MeterTimerStop][!SetVariable Running 1]
Hidden=1

[MeterTimerStop]
Meter=Image
ImageName=#@#Stop Cutted Smaller 2.png
X=111
Y=107
MeterStyle=sTimer
;Text=Stop
;MouseActionCursor=1
;LeftMouseUpAction=[!DisableMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!SetVariable Running 0][!WriteKeyValue Rainmeter Update "1000"]
;MouseActionCursor=1
DynamicVariables=1
MouseOverAction=[!ShowMeter MeterTimerStopDarker][!Redraw]
MouseLeaveAction=[!HideMeter MeterTimerStopDarker][!Redraw]

[MeterTimerStopDarker]
Meter=Image
ImageName=#@#Stop Cutted Smaller 2 - Darker.png
X=111
Y=107
MeterStyle=sTimer
;Text=Stop
MouseActionCursor=1
LeftMouseUpAction=[!PauseMeasure MeasureStopwatch][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!SetVariable Running 0]
;LeftMouseUpAction=[!DisableMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!SetVariable Running 0]
MouseActionCursor=1
DynamicVariables=1
Hidden=1

[MeterTimerReset]
Meter=Image
ImageName=#@#Reset Button Small Yellow 1.png
X=210
Y=112
MeterStyle=sTimer
;Text=Reset
;MouseActionCursor=1
Hidden=1
DynamicVariables=1
;MouseOverAction=[!ShowMeter App1Text][!ShowMeter MeterTimerResetDarker]
;MouseLeaveAction=[!HideMeter App1Text][!HideMeter MeterTimerResetDarker]
MouseOverAction=[!ShowMeter MeterTimerResetDarker]
MouseLeaveAction=[!HideMeter MeterTimerResetDarker]


[MeterTimerResetDarker]
Meter=Image
ImageName=#@#Reset Button Small Yellow 1 - Darker 3.png
X=210
Y=112
MeterStyle=sTimer
;Text=Reset
MouseActionCursor=1
LeftMouseUpAction=[!UnpauseMeasure MeasureStopwatch][!UpdateMeasure MeasureStopwatch][!DisableMeasure MeasureStopwatch]
Hidden=1
DynamicVariables=1
MouseOverAction=[!HideMeter MeterTimerReset][!Redraw]
MouseLeaveAction=[!ShowMeter MeterTimerReset]
Hidden=1
SolidColor=255,0,0

[StopWatchDigits]
Meter=String
MeasureName=MeasureTime
X=150
Y=10
MeterStyle=sStopWatch
Text=%1
AntiAlias=1
Hidden=1

[Menu]
Meter=IMAGE
ImageName=#@#Menu Buttons Plain 4.png
X=270
Y=4
;X=267
;Y=8
Hidden=1

[Close]
Meter=BUTTON
ButtonImage=#@#Close.png
X=270
Y=4
;X=267
;Y=8
ButtonCommand=!DeactivateConfig
Hidden=1
SolidColor=0,0,0,1
MouseOverAction=[!ShowMeter App4Text]
MouseLeaveAction=[!HideMeter App4Text]

[MoveUp]
Meter=BUTTON
ButtonImage=#@#Move UP.png
X=270
Y=27
;X=267
;Y=31
ButtonCommand=[!zpos 2]
Hidden=1
SolidColor=0,0,0,1
MouseOverAction=[!ShowMeter App3Text]
MouseLeaveAction=[!HideMeter App3Text]

[MoveBack]
Meter=BUTTON
ButtonImage=#@#Move Down 01.png
X=270
Y=47
;X=267
;Y=51
ButtonCommand=[!zpos -2]
Hidden=1
SolidColor=0,0,0,1
MouseOverAction=[!ShowMeter App2Text]
MouseLeaveAction=[!HideMeter App2Text]
Olympus112
Posts: 28
Joined: October 17th, 2023, 5:03 am

Re: Help make this "stopwatch" skin working (button behavior)

Post by Olympus112 »

balala wrote: October 27th, 2023, 1:00 pm Why do you want to use an Update value set to 16 on a skin which doesn1t have to be updated more than once per second? I definitely would use the default Update=1000. On most skins (and all all clock, stopwatch, countdown skins, excepting the ones which have set an animation for instance) you shouldn't use another Update then the default one. Definitely don't see why to rewrite the Update when you click a button. Note that it's completely useless to rewrite the Update value, because this can't be altered dynamically, so doesn1t really matter what are you writing there with a !WriteKeyValue bang, the skis still uses the value set when you refreshed / loaded the skin. Doesn't worth to rewrite this option. This rewrite can cause the delay I think.
But my biggest concern is that I think the code is way too complicated. It would be simplified extremely, if you'd renounce to lot of measures and meters. For instance why to calculate the digits of the time shown one by one? There are simpler ways to do this. Here is what would I do:
  • Remove the [MeasureCounterStopwatchTime] and [MeasureCounterStopwatch] measures.Are usless.
  • Replace the [MeasureStopwatch] measure by the following much simpler one:

    Code: Select all

    [MeasureStopwatch]
    Measure=Calc
    Formula=( MeasureStopwatch + 1 )
    Disabled=1
    See this measure is disabled. It'll be enabled when you click the Start button and in that moment it'll start counting from 0.
  • The above measure returns a number. We have to convert this number to a time (or have to add a time format). This can be easily done by an Uptime measure. For instance the following one. Add it to your code:

    Code: Select all

    [MeasureTime]
    Measure=Uptime
    SecondsValue=[MeasureStopwatch]
    Format=%3!02i!:%2!02i!:%1!02i!
    DynamicVariables=1
    This measure returns the elapsed seconds with a time format, set by the Format option.
  • The above measure makes completely useless the [MeasureStopwatchDigit1], [MeasureStopwatchDigit1-2], [MeasureStopwatchDigit2], [MeasureStopwatchDigit3] and [MeasureStopwatchDigit4] measures. Remove them.
  • The LeftMouseUpAction options of the [MeterTimerStartDarker] and [MeterTimerStopDarker] meters can be simplified as well. Replace them by the following options:

    Code: Select all

    [MeterTimerStartDarker]
    ...
    LeftMouseUpAction=[!EnableMeasure MeasureStopwatch][!UnpauseMeasure MeasureStopwatch][!HideMeter MeterTimerStart][!ShowMeter MeterTimerStop][!SetVariable Running 1]
    ...
    
    ...
    [MeterTimerStopDarker]
    ...
    LeftMouseUpAction=[!PauseMeasure MeasureStopwatch][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!SetVariable Running 0]
    ...
    (take care not to alter the other, here not-posted, options of these meters)
  • Finally replace the MeasureName and the Text options of the [StopWatchDigits] meter as it follows:

    Code: Select all

    [StopWatchDigits]
    ...
    MeasureName=MeasureTime
    ...
    Text=%1
    ...
  • Replace the LeftMouseUpAction option of the [MeterTimerResetDarker] meter by the following one:

    Code: Select all

    [MeterTimerResetDarker]
    ...LeftMouseUpAction=[!UnpauseMeasure MeasureStopwatch][!UpdateMeasure MeasureStopwatch][!DisableMeasure MeasureStopwatch]
This is all. This way the code simplifies. The Update value into the [Rainmeter] section has to be set back to Update=1000, make sure to have this value written there.
Just in case, i paste here the whole code. I left commented out the removed options, to let you easier follow what did I alter in the code. Obviously further improvements are still possible (and most probably even needed), but this I think lets you to take a look to this newer approach.
So, here is the whole code:

Code: Select all

[Rainmeter]
Update=1000
MouseOverAction=[!ShowMeter Menu][!ShowMeter Close][!ShowMeter MoveBack][!ShowMeter MoveUp][!Redraw]
MouseLeaveAction=[!HideMeter Menu][!HideMeter Close][!ShowMeter MoveBack][!ShowMeter MoveUp][!Redraw]
OnRefreshAction=[!ShowMeter StopWatchDigits][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!ZPos "2"]

[Metadata]
Author=Original Skin: vlesun (vlesun@newmail.ru) & balala / Modern Stopwatch Modded Skin: Olympus112 (with the help of: eclectic-tech & balala & ikarus1969: THX!)

;[MeterShape]
;Meter=Shape
;Shape2=Rectangle 257,3,35,35,0 | Fill Color 60,66,76,255  | StrokeWidth 5
;Shape=Rectangle 3,1,291,150,20 | Fill Color 215,18,18,255 | StrokeWidth 1
;AntiAlias=1

[MeterShape]
Meter=Shape
Shape=Path CustomPath | StrokeWidth 1 | Stroke Color 255,0,0,255 | Fill Color 0,0,0,255
CustomPath=3,25 | LineTo 3,128 | CurveTo 25,151,3,151 | LineTo 271,151 | CurveTo 293,128,293,151 | LineTo 293,2 | LineTo 25,2 | CurveTo 3,25,3,2
AntiAlias=1

[MeterBackground]
Meter=Image
ImageName=#@#bg_night - Lighter06 - Blocky Edge - Try 3.png
Container=MeterShape
UpdateDivider=-1
AntiAlias=1

[Variables]
color.Skin=00000001
color.Title=FFFFFFFF
color.Text=FFFFFFFF
text.Size=8
font.Name=Segoe UI
Snooze=#CURRENTPATH##@#Ding.wav

Running=0

Reset0="[!DisableMeasure MeasureStopwatch][!DisableMeasure MeasureCounterStopwatch][!UpdateMeasure MeasureStopwatch][!UpdateMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStart]"

Reset1="[!DisableMeasure MeasureStopwatch][!DisableMeasure MeasureCounterStopwatch][!UpdateMeasure MeasureStopwatch][!UpdateMeasure MeasureCounterStopwatch][!EnableMeasure MeasureStopwatch][!EnableMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStop]"

[sTimer]
FontColor=#color.Text#
FontEffectColor=00000020
FontFace=#font.Name#
FontSize=#text.Size#
StringAlign=CENTER
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
AntiAlias=1

[sStopWatch]
FontColor=#color.Text#
FontEffectColor=00000020
FontFace=#font.Name#
FontSize=42
StringAlign=CENTER
StringCase=NONE
StringEffect=SHADOW
AntiAlias=1

;--------------------------------------------------------------------
;Interface
;--------------------------------------------------------------------

; [MeterTimerWindow]
; Meter=Image
; ImageName=#@#bgtimer.png

; [MeterStopwatchWindow]
; Meter=Image
; ImageName=#@#bgstopwatch.png
; Hidden=1

; [MeterSettingsTab]
; Meter=Image
; X=2
; Y=3
; ImageName=#@#Settings.png
; Hidden=1

; [MeterAlarmBeforeTab]
; Meter=Image
; X=2
; Y=3
; ImageName=#@#AlarmBefore.png
; Hidden=1

;--------------------------------------------------------------------
;Counter for stopwatch
;--------------------------------------------------------------------

;[MeasureCounterStopwatchTime]
;Measure=Time
;AverageSize=20

;[MeasureCounterStopwatch]
;Measure=Calc
;Formula=( MeasureCounterStopwatch = 0 ? ( MeasureCounterStopwatchTime - MeasureStopwatch / 10 ) : MeasureCounterStopwatch )
;Disabled=1

[MeasureStopwatch]
Measure=Calc
Formula=( MeasureStopwatch + 1 )
Disabled=1
;Formula=( MeasureCounterStopwatch = 0 ? MeasureStopwatch : (MeasureCounterStopwatchTime - MeasureCounterStopwatch) *10 )

[MeasureTime]
Measure=Uptime
SecondsValue=[MeasureStopwatch]
Format=%3!02i!:%2!02i!:%1!02i!
DynamicVariables=1

;--------------------------------------------------------------------
;Stopwatch
;--------------------------------------------------------------------

;[MeasureStopwatchDigit1]
;Measure=Calc
;Formula=MeasureStopwatch%10
;MaxValue=3

;[MeasureStopwatchDigit1-2]
;Measure=Calc
;Formula= ( MeasureStopwatchDigit1 > 9 ? 9 : MeasureStopwatchDigit1 )

;[MeasureStopwatchDigit2]
;Measure=Calc
;Formula=(FLOOR(MeasureStopwatch/10))%60
;RegExpSubstitute=1
;Substitute="^(.)$":"0\1"

;[MeasureStopwatchDigit3]
;Measure=Calc
;Formula=(FLOOR(MeasureStopwatch/600))%60
;RegExpSubstitute=1
;Substitute="^(.)$":"0\1"

;[MeasureStopwatchDigit4]
;Measure=Calc
;Formula=(FLOOR(MeasureStopwatch/36000))%100
;MaxValue=2
;RegExpSubstitute=1
;Substitute="^(.)$":"0\1"

;[BeepHourly]
;Measure=Calc
;Formula=((( MeasureStopwatchDigit3=0 ) ? 1 : 0 ) + (( MeasureStopwatchDigit4<>0 ) ? 1 : 0 ))
;IfEqualAction=!execute [PLAY #Snooze#]
;IfEqualValue=2

;--------------------------------------------------------------------
;Buttons for Stopwatch
;--------------------------------------------------------------------

[MeterTimerStart]
Meter=Image
ImageName=#@#Start Cutted Smaller.png
X=111
Y=107
MeterStyle=sTimer
;Text=Start
;MouseActionCursor=1
;LeftMouseUpAction=[!EnableMeasure MeasureStopwatch][!EnableMeasure MeasureCounterStopwatch][!HideMeter MeterTimerStart][!ShowMeter MeterTimerStop][!SetVariable Running 1]
MouseOverAction=[!ShowMeter MeterTimerStartDarker][!Redraw]
MouseLeaveAction=[!HideMeter MeterTimerStartDarker][!Redraw]

[MeterTimerStartDarker]
Meter=Image
ImageName=#@#Start Cutted Smaller - Darker.png
X=111
Y=107
MeterStyle=sTimer
;Text=Start
MouseActionCursor=1
LeftMouseUpAction=[!EnableMeasure MeasureStopwatch][!UnpauseMeasure MeasureStopwatch][!HideMeter MeterTimerStart][!ShowMeter MeterTimerStop][!SetVariable Running 1]
;[!EnableMeasure MeasureCounterStopwatch][!HideMeter MeterTimerStart][!ShowMeter MeterTimerStop][!SetVariable Running 1]
Hidden=1

[MeterTimerStop]
Meter=Image
ImageName=#@#Stop Cutted Smaller 2.png
X=111
Y=107
MeterStyle=sTimer
;Text=Stop
;MouseActionCursor=1
;LeftMouseUpAction=[!DisableMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!SetVariable Running 0][!WriteKeyValue Rainmeter Update "1000"]
;MouseActionCursor=1
DynamicVariables=1
MouseOverAction=[!ShowMeter MeterTimerStopDarker][!Redraw]
MouseLeaveAction=[!HideMeter MeterTimerStopDarker][!Redraw]

[MeterTimerStopDarker]
Meter=Image
ImageName=#@#Stop Cutted Smaller 2 - Darker.png
X=111
Y=107
MeterStyle=sTimer
;Text=Stop
MouseActionCursor=1
LeftMouseUpAction=[!PauseMeasure MeasureStopwatch][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!SetVariable Running 0]
;LeftMouseUpAction=[!DisableMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!SetVariable Running 0]
MouseActionCursor=1
DynamicVariables=1
Hidden=1

[MeterTimerReset]
Meter=Image
ImageName=#@#Reset Button Small Yellow 1.png
X=210
Y=112
MeterStyle=sTimer
;Text=Reset
;MouseActionCursor=1
Hidden=1
DynamicVariables=1
;MouseOverAction=[!ShowMeter App1Text][!ShowMeter MeterTimerResetDarker]
;MouseLeaveAction=[!HideMeter App1Text][!HideMeter MeterTimerResetDarker]
MouseOverAction=[!ShowMeter MeterTimerResetDarker]
MouseLeaveAction=[!HideMeter MeterTimerResetDarker]


[MeterTimerResetDarker]
Meter=Image
ImageName=#@#Reset Button Small Yellow 1 - Darker 3.png
X=210
Y=112
MeterStyle=sTimer
;Text=Reset
MouseActionCursor=1
LeftMouseUpAction=[!UnpauseMeasure MeasureStopwatch][!UpdateMeasure MeasureStopwatch][!DisableMeasure MeasureStopwatch]
Hidden=1
DynamicVariables=1
MouseOverAction=[!HideMeter MeterTimerReset][!Redraw]
MouseLeaveAction=[!ShowMeter MeterTimerReset]
Hidden=1
SolidColor=255,0,0

[StopWatchDigits]
Meter=String
MeasureName=MeasureTime
X=150
Y=10
MeterStyle=sStopWatch
Text=%1
AntiAlias=1
Hidden=1

[Menu]
Meter=IMAGE
ImageName=#@#Menu Buttons Plain 4.png
X=270
Y=4
;X=267
;Y=8
Hidden=1

[Close]
Meter=BUTTON
ButtonImage=#@#Close.png
X=270
Y=4
;X=267
;Y=8
ButtonCommand=!DeactivateConfig
Hidden=1
SolidColor=0,0,0,1
MouseOverAction=[!ShowMeter App4Text]
MouseLeaveAction=[!HideMeter App4Text]

[MoveUp]
Meter=BUTTON
ButtonImage=#@#Move UP.png
X=270
Y=27
;X=267
;Y=31
ButtonCommand=[!zpos 2]
Hidden=1
SolidColor=0,0,0,1
MouseOverAction=[!ShowMeter App3Text]
MouseLeaveAction=[!HideMeter App3Text]

[MoveBack]
Meter=BUTTON
ButtonImage=#@#Move Down 01.png
X=270
Y=47
;X=267
;Y=51
ButtonCommand=[!zpos -2]
Hidden=1
SolidColor=0,0,0,1
MouseOverAction=[!ShowMeter App2Text]
MouseLeaveAction=[!HideMeter App2Text]
Thanks, but there are some issues with the full code you have posted: The reset button gets a strange reddish "aura" on MouseOver and it doesn't work as I intended it to work: when the counting is active (so the Stop button is showing) it just resets the counting, but doesn't starts it over again immediately.

But I have also made the modifications one-by-one as you described it, and that seems to be almost all around fine, except that the Reset button was still not working properly. I have to add the [#Reset[#Running]] variable to the [MeterTimerResetDarker] section again, like this:
LeftMouseUpAction=[!UnpauseMeasure MeasureStopwatch][!UpdateMeasure MeasureStopwatch][!DisableMeasure MeasureStopwatch][#Reset[#Running]]
But this way is still a bit buggy, cause when pressing the Reset button while the counting is active, it doesn't fully resets it to full zeros, rather than begins the counting from 00:00:01. That's the one thing I have noticed so far that doesn't quite fit in the picture, so I ask you to how to fix it to begin the counting resetted again to full zeros (00:00:00), like it was working in my previous versions?

Heres the full code as it looks at the moment:

Code: Select all

[Rainmeter]
;Update=1000
Update=1000
MouseOverAction=[!ShowMeter Menu][!ShowMeter Close][!ShowMeter MoveBack][!ShowMeter MoveUp][!Redraw]
MouseLeaveAction=[!HideMeter Menu][!HideMeter Close][!ShowMeter MoveBack][!ShowMeter MoveUp][!Redraw]
OnRefreshAction=[!ShowMeter StopWatchDigits][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!ZPos "2"]

[Metadata]
Author=Original Skin: vlesun (vlesun@newmail.ru) & balala / Modern Stopwatch Modded Skin: Olympus112 (with the help of: eclectic-tech & balala & ikarus1969: THX!)

;[MeterShape]
;Meter=Shape
;Shape2=Rectangle 257,3,35,35,0 | Fill Color 60,66,76,255  | StrokeWidth 5
;Shape=Rectangle 3,1,291,150,20 | Fill Color 215,18,18,255 | StrokeWidth 1
;AntiAlias=1

[MeterShape]
Meter=Shape
Shape=Path CustomPath | StrokeWidth 1 | Stroke Color 255,0,0,255 | Fill Color 0,0,0,255
CustomPath=3,25 | LineTo 3,128 | CurveTo 25,151,3,151 | LineTo 271,151 | CurveTo 293,128,293,151 | LineTo 293,2 | LineTo 25,2 | CurveTo 3,25,3,2
AntiAlias=1

[MeterBackground]
Meter=Image
ImageName=#@#bg_night - Lighter06 - Blocky Edge - Try 3.png
Container=MeterShape
UpdateDivider=-1
AntiAlias=1

[Variables]
color.Skin=00000001
color.Title=FFFFFFFF
color.Text=FFFFFFFF
text.Size=8
font.Name=Segoe UI
Snooze=#CURRENTPATH##@#Ding.wav

Running=0

Reset0="[!DisableMeasure MeasureStopwatch][!DisableMeasure MeasureCounterStopwatch][!UpdateMeasure MeasureStopwatch][!UpdateMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStart]"

Reset1="[!DisableMeasure MeasureStopwatch][!DisableMeasure MeasureCounterStopwatch][!UpdateMeasure MeasureStopwatch][!UpdateMeasure MeasureCounterStopwatch][!EnableMeasure MeasureStopwatch][!EnableMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStop]"

[sTimer]
FontColor=#color.Text#
FontEffectColor=00000020
FontFace=#font.Name#
FontSize=#text.Size#
StringAlign=CENTER
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
AntiAlias=1

[sStopWatch]
FontColor=#color.Text#
FontEffectColor=00000020
FontFace=#font.Name#
FontSize=42
StringAlign=CENTER
StringCase=NONE
StringEffect=SHADOW
AntiAlias=1

;--------------------------------------------------------------------
;Interface
;--------------------------------------------------------------------

; [MeterTimerWindow]
; Meter=Image
; ImageName=#@#bgtimer.png

; [MeterStopwatchWindow]
; Meter=Image
; ImageName=#@#bgstopwatch.png
; Hidden=1

; [MeterSettingsTab]
; Meter=Image
; X=2
; Y=3
; ImageName=#@#Settings.png
; Hidden=1

; [MeterAlarmBeforeTab]
; Meter=Image
; X=2
; Y=3
; ImageName=#@#AlarmBefore.png
; Hidden=1

;--------------------------------------------------------------------
;Counter for stopwatch
;--------------------------------------------------------------------

;[MeasureCounterStopwatchTime]
;Measure=Time
;AverageSize=20

;[MeasureCounterStopwatch]
;Measure=Calc
;Formula=( MeasureCounterStopwatch = 0 ? ( MeasureCounterStopwatchTime - MeasureStopwatch / 10 ) : MeasureCounterStopwatch )
;Disabled=1

[MeasureStopwatch]
Measure=Calc
Formula=( MeasureStopwatch + 1 )
Disabled=1

[MeasureTime]
Measure=Uptime
SecondsValue=[MeasureStopwatch]
Format=%3!02i!:%2!02i!:%1!02i!
DynamicVariables=1

;--------------------------------------------------------------------
;Stopwatch
;--------------------------------------------------------------------

[MeasureStopwatchDigit1]
Measure=Calc
Formula=MeasureStopwatch%10
MaxValue=3

[MeasureStopwatchDigit1-2]
Measure=Calc
Formula= ( MeasureStopwatchDigit1 > 9 ? 9 : MeasureStopwatchDigit1 )

[MeasureStopwatchDigit2]
Measure=Calc
Formula=(FLOOR(MeasureStopwatch/10))%60
RegExpSubstitute=1
Substitute="^(.)$":"0\1"

[MeasureStopwatchDigit3]
Measure=Calc
Formula=(FLOOR(MeasureStopwatch/600))%60
RegExpSubstitute=1
Substitute="^(.)$":"0\1"

[MeasureStopwatchDigit4]
Measure=Calc
Formula=(FLOOR(MeasureStopwatch/36000))%100
MaxValue=2
RegExpSubstitute=1
Substitute="^(.)$":"0\1"

[BeepHourly]
Measure=Calc
Formula=((( MeasureStopwatchDigit3=0 ) ? 1 : 0 ) + (( MeasureStopwatchDigit4<>0 ) ? 1 : 0 ))
IfEqualAction=!execute [PLAY #Snooze#]
IfEqualValue=2

;--------------------------------------------------------------------
;Buttons for Stopwatch
;--------------------------------------------------------------------

[MeterTimerStart]
Meter=Image
ImageName=#@#Start Cutted Smaller.png
X=111
Y=107
MeterStyle=sTimer
;Text=Start
;MouseActionCursor=1
;LeftMouseUpAction=[!EnableMeasure MeasureStopwatch][!EnableMeasure MeasureCounterStopwatch][!HideMeter MeterTimerStart][!ShowMeter MeterTimerStop][!SetVariable Running 1]
MouseOverAction=[!ShowMeter MeterTimerStartDarker][!Redraw]
MouseLeaveAction=[!HideMeter MeterTimerStartDarker][!Redraw]

[MeterTimerStartDarker]
Meter=Image
ImageName=#@#Start Cutted Smaller - Darker.png
X=111
Y=107
MeterStyle=sTimer
;Text=Start
MouseActionCursor=1
LeftMouseUpAction=[!EnableMeasure MeasureStopwatch][!UnpauseMeasure MeasureStopwatch][!HideMeter MeterTimerStart][!ShowMeter MeterTimerStop][!SetVariable Running 1]
Hidden=1

[MeterTimerStop]
Meter=Image
ImageName=#@#Stop Cutted Smaller 2.png
X=111
Y=107
MeterStyle=sTimer
;Text=Stop
;MouseActionCursor=1
;LeftMouseUpAction=[!DisableMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!SetVariable Running 0][!WriteKeyValue Rainmeter Update "1000"]
;MouseActionCursor=1
DynamicVariables=1
MouseOverAction=[!ShowMeter MeterTimerStopDarker][!Redraw]
MouseLeaveAction=[!HideMeter MeterTimerStopDarker][!Redraw]

[MeterTimerStopDarker]
Meter=Image
ImageName=#@#Stop Cutted Smaller 2 - Darker.png
X=111
Y=107
MeterStyle=sTimer
;Text=Stop
MouseActionCursor=1
LeftMouseUpAction=[!PauseMeasure MeasureStopwatch][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][!SetVariable Running 0]
MouseActionCursor=1
DynamicVariables=1
Hidden=1

[MeterTimerReset]
Meter=Image
ImageName=#@#Reset Button Small Yellow 1.png
X=210
Y=112
MeterStyle=sTimer
;Text=Reset
;MouseActionCursor=1
;LeftMouseUpAction=[#Reset[#Running]]
Hidden=1
DynamicVariables=1
;MouseOverAction=[!ShowMeter App1Text][!ShowMeter MeterTimerResetDarker]
;MouseLeaveAction=[!HideMeter App1Text][!HideMeter MeterTimerResetDarker]
MouseOverAction=[!ShowMeter MeterTimerResetDarker]
MouseLeaveAction=[!HideMeter MeterTimerResetDarker]


[MeterTimerResetDarker]
Meter=Image
ImageName=#@#Reset Button Small Yellow 1 - Darker 3.png
X=210
Y=112
MeterStyle=sTimer
;Text=Reset
MouseActionCursor=1
;LeftMouseUpAction=[#Reset[#Running]]
LeftMouseUpAction=[!UnpauseMeasure MeasureStopwatch][!UpdateMeasure MeasureStopwatch][!DisableMeasure MeasureStopwatch][#Reset[#Running]]
Hidden=1
DynamicVariables=1
MouseOverAction=[!ShowMeter App1Text][!HideMeter MeterTimerReset][!Redraw]
MouseLeaveAction=[!HideMeter App1Text][!ShowMeter MeterTimerReset]
Hidden=1

[StopWatchDigits]
Meter=String
MeasureName=MeasureTime
X=150
Y=10
MeterStyle=sStopWatch
Text=%1
AntiAlias=1
Hidden=1

[Menu]
Meter=IMAGE
ImageName=#@#Menu Buttons Plain 4.png
X=270
Y=4
;X=267
;Y=8
Hidden=1

[Close]
Meter=BUTTON
ButtonImage=#@#Close.png
X=270
Y=4
;X=267
;Y=8
ButtonCommand=!DeactivateConfig
Hidden=1
SolidColor=0,0,0,1
MouseOverAction=[!ShowMeter App4Text]
MouseLeaveAction=[!HideMeter App4Text]

[MoveUp]
Meter=BUTTON
ButtonImage=#@#Move UP.png
X=270
Y=27
;X=267
;Y=31
ButtonCommand=[!zpos 2]
Hidden=1
SolidColor=0,0,0,1
MouseOverAction=[!ShowMeter App3Text]
MouseLeaveAction=[!HideMeter App3Text]

[MoveBack]
Meter=BUTTON
ButtonImage=#@#Move Down 01.png
X=270
Y=47
;X=267
;Y=51
ButtonCommand=[!zpos -2]
Hidden=1
SolidColor=0,0,0,1
MouseOverAction=[!ShowMeter App2Text]
MouseLeaveAction=[!HideMeter App2Text]

[App1Text]
Meter=String
FontFace=#font.Name#
;FontColor=241,209,78
;FontColor=255,162,23
FontColor=255,180,45
FontSize=10
FontWeight=800
Text=Reset
x=243
y=121
Text=Valami
DynamicVariables=1
Hidden=1
AntiAlias=1

[App2Text]
Meter=String
FontFace=#font.Name#
FontColor=249,154,65
FontSize=10
FontWeight=800
Text=Move to Desktop
StringAlign=Center
x=150
;x=165
y=76
Text=Valami
DynamicVariables=1
Hidden=1
AntiAlias=1

[App3Text]
Meter=String
FontFace=#font.Name#
FontColor=11,210,226
FontSize=10
FontWeight=800
Text=Move to Topmost
StringAlign=Center
x=150
;x=160
y=76
Text=Valami
DynamicVariables=1
Hidden=1
AntiAlias=1

[App4Text]
Meter=String
FontFace=#font.Name#
FontColor=255,72,72
FontSize=10
FontWeight=800
Text=Close
StringAlign=Center
x=150
;x=246
y=76
Text=Valami
DynamicVariables=1
Hidden=1
AntiAlias=1
Thanks!