计时器-初级程序-极语言教程

//窗口代码:

整数 窗体,时,冒号,分,冒号,秒,冒号,毫秒,进度条,标签4,时,冒号,分,冒号,秒,冒号,毫秒,开始计时,标签4,时,冒号,分,冒号,秒,冒号,毫秒,开始计时,倒计时记录框,每各计时记录框,标签29,列表框30,列表框31,列表框32,列表框33;
程序资源 24,"清单.xml";
程序段 加载窗体
整数 左=(桌面.宽-688)>>1,上=(桌面.高-341)>>1;
窗体=创建窗口($100,程序.名称,"万能计时器",$14CF0064,左,上,688,341,0,0,0,0);
时=创建窗口($0,"Static","",$50200000,0,20,60,20,窗体,1,2,0);
冒号=创建窗口($20000,"Static","",$50000000,60,20,10,20,窗体,2,2,0);
分=创建窗口($20000,"Static","",$50000000,70,20,60,20,窗体,3,2,0);
冒号=创建窗口($20000,"Static","",$50000000,130,20,10,20,窗体,4,2,0);
秒=创建窗口($20000,"Static","",$50000000,140,20,60,20,窗体,5,2,0);
冒号=创建窗口($20000,"Static","",$50000000,130,300,10,20,窗体,6,2,0);
毫秒=创建窗口($20000,"Static","毫秒",$50000000,210,20,60,20,窗体,7,2,0);
进度条=创建窗口($0,"msctls_progress32","进度条",$50000001,0,40,510,20,窗体,8,19,0);
标签4=创建窗口($20000,"Static","设置倒计时时间,点击开始,时间到报警。",$50000000,0,60,290,20,窗体,9,2,0);
时=创建窗口($200,"Edit","00",$50010000,0,300,60,20,窗体,10,4,0);
冒号=创建窗口($20000,"Static","",$50000000,200,300,10,20,窗体,11,2,0);
分=创建窗口($200,"Edit","00",$50010000,70,300,60,20,窗体,12,4,0);
冒号=创建窗口($20000,"Static","",$50000000,60,300,10,20,窗体,13,2,0);
秒=创建窗口($200,"Edit","00",$50010000,140,300,60,20,窗体,14,4,0);
冒号=创建窗口($20000,"Static","",$50000000,200,20,10,20,窗体,15,2,0);
毫秒=创建窗口($200,"Edit","00",$50010000,210,300,60,20,窗体,16,4,0);
开始计时=创建窗口($200,"Button","开始计时",$50000000,280,320,70,50,窗体,17,3,0);
标签4=创建窗口($20000,"Static","设置每隔倒计时时间,点击开始,时间到报警,并记录次数。",$50000000,0,270,410,20,窗体,18,2,0);
时=创建窗口($200,"Edit","00",$50210000,0,80,60,20,窗体,19,4,0);
冒号=创建窗口($20000,"Static","",$50000000,200,80,10,20,窗体,20,2,0);
分=创建窗口($200,"Edit","00",$50010000,70,80,60,20,窗体,21,4,0);
冒号=创建窗口($20000,"Static","",$50000000,60,80,10,20,窗体,22,2,0);
秒=创建窗口($200,"Edit","00",$50010000,140,80,60,20,窗体,23,4,0);
冒号=创建窗口($20000,"Static","",$50000000,130,80,10,20,窗体,24,2,0);
毫秒=创建窗口($200,"Edit","00",$50010000,210,80,60,20,窗体,25,4,0);
开始计时=创建窗口($200,"Button","开始计时",$50000000,280,100,70,50,窗体,26,3,0);
倒计时记录框=创建窗口($200,"Edit","计时记录框",$50210000,0,100,270,170,窗体,27,4,0);
每各计时记录框=创建窗口($200,"Edit","每各计时记录框",$50210000,0,320,270,180,窗体,28,4,0);
标签29=创建窗口($0,"Static","当前时间",$50000000,0,0,270,20,窗体,29,2,0);
列表框30=创建窗口($200,"listbox","00",$50210081,0,80,60,20,窗体,30,9,0);
列表框31=创建窗口($200,"listbox","00",$50210081,70,80,60,20,窗体,31,9,0);
列表框32=创建窗口($200,"listbox","00",$50210081,140,80,60,20,窗体,32,9,0);
列表框33=创建窗口($200,"listbox","00",$50210081,210,80,60,20,窗体,33,9,0);
窗体启动;读取消息
结束

 

//程序代码:

小程序 窗体消息(整数 窗口,整数 消息,整数 参数,整数 数据)
判断(消息)
为 窗口关闭 {停止(0)}
否则{处理窗口(窗口,消息,参数,数据)}
结束;

小程序 窗体启动
设置定时(窗体,1,120,@定时事件)
桌面.左=窗体
读取消息
结束;

时间类 日期;
小程序 定时事件(整数 窗口,整数 消息,整数 编号,整数 毫秒)
当前时间(日期);
改控件数(窗体,1,日期.时,0)
改控件数(窗体,3,日期.分,0)
改控件数(窗体,5,日期.秒,0)
改控件数(窗体,7,日期.毫秒,0)

结束;

小程序 窗体启动
设置定时(窗体,1,120,@定时事件)
桌面.左=窗体
读取消息
结束;

时间类 日期;
小程序 定时事件(整数 窗口,整数 消息,整数 编号,整数 毫秒)
当前时间(日期);
改控件数(窗体,10,日期.时,0)
改控件数(窗体,12,日期.分,0)
改控件数(窗体,14,日期.秒,0)
改控件数(窗体,16,日期.毫秒,0)
结束;

 

posted @ 2024-11-26 14:21  Rkey  阅读(1)  评论(0编辑  收藏  举报