DCL输入-对话框帮助
我有一个非常简单的例程,使用对话框进行用户输入(见下文)。有一个小问题,我相信已经涵盖其他地方,但我找不到答案。填写方框时出现以下问题:[列表]
[*]用户完成输入框(默认值已经存在)。
[*]在“日程表插入点”下,用户选择一个点并进入主屏幕
[*]拾取点后,X:Y:Z:值即完成,但之前完成的框已恢复为默认值。
对话框确实有效,但只有在从上到下完成时才有效。应该是这样吗?
在临时关闭点输入对话框之前,需要从字段中创建当前输入的列表,并在重新显示对话框时恢复这些输入,而不是默认值。
不知道你的意思是什么-你是在说标签顺序吗?
没有。基本上,输入框的数据不会被忘记,我一直在从上到下的对话框中工作。
你能详细阐述一下关于当前输入列表的观点吗?何处会加上这个?
(defun selch ()
(setq dcl_id (load_dialog "schdialog.dcl"))
(while (> flag 2)
(if (not (new_dialog "schdialog" dcl_id))
(exit)
)
(set_tile "eb1" ptx)
;display x value
(set_tile "eb2" pty)
;display y value
(set_tile "eb3" ptz)
;display z value
(action_tile
"cancel" ;if cancel button pressed
"(done_dialog) (setq flag 0)";close dialog, set flag
);action_tile
(action_tile
"accept" ;if O.K. pressed
(strcat
"(progn
(setq chtp (get_tile \"gp_prefix\"))"
"(setq chn (get_tile \"gp_start\"))"
"(setq col (get_tile \"gp_col\"))"
"(setq seqy (atof (get_tile \"gp_freq\")))"
"(setq ans (get_tile \"tfile\"))"
"(setq fnam (get_tile \"tfilen\"))"
"(setq sel (atof (get_tile \"selc\")))"
"(done_dialog) (setq userclick T))"
); strcat
); action
(action_tile
"picker"
"(done_dialog 4)"
)
;if pick button selected, hide the dialogue
;and set the flag to 4
(setq flag (start_dialog))
;start the dialogue and set flag
;to value of start dialogue
(if (and (= ptx "0")(/= flag 0)) ;(= flag 4)
;if the pick button was selected
(progn
;do the following
(setq selpoint (getpoint "\nSchedule Insertion Point: "))
;get the insertion point
(setq ptx (rtos (car selpoint) 2 4))
;get the x value
(setq pty (rtos (cadr selpoint) 2 4))
;get the y value
(setq ptz (rtos (caddr selpoint) 2 4))
;get the z value
(setq pnt selpoint)
(command "text" "tl" pnt "" "" "Reference")
(setq ts (getvar "textsize"))
(setq xc (* ts 5))
(setq chp (car pnt))
(setq xcc (* xc 2))
(setq cha (+ xcc chp))
(setq chb (cadr pnt))
(setq chp (list cha chb))
(command "text" "tl" chp "" "" "Easting")
(setq xc (* ts 4.5))
(setq cht (car chp))
(setq xcc (* xc 2))
(setq chx (+ xcc cht))
(setq chy (cadr pnt))
(setq cht (list chx chy))
(command "text" "tl" cht "" "" "Northing")
);progn
);if
);while
(start_dialog)
(unload_dialog dcl_id);unload
(princ)
页:
[1]