你越来越擅长这个Grrr!
p、 很抱歉,这么长时间才解码,我的错误,应该写得更好。下次会做得更好。
这里有一个我忘记放在我的smartlist例程中,但在我的RlxBlk(主对话框中的设置按钮)中使用了它
- ; lst list of strings , def default (int) to set
- (defun RlxBLK_ChooseFromColumn (lst def / fn fp dcl-id inp drv)
- (if (and (setq fn (vl-filename-mktemp ".dcl")) (setq fp (open fn "w")))
- (progn
- (write-line "cfrc : dialog { label = "Choose From Column"; : boxed_radio_column {" fp)
- (mapcar '(lambda (x) (write-line (strcat " : radio_button { key = "" x ""; label = "" x "";}") fp)) lst)
- (write-line "} spacer;ok_cancel;}" fp)(close fp)(gc)
- (if (and (setq dcl-id (load_dialog fn)) (new_dialog "cfrc" dcl-id))
- (progn
- (mapcar '(lambda (x)(action_tile x "(setq inp $key)")) lst)
- (if (not (null (nth def lst)))(set_tile (nth def lst) "1"))
- (action_tile "accept" "(done_dialog 1)")
- (setq drv (start_dialog))(unload_dialog dcl-id)))))
- (cond ((not (null inp)) inp) ((not (null (nth def lst))) (nth def lst)) (t nil))
- )
- ; * * testing * *
- (defun c:cfc () (RlxBLK_ChooseFromColumn '("1 2" "a b" "3 4" "c d" "5 6" "e f" "7 8" "g h" "9 10" "i j") 5 ))
该例程使用单选按钮而不是tokkies(切换),并且(显然)仅在按钮数量有限的情况下工作
gr.Rlx |