2009-10-18 16:11:47 -04:00
|
|
|
program new;
|
|
|
|
var
|
|
|
|
TempVar : Boolean;
|
|
|
|
procedure OnClick(Sender : TObject);
|
|
|
|
begin;
|
|
|
|
TempVar := True;
|
|
|
|
Writeln('YOU HAS CLICKED THE BUTTON');
|
|
|
|
end;
|
|
|
|
function x : Boolean;
|
|
|
|
var
|
|
|
|
MyForm : TForm;
|
|
|
|
AButton : TButton;
|
|
|
|
begin;
|
|
|
|
TempVar := False;
|
|
|
|
Result := false;
|
2010-01-12 10:26:14 -05:00
|
|
|
MyForm := TForm.Create(nil);
|
2009-10-18 16:11:47 -04:00
|
|
|
MyForm.Width := 250;
|
|
|
|
MyForm.Height := 250;
|
2010-01-12 10:26:14 -05:00
|
|
|
AButton := TButton.Create(MyForm);
|
2009-10-18 16:11:47 -04:00
|
|
|
AButton.Parent := MyForm;
|
|
|
|
Abutton.SetBounds(100,100,100,50);
|
|
|
|
AButton.OnClick := @OnClick;
|
|
|
|
AButton.Caption := 'Test';
|
|
|
|
MyForm.ShowModal;
|
|
|
|
MyForm.Free;
|
|
|
|
Result := TempVar;
|
|
|
|
end;
|
|
|
|
var
|
|
|
|
v : TVariantArray;
|
|
|
|
begin
|
|
|
|
if ThreadSafeCall('x',v) then
|
|
|
|
Writeln('You clicked the button! WinnOr')
|
|
|
|
else
|
|
|
|
Writeln('You did not click the button, fail all the way');
|
|
|
|
end.
|