Results 1 to 1 of 1

Thread: POPUP_BOX and List_box

  1. #1
    Member
    Join Date
    2014-11
    Posts
    21
    Login to Give a bone
    0

    Default POPUP_BOX and List_box

    I want each color FRUIT CARS in a different list_box and just the size of the text


    Code:
    // DCL definition
    
    myTest : dialog {
      label = "Test list controls";
      : list_box {
        key = "listbox";
        width = 20;
      }
      : popup_list {
        key = "popup";
        width = 20;
      }
      ok_only;
    }
    
    ;; LISP code
    
    (defun populate_list (tile item lst)
      (start_list tile)
      (mapcar 'add_list (cadr (nth item lst)))
      (end_list)
    )
    
    (defun listtest ()
      ;; set up data
      (setq myList '(("FRUIT"  ("APPLES" "ORANGES" "PEARS"))
                     ("COLORS" ("RED" "GREEN" "BLUE"))
                     ("CARS"   ("VW" "CHEVY" "FORD"))
                    )
      )
      
      (setq dcl_id (load_dialog "testdlg.dcl"))
      (cond ((new_dialog "myTest" dcl_id)
             
             ;; fill "popup" with CAR item of myList
             (start_list "popup")
             (mapcar 'add_list (mapcar 'car myList))
             (end_list)
             
             ;; fill "listbox" initially, according to default value of "popup"
             ;; (value of "0" unless otherwise specified in the dcl definition)
             (populate_list "listbox" 0 myList)
             
             ;; define callback to populate "listbox" according to
             ;; users choice in the "popup" tile
             (action_tile "popup" "(populate_list \"listbox\" (atoi $value) myList)")
    
             (start_dialog)
            )
      )
    )
    Last edited by rkmcswain; 2018-04-23 at 02:17 PM. Reason: added [CODE] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •