马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
OpenDCL自带的延迟函数好像只能用于非模式窗口,而且要键盘动一下,这个函数就会被中断
大家可以试试 odcl 自带的那个例子,显示软件封面的那个倒计时动画。
演示一下
 - ;;小东空间
- (defun c:fla()
- (dcl_project_load "flash.odcl" t)
- (dcl_form_show flash_form1)
- )
- (defun c:flash_Form1_TextButton2_OnClicked (/)
- (setq x 14 y 14)
- (setq stop t speed 0.2)
- (dcl_Control_SetCaption flash_Form1_Label1 (rtos spedd))
- (smove)
- )
- (defun c:flash_Form1_TextButton3_OnClicked (/)
- (setq stop nil)
- )
- (defun smove()
- (while stop
- (delay speed)
- (if (and f+ (> y 256))(setq f+ nil))
- (if (null f+)(setq y (- y 4)))
- (if (and (null f+) (< y 12))(setq f+ t))
- (if f+ (setq y (+ y 4)))
- (if (and g+ (> x 364))(setq g+ nil))
- (if (null g+)(progn(setq x (- x 4))
- (dcl_Control_SetPicture flash_Form1_PictureBox1 102)))
- (if (and (null g+) (< x 12))(setq g+ t))
- (if g+ (progn(setq x (+ x 4))
- (dcl_Control_SetPicture flash_Form1_PictureBox1 103)))
- (dcl_Control_SetPos flash_Form1_PictureBox1 x y)
- ; (dcl_Control_SetPos flash_Form1_PictureBox2 c d)
- (dcl_Control_Redraw flash_Form1)
- )
- )
- (defun c:flash_Form1_TextButton1_OnClicked (/) ;;加速
- (if (> speed 0.05) (setq speed (- speed 0.03)))
- (dcl_Control_SetCaption flash_Form1_Label1 (rtos speed))
- )
- (defun c:flash_Form1_TextButton4_OnClicked (/) ;;减速
- (if (< speed 2) (setq speed (+ speed 0.04)))
- (dcl_Control_SetCaption flash_Form1_Label1 (rtos speed))
- )
- (defun c:flash_Form1_TextButton5_OnClicked (/)
- (setq stop nil)
- (dcl_Form_Close flash_Form1)
- )
- (defun delay (sec / secs)
- (setq secs (getvar "date")
- basetime (* 86400.0 (- secs (fix secs)))
- seconds basetime)
- (while (not (< (+ basetime sec) seconds))
- (setq secs (getvar "date")
- seconds (* 86400.0 (- secs (fix secs))))
- )
- )
|