It is difficult to give you a sample project. In which format would you need it? We store our Scripting code in an own format inside a database and are able to export it in a self developed XML-Format. This would not help you.
It works now with a tricky workaround:
Scripter.ExecuteSubroutine(RoutineName, [Sender, ACol, ARow, MyRect, MyStateType, MyRect.Left, MyRect.Top]);
I simply pass the missing values as additional parameters. This works even if the header of the function does not have these parameters.
procedure TMyDrawCellEventDispatcher.__TDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);
Inside the scripting engine code it looks like this:
procedure StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState; iLeft, iTop: integer);
begin
if Rect = null then ShowMessage('Rect is null'); // does not show => Rect has a value
if Rect.Left = null then ShowMessage('Rect.Left is null'); // This message box will be shown
ShowMessage(Format('iLeft=%d/iTop=%d', [iLeft, iTop])); // The correct values are displayed
ShowMessage(Format('Rect.Left=%d/Rect.Top=%d', [Rect.Left, Rect.Top])); // Script crashs because of null values in Rect.Left and Rect.Top
Currently I am able to process the needed values with that workaround, so I am content.
But I think there is a bug anywhere inside the scripting engine...
Sidenote:
procedure StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState; iLeft, iTop: integer);
var
test1: TRect;
test2: TRectWrapper;
begin
test1.Left := 1; // Works
test2.Left := 2; // Scripting-Error
end
In both cases if I type test1.
or test2.
I do not get any popup menu which would show me the members of TRect.
But my Delphi code already contains the lines
AScripter.DefineRecordByRTTI(TypeInfo(TRect));
AScripter.DefineRecordByRTTI(TypeInfo(TRectWrapper));