sachindkini 发表于 2018-11-3 20:16:13

yaokui25 发表于 2018-11-3 18:36
(action_tile "accept"
    "(done_dialog)"
);action_tile


dear sir,
till not working
please explain with full code

广易精通 发表于 2019-2-10 19:58:57

这是DCL不是OpenDCL吧

唐伯虎9527 发表于 2019-11-20 09:44:09

你好,我试了一下,怎么没用呀?

zj20190405 发表于 2020-8-24 23:12:21

lisperado 发表于 2018-11-3 18:40
Show Time example

多谢大佬啊

yyz123121 发表于 2020-9-29 21:04:32

你好,请教一下,怎么在这个面板下边的帮助按钮旁边增加一个按钮,点击这个按钮就打开指定位置的其它vlx文件?
我加入下边这句之后,可以用快捷命令启动指定的程序,但是点击按钮没反应,按钮那个地方应该怎么写?
(defun c:***() (if (null c:***) (load "D:/***.VLX"))(c:***));打开其它程序

这个地方应该怎么写,才能让点击按钮也能够启动指定的程序?
   ":button{key = \"c:***\";label = \"批量打印\";}\n"

另一个问题,我加载了一个外部程序之后,加载第二个的话,
提示说“出现硬错误 ***
已达内部堆栈限制 (模拟)”

最后我想在左下角增加时间,应该怎么写,能说一下吗。我试了帖子里说的那些,都不出现时间,应该是我写的不对。

谢谢了

下边是源码
(defun Dcl-ButtonM (titl buttons flag / a b c)
   (defun strsplist (str / i)
   (if (setq i (vl-string-search " " str))
       (list (substr str 1 i)
                                 (vl-string-trim " " (substr str (+ 2 i)))
       )
               )
   )
   (defun makedcl (str_lst / fileID dclHandle)
   (setq
                         dclfile (vl-filename-mktemp nil nil ".dcl")
                         fileID(open dclfile "w")
   )
   (cond
                         ((= (type str_lst) 'str)
                                 (write-line str_lst fileID)
                         )
                         ((= (type str_lst) 'list)
                                 (foreach n str_lst (write-line n fileID))
                         )
               )
               (close fileID)
               (setq dclHandle (load_dialog dclfile))
         )
         (setq
               b (if flag
                                 ":column{label = \""
                                 (strcat
                                 ":spacer{ wide=1; fixed_width=true;} \n"
                                 ":spacer{ wide=1; fixed_width=true;} \n"
                                 ":row{label = \""
                                 )
                  )
               c (if flag
                                 ":row{label = \""
                                 ":column{label = \""
                         )
               d '("ESC")
               a (strcat (vl-string-translate
                                                               "$~"
                                                               "AB"
                                                               (vl-filename-base (vl-filename-mktemp))
                                                         )
                                 ":dialog{label=\""
                                 titl
                                 "\";\n"
                                 b
                                 "\";\n"
                         )
   )
   (foreach x buttons
   (if (listp x)
       (progn
         (setq a (strcat a c (car x) "\";\n"))
         (foreach y (last x)
         (setq
                                                 b (strsplist y)
                                                 a (if b
                                                               (strcat a
                                                                         ":button {key =\""
                                                                         (car b)
                                                                         "\";label=\""
                                                                         (last b)
                                                                         "\";}\n"
                                                               )
                                                               (strcat a "spacer_0;\n")
                                                         )
                                                 d (if (/= (car b) nil)
                                                               (cons (car b) d)
                                                               d
                                                         )
         )
         )
         (setq a (strcat a "}\n"))
       )
       (setq a (strcat a "spacer_0;\n"))
   )
   )
         (setq
               d    (cdr (REVERSE d))
               a    (strcat a
                                          "}"
                                          ":text{key=\"str\";label=\"文字\";}"
                                          ":row{"
                                          ":spacer { width = 60; } "
                                          ":button{key = \"c:***\";label = \"批量打印\";}\n"
                                          ":button{key = \"HLP\";label = \"帮助\";}\n"
                                          ":button{key=\"ESC\";label=\"取消\";is_cancel = true;}}}"
                                  )
               dcl(makedcl a)
               lst1 '()
               i    1
   )
   (foreach key d
   (setq
                         tx   (strcat "(action_tile \""
                                                key
                                                "\"\"(done_dialog "
                                                (itoa i)
                                                ")\")"
                                          )
                         lst1 (cons tx lst1)
                         i    (1+ i)
   )
   )
   (new_dialog (substr a 1 8) dcl)
   (action_tile "ESC" "(done_dialog 0)")
   (action_tile "HLP" "(alert\"帮助\")")
   (eval (read (strcat "(progn" (apply 'strcat lst1) ")")))
   (setq ctl (start_dialog))
   (UNLOAD_DIALOG dcl)
   (vl-file-delete dclfile)
         (if (/= ctl 0)
   (eval (read (strcat "(c:" (nth (- ctl 1) d) ")")))
   )
)
(defun c:tt (/ lst)
   (setq      lst '(
                         ("命令"
                                 ("0 改为0层"
                         )
                         ("视口"
                                 ("ZZ 视口比例 "
                         )

                )
   )      
(Dcl-ButtonM "xx工具箱 " lst nil)
         (princ)
)
页: 1 2 3 4 5 [6]
查看完整版本: 怎么在面板标题头上 加入 <日期+星期+当前时间>