Hello!
I've been trying to make a form for my script but I can't find a way to do it with reflection. I was told to use ezForm but I want to make one from scratch.
So the thing is...form makes in simba returns code which can be only used on PascalScript interpreter but I need it on lape for use with lape reflection.
This is the code of simba form editor:
Code:
var
MainForm:TForm;
const
default = 'Comic Sans MS';
procedure YourClickProcedure(Sender: TObject);
begin
ShowMessage('click');
end;
procedure InitForm;
begin
//MainForm\\
MainForm:=TForm.Create(nil);
with MainForm do
begin
Caption:='Script setup';
Left:=269;
Top:=432;
Width:=600;
Height:=240;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=0;
end;
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
MainForm.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
begin
SafeInitForm;
SafeShowFormModal;
end.
What I modified for lape:
Code:
var
MainForm : TForm;
const
default = 'Comic Sans MS';
procedure YourClickProcedure(Sender: TObject);
begin
ShowMessage('click');
end;
procedure InitForm;
var
Font : TFont;
begin
//DsgnForm\\
MainForm.Init(nil);
Font.Init;
Font.SetDefault;
with MainForm do
begin
setCaption('Script setup');
setLeft(174);
setTop(307);
setWidth(320);
setHeight(240);
end;
end;
procedure ShowFormModal;
begin
MainForm.ShowModal;
end;
begin
InitForm;
ShowFormModal;
end.
When I try to run it it gives me simba error:
Code:
Program exception!
Stacktrace:
Exception class: EThread
Message: CheckSynchronize called from non-main thread "$1A74"
$004596E1
$0050A33D
$0041F803
$0083411F
$0075DEC2
$00600BC3
$004590F8
Simba Version: 1100
I'm guessing I don't load it correctly and I can't find a good example which would show me how to do it.
Thanks for your help in advance