见: AutoLISP Developer's Guide MSITStore:C:\Program%20Files\AutoCAD%202004\help\acad_alg.chm::/alg_p3.html">Working with Programmable Dialog Boxes Managing Dialog Boxes | | MSITStore:C:\Program%20Files\AutoCAD%202004\help\acad_alg.chm::/alg_1215.html"> | MSITStore:C:\Program%20Files\AutoCAD%202004\help\acad_alg.chm::/alg_12.html"> | MSITStore:C:\Program%20Files\AutoCAD%202004\help\acad_alg.chm::/alg_1217.html"> | |
| Hiding Dialog Boxes |
(defun c:hidedcl (/ dcl_id what_next cnt) (setq dcl_id (load_dialog "hidedcl.dcl")) ;Load the dialog box. (setq what_next 2) (setq cnt 1) (while (>= what_next 2) ;Begin display loop. (if (null (new_dialog "hidedcl" dcl_id)) ;Initialize dialog (exit) ;box, exit if nil ); endif ;returned. ; Set action to take if a button is pressed. Either button ; results in a done_dialog call to close the dialog box. ; Each button associates a specific status code with ; done_dialog, and this status code is returned by ; start_dialog.
(action_tile "accept" "(done_dialog 1)") ;Set action for OK. (action_tile "hide" "(done_dialog 4)") ;Set action for ickMe. (setq what_next (start_dialog)) ;Display dialog box. ; (cond ((= what_next 4) rompt user to (getpoint "\npick a point") ;pick pt. ) ((= what_next 0) (prompt "\nuser cancelled dialog") ) ) ) (unload_dialog dcl_id) (princ) ) |