AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

radio_button.

radio_button

Syntax: 

	: radio_button {
          action alignment fixed_height fixed_width
          height is_enabled is_tab_stop key label
          mnemonic value width
        } 

DCL Coding: 
lisp48k : dialog {				//dialog name
          label = "radio_button" ;		//give it a label

        : radio_button {			//*define radio button
     	  key = "rb1" ;				//*give it a name
     	  label = "Bolt Holes &Site" ;		//*give it a label
     	  value = "1" ;				//*switch it on
        }					//*end definition

     	: radio_button {			//*define radio button
     	  key = "rb2" ;				//*give it a name
     	  label = "Bolt Holes Sho&p" ;		//*give it a label
     	}					//*end definition

     	: radio_button {			//*define radio button
     	  key = "rb3" ;				//*give it a name
     	  label = "Bolt Holes &Hidden" ;	//*give it a label
     	  }					//*end definition

     	: radio_button {			//*define radio button
     	  key = "rb4" ;				//*give it a name
     	  label = "Bolt Holes &Ctsnk" ;		//*give it a label
     	}					//*end definition

        ok_cancel ;				//predefined OK/Cancel button

        }					//end dialog 

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

  (setq hole "Site")
  ;store default hole type

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

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

      );not

    (exit)
    ;exit if no dialog

  );if

  (action_tile "rb1" "(setq hole \"Site\")")
  ;*store hole type

  (action_tile "rb2" "(setq hole \"Shop\")")
  ;*store hole type

  (action_tile "rb3" "(setq hole \"Hidden\")")
  ;*store hole type

  (action_tile "rb4" "(setq hole \"Countersunk\")")
  ;*store hole type

  (action_tile
    "accept"
    ;if O.K. pressed

    "(done_dialog) (setq userclick T)"	
    ;close dialog

  );action tile

    (action_tile
    "cancel"
    ;if cancel button pressed

    "(done_dialog) (setq userclick nil)"	
    ;close dialog

    );action_tile

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

   (if userclick
   ;check O.K. was selected

      (alert (strcat "You Selected: " hole))			
      ;display the Hole Type

  );if userclick

 (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