Contents Previous Next Subchapters

Easy Dialog Text Button Fields
Syntax easydlg(captionbuttonsmessagelayout)
See Also pushbutton , textfield

Description
If a field type in the layout argument is "textbutton", the corresponding field setting is the value for the field. It can be any sequence of characters not containing a semicolon. The user may change this value directly or use the button for the value to lead to a sequence of operations that changes the value.

Program
     clear
     File    = "temp.oms"
     caption = "Text Button"
     buttons = {"Ok", "Cancel"}
     message = "Read the specified file"
     layout = ["textbutton, File, 15,", File]
     easydlg(caption, buttons, message, layout)
     function Text_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
     end

Example
If you paste the program above into the command line, the following dialog will be displayed:
If you change the file value to junk.mat and then select the File button, the function Text_Button will be called and it will print the text
     button = File
     File   = junk.mat
in the command window. The program will then display the system dialog that is used to select file. 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