Welcome to the Southern African Autolisp Website.

Afra-lISP


You are Visitor Number since 11th June 1999.


list_box.

list_box

Syntax:

	: list_box {
          action alignment allow_accept fixed_height
          fixed_width height is_enabled is_tab_stop
          key label list mnemonic multiple_select
          tabs value width
        }


DCL Coding:

lisp48i : dialog {				//dialog name
          label = "list_box" ;			//give it a label

     	: list_box {				//define list box
        key = "selections";			//give it a name
        }					//end list

        ok_cancel ;				//predefined OK/Cancel button

        }					//end dialog


AutoLisp Coding:

(defun C:lisp48i ()
;define function	

  (setq NAMES '("Monday" "Tuesday" "Wednesday" "Thursday"
                "Friday" "Saturday" "Sunday")
  );setq
  ;define list

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

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

      );not

    (exit)
    ;exit if no dialog

  );if

  (start_list "selections")
  ;start the list box

  (mapcar 'add_list NAMES)
  ;fill the list box

  (end_list)
  ;end list

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

    (strcat
    ;string 'em together
      "(progn 

      (setq SIZ (atof (get_tile \"selections\")))"
      ;get list selection

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

    );strcat

  );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

    (progn
    ;if it was do the following

      (setq SIZ (fix SIZ))
      ;convert to integer

      (setq SIZ (nth SIZ NAMES))
      ;get the Day

      (alert (strcat "You Selected: " SIZ))			
      ;display the Day

    );progn

  );if userclick


 (princ)

);defun

(princ)



All Tutorials and Code are provided "as-is" for purposes of instruction and
utility and may be used by anyone for any purpose entirely at their own risk.
Please respect the intellectual rights of others.
All material provided here is unsupported and without warranty of any kind.
No responsibility will be taken for any direct or indirect consequences
resulting from or associated with the use of these Tutorials or Code.

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