Modeller.createSimpleDialog


createSimpleDialog(title, rowLabels, columnLabels, data, [sizeByContent], [growGrid], [readOnly])

Creates and shows a simple dialog that can be used to either input or output a grid of generic data. All data is in string form - it is up to the programmer to convert to/from integers and reals. The dialog is of fixed size, but the data grid will scroll if necessary

titlestringTitle for the dialog
rowLabelsarray of strings Array of row headers for grid
columnLabelsarray of strings Array of column headers for grid
dataarray of strings Initial data for grid (two dimensional array, first dimension number of columns, second dimension number of rows) If OK is pressed, and dialog is not read only, filled with user's input data
sizeByContentoptional boolean Default false. True to size cells by header contents. False for default sizes
growGridoptional boolean Default false. True to allow user to add rows using the tab key. False to deny.
readOnlyoptional boolean Default false. True to allow user to edit cell contents. False to deny.
Return valuebooleanReturns non-zero if user pressed OK, 0 if user pressed Cancel

Example


 $ENGINE=VBScript
 title = "My Dialog Title"
 nRows = 3
 nColumns = 0
 redim rowHeader(nRows)
 redim colHeaders(nColumns)
 redim data(nColumns ,nRows)
 rowHeader(0)  = "Axis"
 rowHeader(1)  = "Start"
 rowHeader(2)  = "Finish"
 rowHeader(3)  = "Interval"
 colHeaders(0) = "Values"
 ' initial (default) data
 data(0, 0)  = "X"
 data(0, 1)  = "0"
 data(0, 2)  = "100"
 data(0, 3)  = "25"
 okPressed = createSimpleDialog(title, rowHeader, colHeaders, data, true, false, false)
 if (okPressed) then
   ' access user's input data
   axis  = data(0,0)
   start = data(0,1)
 else
    ' user pressed cancel
 end if

Back to Modeller

Back to Overview