Hi guys,
This is driving me nuts. The following dialog runs without problem as .dcl file:
DCL
ACAD_Stuff : dialog
{
: popup_list
{
label = "&Attachment:";
list = "TopLeft\nTopCenter\nTopRight\nMiddleLeft\nMiddleCenter\nMiddleRight\nBottomLeft\nBottomCenter\nBottomRight";
key = "att";
}
: row
{
fixed_width = true;
alignment = centered;
: button {
label = "&Pick Points <";
key = "accept";
is_default = true;
}
: spacer { width = 1; }
cancel_button;
: spacer { width = 1; }
help_button;
}
}
But when I try to transform the same as a list of strings for being temporary written:
(defun C:test ( / Lst FpathWithFname fileDCL dcl_id )
(setq Lst
(list
"ACAD_Stuff : dialog"
"{"
": popup_list"
"{"
"label = \"&Attachment:\";"
"list = \"TopLeft\nTopCenter\nTopRight\nMiddleLeft\nMiddleCenter\nMiddleRight\nBottomLeft\nBottomCenter\nBottomRight\";"
"key = \"att\";"
"}"
": row"
"{"
"fixed_width = true;"
"alignment = centered;"
": button {"
"label = \"&Pick Points <\";"
"key = \"accept\";"
" is_default = true;"
"}"
": spacer { width = 1; }"
"cancel_button;"
": spacer { width = 1; }"
"help_button;"
"}"
"}"
); list
); setq Lst
(setq FpathWithFname (vl-filename-mktemp nil nil ".dcl"))
(setq fileDCL (open FpathWithFname "w"))
(foreach x Lst (write-line x fileDCL))
(close fileDCL)
(setq dcl_id (load_dialog FpathWithFname))
(and (not (new_dialog DlgName dcl_id))(exit))
(start_dialog)
(unload_dialog dcl_id)
(vl-file-delete FpathWithFname)
); defun
I get a bunch of errors such as:
line 6: newline in string constant
line 7: missing semicolon
line 8: invalid attribute, Symbol "TopRight".
line 8: syntax error. Symbol "TopRight".
This DCL code is not mine - I'm just trying to figure out how to populate a list_box / popup_list inside the DCL code.