Contents Previous Next Subchapters

Easy Dialog Label Button Fields
Syntax easydlg(captionbuttonsmessagelayout)
See Also pushbutton , addlabel

If a field type in the layout argument is "labelbutton", the corresponding field setting is the value for the field. It can be any sequence of characters not containing a semicolon. The user will be not be able to change this value directly but the button for the value may lead to a sequence of operations that does change the value.

     File    = "temp.oms"
     caption = "Label Button"
     buttons = {"Ok", "Cancel"}
     message = "Read the specified file"
     layout = ["labelbutton, File, 15,", File]
     easydlg(caption, buttons, message, layout)
     function Label_Button(button) begin
          global File
          print "button =", button
          print "File   =", File
          if button == "Ok" then return
          if button == "Cancel" then return
          caption = "Read"
          File = openfile(caption, File)
          print "File   =", File

If you paste the program above into the command line, the following dialog will be displayed:
If you then select the File button, the function Label_Button will be called and it will print the text
     button = File
     File   = temp.mat
in the Command window. The program will then display the system dialog that is used for selecting files. If you then select the autoexec.oms file in the c:\omwin directory the following text will print in the Command window:
     File   = c:\omwin\autoexec.oms