Author Topic: [XDrX-Function(41)] progress bar(2) - Non-modal progress bar in 4 positions  (Read 247 times)

0 Members and 1 Guest are viewing this topic.

xdcad

  • Swamp Rat
  • Posts: 522
Features of this progress bar:

1. Non-mode,OPENDCL
2. Flexibly customize the position, size, whether to display the title box, and whether to display the text prompt string of the current operation
3. The most important thing is not to be unresponsive to ACAD’s “suspended death”.



Code - Auto/Visual Lisp: [Select]
  1. (xd::odcl:progress-begin "" info 1 392 24 pos minLen maxLen))
  2. ;|
  3. The above variables are in order:
  4. "" ----- If empty, do not display the title box
  5. info --- If empty, no text prompt information will be displayed.
  6. 1 --- a progress bar
  7. 392 --- Dialog width
  8. 24 --- Progress bar height
  9. pos --- dialog box position, 0-upper left of the drawing area 1-upper right of the drawing area 2-lower right of the drawing area 3 lower left of the drawing area 4 middle upper third of the drawing area
  10. minLen ---- Minimum progress value
  11. maxLen ---- maximum progress value
  12. |;
  13.  
  14. 2.(xd::odcl:progress-setpos1 pos sep)
  15.  
  16. 3.(xd::odcl:progress-settext title)
  17.  
  18. 4. (xd::odcl:progress-end)
  19.  

Code: [Select]
(defun c:tt ()
  (if (and (setq fns (xdrx_system_selectfolder
       (xdrx-string-multilanguage
"选择目录"
"Select Directory"
       )
       ""
     )
   )
   (setq files (vl-directory-files fns "*.*" 1))
   (xdrx_initget "0 1 2 3 4 Y N")
   (setq ye (xdrx_yesorno
      (xdrx-string-multilanguage
"\n是否显示文本"
"\nWhether to display text"
      )
      1
    )
   )
   (setq
     pos (getint
   (xdrx-string-multilanguage
     "\n对话框位置[左上(0)/右上(1)/右下(2)/左下(3)/中间(4)]:"
     "\nDialog position [UL(0)/UR(1)/BR(2)/BL(3)/Mid(4)]:"
   )
)
   )
   (xdrx_initget)
      )
    (progn
      (setq
info (if (= ye 1)
       (xdrx-string-multilanguage "正在处理" "Processing...")
       ""
     )
len (length files)
      )
      (xd::odcl:progress-begin "" info 1 392 24 pos 0 len)
      (setq i 0)
      (foreach n files
(xd::odcl:progress-setpos1 (1+ i) 1)
(xd::odcl:progress-settext
  (strcat (xdrx-string-multilanguage "正在处理" "Processing...")
  n
  )
)
(setq i (1+ i))
(xdrx_sleep 10)
      )
      (xd::odcl:progress-end)
    )
  )
  (princ)
)
« Last Edit: January 07, 2024, 04:37:16 PM by xdcad »
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net