本帖最后由 作者 于 2003-2-18 10:53:41 编辑
;;重写,可能不是你要的!!!!
(defun C:AW (/ DCL_ID AA BB
WHAT_NEXT ALL_NAME_LIST ALL_DWG_LIST
ALL_LIB_LIST
)
(defun DCL_IMAGE (DCL_KEY IMAGE_NAME)
(start_image DCL_KEY)
(setq IMG_WIDTH (dimx_tile DCL_KEY)
IMG_HEIGHT (dimy_tile DCL_KEY)
)
(fill_image 0 0 IMG_WIDTH IMG_HEIGHT -2)
(slide_image -8 -13 IMG_WIDTH IMG_HEIGHT IMAGE_NAME)
(end_image)
)
(defun SHOW_TITER (/ FILENAME JDCAD_BLK CURRENT_LINE NAME DWG LIB)
(if (setq JDCAD_BLK (open (findfile "jdcad.blk") "r"))
(progn
(setq CURRENT_LINE (read-line JDCAD_BLK))
(while (= "/" (substr CURRENT_LINE 1 1))
(setq CURRENT_LINE (read-line JDCAD_BLK))
)
(while CURRENT_LINE
(setq NAME (substr CURRENT_LINE 9))
(setq ALL_NAME_LIST (cons NAME ALL_NAME_LIST))
(setq CURRENT_LINE (read-line JDCAD_BLK))
(setq DWG (substr CURRENT_LINE 9))
(setq ALL_DWG_LIST (cons DWG ALL_DWG_LIST))
(setq CURRENT_LINE (read-line JDCAD_BLK))
(setq LIB (substr CURRENT_LINE 9))
(setq ALL_LIB_LIST (cons LIB ALL_LIB_LIST))
(setq CURRENT_LINE (read-line JDCAD_BLK))
)
(close JDCAD_BLK)
)
)
(setq ALL_NAME_LIST (reverse ALL_NAME_LIST))
(setq ALL_DWG_LIST (reverse ALL_DWG_LIST))
(setq ALL_LIB_LIST (reverse ALL_LIB_LIST))
)
(defun SHOW_LIST ()
(start_list "blk_name")
(mapcar 'add_list ALL_NAME_LIST)
(end_list)
(start_list "blk_path")
(mapcar 'add_list ALL_DWG_LIST)
(end_list)
(start_list "sld_path")
(mapcar 'add_list ALL_LIB_LIST)
(end_list)
)
(defun SHOW_LIST1 ()
(set_tile "blk_name" (itoa (- BB 1)))
(set_tile "blk_path" (itoa (- BB 1)))
(set_tile "sld_path" (itoa (- BB 1)))
)
(defun GETINF ()
(if (= BB (length ALL_LIB_LIST))
(setq BB 1)
(setq BB (+ BB 1))
)
(setq AA (nth (- BB 1) ALL_LIB_LIST))
(DCL_IMAGE "show_tit" AA)
)
(setq DCL_ID (load_dialog "aw"))
(if (not (new_dialog "aw" DCL_ID))
(exit)
)
(SHOW_TITER)
(setq AA (nth 0 ALL_LIB_LIST))
(setq BB 0)
(SHOW_LIST)
(SHOW_LIST1)
(GETINF)
(setq WHAT_NEXT 5)
(while (< 2 WHAT_NEXT)
(action_tile "show_tit" "(getinf)(show_list1)")
(action_tile
"blk_name"
"(setq bb (atoi $value))(getinf)(show_list1)"
)
(action_tile
"blk_path"
"(setq bb (atoi $value))(getinf)(show_list1)"
)
(action_tile
"sld_path"
"(setq bb (atoi $value))(getinf)(show_list1)"
)
(action_tile "accept" "(done_dialog 4)")
(setq WHAT_NEXT (start_dialog))
(cond
;;((= WHAT_NEXT 3)
;;(GETINF)
;;)
((= WHAT_NEXT 4)
(setq WHAT_NEXT 1)
(done_dialog)
(unload_dialog DCL_ID)
)
)
)
(princ)
)
(princ "\n欢迎浏览图库!")
(princ)
//对话框的文件名假设为d:/tmp.dcl
aw : dialog {
label = "浏览";
: concatenation {
: text {
label = "名称:";
fixed_width = true;
}
: popup_list {
key = "blk_name";
width = 20;
}
: text {
label = "序号:";
}
: popup_list {
key = "blk_path";
width = 20;
}
: text {
label = "幻灯:";
}
: popup_list {
key = "sld_path";
width = 20;
}
}
: boxed_column {
label = "图块";
: image_button{
key = "show_tit";
height = 32;
width = 90;
color = -2;
}spacer;
}spacer;
ok_only;
}
[此贴子已经被作者于2003-2-18 10:12:13编辑过]
[此贴子已经被作者于2003-2-18 10:17:58编辑过] |