这是另一位大虾编写的,提供参考。 (defun C:dcltut (/ loopmax dcltut_dat) (setq dcltut_dat (load_dialog "dcltut.dcl")) (new_dialog "dcltut" dcltut_dat) (if (null loopmax)(setq loopmax 100)) (setq fillx (dimx_tile "progbar")) (setq filly (dimy_tile "progbar")) (start_image "progbar") (fill_image 0 0 fillx filly -15) (end_image)
(set_tile "max" (itoa loopmax)) (action_tile "start" "(loopfunc)") (action_tile "ok" "(done_dialog)") (action_tile "cnacel" "(done_dialog)") (start_dialog) (UNLOAD_DIALOG dcltut_dat) ) (defun loopfunc (/ fillx filly loopfunc loopmax loop-counter) (setq fillx (dimx_tile "progbar")) (setq filly (dimy_tile "progbar")) (start_image "progbar") (fill_image 0 0 fillx filly -15) (end_image) (setq loop-counter 0) (setq loopmax (atoi (get_tile "max"))) (while (<= loop-counter loopmax) (start_image "progbar") (fill_image 0 0 (/ (* loop-counter fillx) loopmax) filly 5) (end_image) (set_tile "error" (rtos loop-counter)) (setq loop-counter (1+ loop-counter)) ) )
dcltut : dialog { spacer_1; fixed_width = true; label = "DCL 滚动条"; key = "br-label"; : row { : button { key = "start"; label = "&Start"; } : edit_box { key = "max"; label = "&Max:"; } } : image { key = "progbar"; fixed_width = 50; height = 1; } : errtile { label = ""; key = "error"; width = 26; } : button { label = "&OK"; key = "ok"; is_default = true; } } |