i found this digging around in the lilly pond a while back (it's either mark or john's) and was hoping to use it or at least build my own using this as an example. the problem is, i've noticed if the string that is to be the text displayed (to edit) in the dialog has periods or hyphens, etc. in them, the dcl freaks out and doesn't work (just letters and it's fine). i was wondering if anyone might have some insight into what's going wrong and if it's possible to rectify the issue?
here's the code:
mark and/or john, i hope you don't mind me posting this, if so, i'll quickly remove it.
(defun GetString-dlg (str / dcl_id fn fo)
(setq fn (vl-filename-mktemp "" "" ".dcl"))
(setq fo (open fn "w"))
(setq ValueStr (strcat "value = " str ";"))
(write-line "stringdlg : dialog {
label = \"Enter String\";" fo)
(write-line ": edit_box {
label = \"\";
edit_width = 30;
key = \"stringdlg\";
is_default = true; " fo)
(write-line ValueStr fo)
(write-line "}" fo)
(write-line ": row {
alignment = centered;
fixed_width = true;
: button {
label = \"OK\";
key = \"dcl_accept\";
width = 10;
allow_accept = true;
}
}
}" fo)
(close fo)
(setq dcl_id (load_dialog fn))
(new_dialog "stringdlg" dcl_id)
(action_tile "stringdlg" "(setq str $value)(done_dialog)")
(start_dialog)
(unload_dialog dcl_id)
str
)