Point Dialog Example



This example shows creating a dialog box with a group box containing 3 text boxes for getting X, Y, Z positions entered by the user:

Example


function ShowPointDialogBox ()

-- Define the controls

dataCenterX = { ControlID="CenterX", ControlType="TextBox", Label="X", Value=1.0*25.4, ValueType="DoubleUnit" }

dataCenterY = { ControlID="CenterY", ControlType="TextBox", Label="Y", Value=1.0*25.4, ValueType="DoubleUnit" }

dataCenterZ = { ControlID="CenterZ", ControlType="TextBox", Label="Z", Value=0.0*25.4, ValueType="DoubleUnit" }        

-- Add the text fields to the group

dataCenterGroup = { ControlID="CenterGroup", ControlType="GroupBox", Header="Coordinate", ListControls={dataCenterX,dataCenterY,dataCenterZ} }


-- Define the window the controls will be added to

windowParas = { Title = "Point Parameters", Width = 250}        


-- Display the dialog box

retTable = Bcc.ShowDialogBox(windowParas, {dataCenterGroup})


-- Get the values from the dialog

if (retTable ~= nil) then

x = retTable["CenterX"]["Value"]

               y = retTable["CenterY"]["Value"]

               z = retTable["CenterZ"]["Value"]

end

end