next up previous contents index
Next: How can I create Up: FAQ Previous: How can I identificate

How can I create my own dialog boxes?

The following script creates a dialog box to configure a loop unrolling. All arguments must be passed by reference (i.e. with the prefix &).

SCRIPT ReadInfo(level,factor,apply)

  level := 0
  factor :=0

  // Create the dialog window with the buttons "Apply" and "Cancel"
  win := Dialog:Start("DIALOGUNROLL","Loop Unrolling Parameters","Apply|Cancel")
  // Insert a message
  foo := Dialog:InsertText(win," ",-1)
  foo := Dialog:InsertText(win," Loop Unrolling Parameters",0)
  foo := Dialog:InsertText(win," ",-1)
  // Insert the input fields
  // The unrolling level in an integer value between 0 and 20. Its default is 10
  f_level := Dialog:InsertRangeField(win," In level ",10,0,20)
  // The unrolling factor in an integer value between 2 and 20. Its default is 4
  f_factor := Dialog:InsertRangeField(win," Unrolling Factor   ",4,2,20)
  // Insert a blank line 
  foo := Dialog:InsertText(win," ",-1)

  // Show and run the dialog window
  // The result is 0 if the "Apply" button is pressed and 1 for "Cancel".
  res := Dialog:Run(win)

  //  Read the value of each output field
  apply := (res==0) 
  IF (apply) THEN
    level := Dialog:GetFieldAsInteger(win,f_level)
    factor := Dialog:GetFieldAsInteger(win,f_factor)
  ENDIF

  // Don't forget to close the window.
  foo := Dialog:Close(win) 

ENDSCRIPT



Yann Mevel
1999-04-30