import win.ui;
/*DSG{{*/
var winform = win.form(text="液晶计时器控件演示";right=615;bottom=303)
winform.add(
buttonClock={cls="button";text="时钟";left=488;top=80;right=557;bottom=110;z=2};
buttonCountDownTimer={cls="button";text="启动倒计时";left=240;top=176;right=384;bottom=208;z=3};
buttonReset={cls="button";text="重置";left=408;top=80;right=477;bottom=110;z=7};
buttonStop={cls="button";text="暂停";left=320;top=80;right=389;bottom=110;z=5};
buttonTimer={cls="button";text="启动计时器";left=240;top=216;right=384;bottom=248;z=4};
datetimepick={cls="datetimepick";left=64;top=180;right=218;bottom=206;edge=1;updown=1;z=6};
plusBk={cls="plus";left=64;top=62;right=283;bottom=122;z=1}
)
/*}}*/
import win.ui.lcdClock;
var lcdClock = win.ui.lcdClock(winform.plusBk);
lcdClock.startClock();
winform.buttonClock.oncommand = function(id,event){
lcdClock.startClock()
}
winform.buttonCountDownTimer.oncommand = function(id,event){
lcdClock.startCountDownTimer(,function(){
winform.msgbox("时间到了")
})
}
winform.buttonTimer.oncommand = function(id,event){
lcdClock.startTimer()
}
winform.buttonStop.oncommand = function(id,event){
lcdClock.stop();
}
winform.datetimepick.setFormat("' 设置倒计时: 'mm':'ss");
winform.datetimepick.time = time(0);
winform.datetimepick.onnotify = function(id,code,ptr){
if(code == 0xFFFFFD09/*_DTN_DATETIMECHANGE*/){
lcdClock.resetCountDownTimer( winform.datetimepick.time )
}
}
winform.buttonReset.oncommand = function(id,event){
lcdClock.resetTimer();
lcdClock.resetCountDownTimer(winform.datetimepick.time);
}
winform.show()
win.loopMessage();