script "Dialog" language "pascal";

procedure RunScript(Value: single; ComboValue: integer);
begin
  ShowMessage('值 = ' + FloatToStr(Value));
  ShowMessage('组合框值 = ' + IntToStr(ComboValue));
end;

var
   form  : TScriptDialog;
   i     : integer;
   combo : TInput;

begin
  form := CreateScriptDialog('对话框测试脚本', '这个脚本用于测试某些对话框功能');
  form.AddInput('测试', 0.8);

  combo := form.AddInputCombo('组合框输入', '开,关,禁用', 1);

  for i := 0 to 15 do
    form.AddInputKnob('输入 ' + IntToStr(i), 3.6, -1, 20);

  if form.Execute then
    RunScript(form.GetInputValue('测试'), combo.ValueAsInt);
  form.Free;
end.
