Contents Previous Next Subchapters

Easy Dialog Enable Option
Syntax easydlg(option)
See Also easydlg_enable , show

If there is only one argument to easydlg, and it begins with the text
     "enable, "
it is an Enable option. This option has the following form
     enable, 
name1name2...
where name1name2... are the names of fields in the currently displayed dialog (which was created by easydlg). The result of this option is to enable user input to each of the specified fields.

Program
     clear
     caption = "Enable Option"
     buttons = {"Go", "Exit"}
     message = "Select Go to enable Binary field."
     layout = { ...
          "textfield, File, 12, \omwin\temp.dat", ...
          "checkbox, Binary, 2, false" ...
     }
     easydlg(caption, buttons, message, layout)
     easydlg("dismiss, Exit")
     easydlg("disable, Binary")
     function Enable_Option(button) begin
          print "button =", button
          print "File   =", easydlg("File")
          print "Binary =", easydlg("Binary")
          if button <> "Exit" then ...
               easydlg("enable, Binary")
     end

Example
If you paste the program above into the command line, the following dialog will be displayed:
Note that the word Binary is grey and you cannot change the value of the check box. If you then select the Go button, the function Enable_Option will be called and it will print the text
     button = Ok
     File   = \omwin\temp.dat
     Binary = false
in the Command window. In addition the dialog will stay on the screen and Binary field will be enabled (because of the Enable option within the call back function). You can now change the check box to be set and select the Exit button. The dialog will then be dismissed and the text
     button = Ok
     File   = \omwin\temp.dat
     Binary = true
will be printed in the Command window.