(defun createDCLdialog ( / ) (cond ( (not (and (setq file (open (setq tmp (vl-filename-mktemp nil nil ".dcl")) "w")) (write-line " CHAN : dialog {label = \"NOTES\"; : list_box {label = \"Choose Selection :\";key = \"selections\";height = 12;} : list_box {label = \"Preview :\";key = \"preview\";width = 50;height = 5;} : boxed_row { : button {key = \"Okay\";label = \" Okay \";is_default = true;} : button {key = \"Cancel\";label = \" Cancel \";is_default = false;is_cancel = true;} : button {key = \"Add\";label = \" Add \";is_default = false;is_cancel = true;} } } ADD : dialog {label = \"Add\"; : row { : edit_box {key = \"Selection\";label = \"Selection:\";edit_width = 25;height = 1;value = \"\";} } : edit_box {key = \"Preview\";label = \"Preview:\";edit_width = 25;height = 1;value = \"\";} : boxed_row { : button {key = \"Ok\";label = \" Okay \";is_default = true;} : button {key = \"Cancel\";label = \" Cancel \";is_default = false;is_cancel = true;} } } " file ) (not (close file)) ) ) ) ) ) ; ----------- ; CHAN dialog ; ----------- (defun Chan (/ DCL_ID ) (setq dcl_id (load_dialog tmp)) (if (not (new_dialog "CHAN" dcl_id)) (exit ) ) (start_list "selections") (mapcar 'add_list (mapcar 'car NAMES)) (end_list) (action_tile "selections" (strcat "(progn (setq SIZ $value)" "(start_list \"preview\")" "(mapcar ' add_list (setq txt (cdr (assoc (nth (atoi siz)(mapcar 'car NAMES))NAMES))))" "(end_list)" "(mode_tile \"accept\" 2))" ) ) ; Run Dialog Add - Template to add Textblocks ; startet die Dialogvorlage zum Hinzfügen ; von Textblöcken (action_tile "Add" "(add Names tmp)") (start_dialog) (unload_dialog dcl_id) (vl-file-delete tmp) (princ) ) ; ---------- ; ADD dialog ; ---------- (defun Add (NAMES TMP / DCL_ID ) (setq dcl_id (load_dialog tmp)) (if (not (new_dialog "ADD" dcl_id)) (exit) ) ; Ebox Selection (set_tile "Selection" "Enter Text name here") (action_tile "Selection" "(setq Selection $value)") ; Ebox Preview (set_tile "Preview" "Enter Textblock name here") (action_tile "Preview" "(setq Preview $value)") (action_tile "Ok" (strcat "(progn " "(setq NAMES (append NAMES (list (list Selection Preview))))" "(done_dialog 1))" ) ) (action_tile "Cancel" "(done_dialog 0)") (start_dialog) (princ NAMES) (unload_dialog dcl_id) ) (defun c:test ( / ) (createDCLdialog) (if (null NAMES) (setq NAMES (list '("1" "TEST1") '("2" "TEST2") '("3" "TEST3"))) ;testweise ) ; Run Dialog CHAN - Template with Textname and -block ; Startet den Dialog mit allen vorhandenen Textblöcken (chan) (princ "\nAuffrischen der Liste ") (princ) )