yhly555 发表于 2015-11-6 15:35:58

屏幕取词和下拉单选问题

本帖最后由 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)
)

yhly555 发表于 2015-11-9 22:27:26

看来问题有点严重

438682112 发表于 2015-11-10 17:58:18

谢谢楼主分享

bori 发表于 2015-11-11 09:09:32



也是新手一枚,按照我自己想的方法,试试看。

yhly555 发表于 2015-11-11 22:56:08

bori 发表于 2015-11-11 09:09 static/image/common/back.gif
也是新手一枚,按照我自己想的方法,试试看。

可以了,非常感谢!你太帅了。

xyp1964 发表于 2015-11-12 03:06:38


yhly555 发表于 2015-11-12 12:50:34

xyp1964 发表于 2015-11-12 03:06 static/image/common/back.gif


感谢版主!

yhly555 发表于 2015-11-12 19:47:17

bori 发表于 2015-11-11 09:09 static/image/common/back.gif
也是新手一枚,按照我自己想的方法,试试看。

新的问题出现了,如何实现数据追加,却进行第二次取词时,文本框的值保留,追加第二次取得的值,也就是保留多次取词的结果,不清空文本框。

bori 发表于 2015-11-13 10:03:21

yhly555 发表于 2015-11-12 19:47 static/image/common/back.gif
新的问题出现了,如何实现数据追加,却进行第二次取词时,文本框的值保留,追加第二次取得的值,也就是保 ...


这个就取值之后,建个list,再处理啊。
你看看,是不是你想要的?

wushixlm 发表于 2015-11-13 10:22:28

学习一下!!!!!
页: [1] 2 3 4
查看完整版本: 屏幕取词和下拉单选问题