AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

ok_cancel_help_info.

ok_only_help_info

Syntax: 

	ok_cancel_help_info; 

The ok_cancel_help_info tile is defined in the Base.Dcl file.
The key of the OK button is 'accept'.
The key of the Cancel button is 'cancel'.
The key of the Help button is 'help'.
The key of the Info button is 'info'. 
DCL Coding: 
lisp48e : dialog {				//dialog name
          label = "ok_cancel_help_info" ;	//give it a label

        ok_cancel_help_info;			//predefined OK/Cancel/Help/
						//Info button

        }					//end dialog

gotohelp : dialog {				//dialog name
	   label = "Help Box" ;			//give it a label

	 : text {				//defin text
	   label = "This is the Help Box" ;	//give it a label
	 }					//end text

	ok_only ; 				//predefined OK Button

	}					//end dialog

gotoinfo : dialog {				//dialog name
	   label = "Info Box" ;			//give it a label

	 : text {				//define text
	   label = "This is the Info Box" ;	//give it a label
	 }					//end text

	ok_only ; 				//predefined OK Button

	}					//end dialog 

AutoLisp Coding: 
(defun C:lisp48e ()
;define function	

  (setq dcl_id (load_dialog "lisp48e.dcl"))
  ;load dialog

  (if (not (new_dialog "lisp48e" dcl_id)
  ;test for dialog

      );not

    (exit)
    ;exit if no dialog

  );if

  (action_tile
      "accept"	
      ;if O.K. pressed
					
      "(done_dialog) (setq userclick T)"
      ;close dialog, set flag	
	
   );action tile

    (action_tile
    "cancel"
    ;if cancel button pressed

    "(done_dialog) (setq userclick nil)"	
    ;close dialog, lower flag

    );action_tile

    (action_tile
       "help"
    ;if help button pressed

       "(gotohelp)"
       ;call help function

    );action_tile

    (action_tile
       "info"
    ;if Info button pressed

       "(gotoinfo)"
       ;call info function

    );action_tile

  (start_dialog)	
  ;start dialog
				
  (unload_dialog dcl_id)
  ;unload	

  (if userclick
  ;if OK selected

     (alert "You selected OK")
     ;inform the user

     (alert "You selected Cancel")
     ;inform the user

  );if								

 (princ)

);defun


(defun gotohelp ()
;define function	

  (setq dcl_id (load_dialog "lisp48e.dcl"))
  ;load dialog

  (if (not (new_dialog "gotohelp" dcl_id)
  ;test for dialog

      );not

    (exit)
    ;exit if no dialog

  );if

  (action_tile
      "accept"	
      ;if O.K. pressed
					
      "(done_dialog)"
      ;close dialog	
	
   );action tile

  (start_dialog)	
  ;start dialog
				
  (unload_dialog dcl_id)
  ;unload				

 (princ)

);defun

(defun gotoinfo ()
;define function	

  (setq dcl_id (load_dialog "lisp48e.dcl"))
  ;load dialog

  (if (not (new_dialog "gotoinfo" dcl_id)
  ;test for dialog

      );not

    (exit)
    ;exit if no dialog

  );if

  (action_tile
      "accept"	
      ;if O.K. pressed
					
      "(done_dialog)"
      ;close dialog	
	
   );action tile

  (start_dialog)	
  ;start dialog
				
  (unload_dialog dcl_id)
  ;unload				

 (princ)

);defun

(princ)
 
The AutoLisp/Visual Lisp/VBA Resource Website

Copyright © 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website