alias f12 { dialog -m timing1 timing1 }
dialog timing1 {
option dbu
title Stopwatch Start
size -1 -1 50 70
text "W'ks", 1, 2.5 5 12 10, left
edit "", 2, 15.5 5 33.5 10, %weeks
Text "Days", 3, 2.5 15 12 10, left
edit "", 4, 15.5 15 33.5 10, %days
Text "Hrs", 5, 2.5 25 12 10, left
edit "", 6, 15.5 25 33.5 10, %hours
Text "Mins", 7, 2.5 35 12 10, left
edit "", 8, 15.5 35 33.5 10, %mins
Text "Secs", 9, 2.5 45 12 10, left
edit "", 10, 15.5 45 33.5 10, %secs
button "Start", 11, 2.5 55 45 10, multi
}
on *:dialog:timing1:init:*:{ .msg peer whoami }
on *:dialog:timing1:sclick:11:{ .dialog -x timing1 | stopwatch }
dialog timing2 {
option dbu
title Stopwatch
size -1 -1 300 0
text "Stopwatch v 1.1 by junior.", 820, 2.5 5 75 10, left
text "© Copyrights reserved", 821, 430 5 70 10, right
text "Time left: ? days, ? : ? : ?", 1, 130 5 110 10, left
button Stop, 5, 245.25 3 45.25 10
button Restart, 6, 290.5 3 45.25 10
button Close, 7, 335.75 3 45.25 10
}
on *:dialog:timing2:init:*:{
dll dlls\mdx.dll SetMircVersion $version
dll dlls\mdx.dll MarkDialog $dname
dll dlls\mdx.dll SetDialog $dname style windowedge title
dll dlls\mdx.dll Remove
//dll dlls\kTools.dll DockWindow $dialog(timing2).hwnd > top 2
}
on *:dialog:timing2:sclick:5:{ .timerstopwatch22 off | .did -o timing2 1 1 Stopwatch | .did -o timing2 2 2 has | .did -o timing2 3 3 been | did -o timing2 4 4 turned off! | did -o timing2 820 820 The }
on *:dialog:timing2:sclick:6:{ dialog -m timing1 timing1 | .timerstopwatch22 off }
on *:dialog:timing2:sclick:7:{ dialog -x timing2 | .timerstopwatch22 off }
alias stopwatch {
if !$dialog(timing2) { dialog -m timing2 timing2 }
if (%secs > 0) { .timerstopwatch22 -om 0 1 addtime }
}
alias addtime {
if (%secs == 0) && (%mins > 0) { dec %mins | set %secs 60 }
if (%secs == 0) && (%mins == 0) { set %secsmins 0 }
if (%secsmins == 0) && (%hours > 0) { dec %hours | set %mins 59 | set %secs 59 | unset %secsmins }
if (%secsmins == 0) && (%hours == 0) { set %secsminshours 0 | unset %secsmins }
if (%secsminshours == 0) && (%days > 0) { dec %days | set %hours 23 | set %mins 59 | set %secs 59 }
if (%secsminshours == 0) && (%days == 0) { Set %alltimings 0 }
if (%alltimings == 0) && (%weeks > 0) { dec %weeks | set %days 6 | set %hours 23 | set %mins 59 | set %secs 59 | unset %alltimings }
dec %secs
did -o timing2 1 1 Time left: $iif($len(%weeks) == 1,$+(0,%weeks),%weeks) weeks, $iif($len(%days) == 1,$+(0,%days),%days) days, $iif($len(%hours) == 1,$+(0,%hours),%hours) : $iif($len(%mins) == 1,$+(0,%mins),%mins) : $iif($len(%secs) == 1,$+(0,%secs),%secs)
unset %alltimings
unset %secsminshours
}