Contents Previous Next Subchapters

Enable Easy Dialog Fields on True
Syntax easydlg(captionbuttonsmessagelayoutconnection)
See Also show , hide

Enable Connections
If a row of the connection argument begins with "enable", it specifies an enable connection. A row corresponding to an enable connection has the form:
     enable, 
FCF1F2...
where FC denotes the name of a check box and F1F2..., denote the names corresponding to other fields in the dialog. If the field that is named FC, is true, the fields named F1F2..., are input enabled. Otherwise, the fields named F1F2..., are input disabled; i.e., they are grayed out and the user cannot change their values.

Program
     clear
     cap = "Enable_callback"
     but = {"Ok", "Cancel"}
     msg = "Choose axis scaling"
     lay = { ...
     "checkbox, manual, 2, false", ...
     "textfield, min, 5, 0", ...
     "textfield, max, 5, 0" ...
     }
     connection = "enable, manual, min, max"
     easydlg( cap, but, msg, lay, connection)
     function Enable_callback(button) begin
          print "button =", button
          print "min    =", easydlg("min")
          print "max    =", easydlg("max")
     end

Example
If you paste the program above into the command line, the following dialog will be displayed:
Note that the values in the min and max fields are grayed out and cannot be changed. If you set the manual field to true by selecting it, the min and max fields will be enabled. If you then set the field named max to 10 and select the Ok button, the following text will print in the Command window:
     button =", Ok
     min    =", 0
     max    =", 10