area menu
[
moveable
state[mouse_out] = (0, 0)
state[mouse_over] = (21, 0)
]
area toggle_wake
[
state[on] = (62, 17)
state[off] = (67, 17)
]
area snooze
[
moveable
state[on] = (72, 17)
state[off] = (77, 17)
]
area mode
[
moveable
state[alarm] = (29, 22)
state[timer] = (40, 22)
state[counter] = (51, 22)
function OnState(clock)
{
PlaySound(click.wav)
SetState(go_button, default)
SetState(clock_switch, switched)
SetState(alarm_switch, default)
SetState(timer_switch, default)
SetState(counter_switch, default)
}
function OnState(alarm)
{
PlaySound(click.wav)
SetState(go_button, default)
SetState(clock_switch, default)
SetState(alarm_switch, switched)
SetState(timer_switch, default)
SetState(counter_switch, default)
}
function OnState(counter)
{
PlaySound(click.wav)
IfState(counter_active, on)
SetState(go_button, on)
Else
SetState(go_button, off)
SetState(clock_switch, default)
SetState(alarm_switch, default)
SetState(timer_switch, default)
SetState(counter_switch, switched)
}
function OnState(timer)
{
PlaySound(click.wav)
IfState(timer_active, on)
SetState(go_button, on)
Else
SetState(go_button, off)
SetState(clock_switch, default)
SetState(alarm_switch, default)
SetState(timer_switch, switched)
SetState(counter_switch, default)
}
]
area clock_switch
[
state[switched] = (42, 0)
function OnMouseDownOver()
{
Command(goto_clock_mode)
}
]
area alarm_switch
[
state[switched] = (42, 0)
function OnMouseDownOver()
{
Command(goto_alarm_mode)
}
]
area timer_switch
[
state[switched] = (42, 0)
function OnMouseDownOver()
{
Command(goto_timer_mode)
}
]
area counter_switch
[
state[switched] = (42, 0)
function OnMouseDownOver()
{
Command(goto_counter_mode)
}
]
area go_button
[
moveable
state[off] = (0, 22)
state[on] = (14, 22)
function OnMouseDown()
{
IfNotState(mode, clock)
{IfNotState(mode, alarm)
{
IfState(mode, counter)
{
IfState(counter_active, off)
Command(start_counter)
else
Command(stop_counter)
}
Else { IfState(mode, timer)
{
IfState(timer_active, off)
Command(start_timer)
Else
Command(stop_timer)
}}
}}
}
]
area counter_active
[
function OnState(on)
{
IfState(mode, counter)
SetState(go_button, on)
}
function OnState(off)
{
IfState(mode, counter)
SetState(go_button, off)
}
]
area timer_active
[
function OnState(on)
{
IfState(mode, timer)
SetState(go_button, on)
}
function OnState(off)
{
IfState(mode, timer)
SetState(go_button, off)
}
]