本帖最后由 yhly555 于 2015-11-10 18:23 编辑
;如题,如何实现动态屏幕取词和下拉单选(即我点击“点取”选择屏幕的文字时,
自动将其内容添加到左边对应的文本框内,点击“下拉按钮”对应内容是,自动将
其内容添加到左边的文本框内),谢谢! - (defun DCL-CTRL(/ txt1 num1 num1 number1 number2 txt2 en end_1 old_name new_name)
-
- (setq dcl_id (load_dialog (CBJYC-DCL)))
- (new_dialog "tet" dcl_id)
- (start_list "ZM_POP")
- (mapcar 'add_list (setq ZM_list (list "" "AA" "BB" "CC")))
- (end_list)
-
- (action_tile "accept" "(OK_DCL) (done_dialog 1)")
- (setq dd (start_dialog))
- (if (= dd 1)
- (princ "\n对话框结束")
- )
- (unload_dialog dcl_id)
- )
- (defun OK_DCL()
- ((set_tile "ZM" (nth (read (get_tile "ZM_POP")) ZM_list))) ;下列列表方式
- )
- (defun CBJYC-DCL (/ lst_str str file f)
- (setq lst_str '(
- "tet:dialog"
- "{"
- " label = "测试";"
- " :boxed_column"
- " {"
- " label = "信息" ;"
- " :row"
- " {"
- " :edit_box"
- " {"
- " key = "PMQC";"
- " label = "屏幕取词:" ;"
- " width = 28 ;"
- " height = 1 ;"
- " }"
- " :button"
- " {"
- " key = "PMQC_BTN" ;"
- " label = "<<点取>>" ;"
- " width = 4.35 ;"
- " height = 1 ;"
- " alignment=top ;"
- " }"
- " }"
- " :row"
- " {"
- " :edit_box"
- " {"
- " key = "ZM";"
- " label = "下拉单选:" ;"
- " width = 33 ;"
- " height = 1 ;"
- " }"
- " :popup_list"
- " {"
- " key = "ZM_POP" ;"
- " width = 5 ;"
- " height = 1.5 ;"
- " }"
- " }"
- " }"
- "ok_cancel ;"
- "}"
- )
- )
- (setq file (vl-filename-mktemp "DclTemp.dcl"))
- (setq f (open file "w"))
- (foreach str lst_str
- (princ "\n" f)
- (princ str f)
- )
- (close f)
- ;;返回
- file
- )
- (defun c:test()
- (DCL-CTRL)
- )
|