Contents Previous Next Subchapters

Easy Dialog Popup Menu Fields
Syntax easydlg(captionbuttonsmessagelayout)
See Also popupmenu

Description
If a field type in the layout argument is "popupmenu", the corresponding field setting contains the initial value for the field followed by the list of values that will be in the popup menu. Each of the values is separated by a comma.

Program
     clear
     caption = "Popup Menu"
     buttons = {"Ok", "Cancel"}
     message = "Save program as the specified file."
     setting = "binary, ascii, binary"
     layout = { ...
     "label, File:, 15, lib\easydlg.mat", ...
     ["popupmenu, Format, 6,", setting] ...
     }
     easydlg(caption, buttons, message, layout)
     function Popup_Menu(button) begin
          print "button =", button
          print "Format =", easydlg("Format")
     end

Example
If you paste the program above into the command line, the following dialog will be displayed:
If you select the popup menu, choose ascii, and then select the Ok button, the function Popup_Menu will be called and it will print the text
     button = Ok
     Format = ascii
in the Command window.