executeSubroutine

Hi!

How to executeSubroutine with TRect parametr ?

For example:

procedure TatToolCtrlsEhDispatcher.__TDataEventEh( Event: TDataEvent;  Info: Longint);
begin
  if DoOnExecuteEvent then
  begin
    if AssignedMethod(BeforeCall) then
      TDataEventEh(BeforeCall)(Event,Info);
    if Assigned(Scripter) and (RoutineName > '') then Scripter.ExecuteSubroutine(RoutineName, [Event,Info]);
    if AssignedMethod(AfterCall) then
      TDataEventEh(AfterCall)(Event,Info);
  end;
end; 

Error compilation:
[dcc32 Error] ap_ToolCtrlsEh.pas(780): E2250 There is no overloaded version of 'ExecuteSubroutine' that can be called with these arguments

Sorry, with "Event: TDataEvent" parametr.

Here is an example of how you would do with TRect: 




{ TMyAdditionalEvents }


procedure TMyEventsDispatcher.__TDrawItemEvent(Control: TWinControl;
 Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin
 if DoOnExecuteEvent then
 begin
   if AssignedMethod(BeforeCall) then
     TDrawItemEvent(BeforeCall)(Control, Index, Rect, State);


   if Assigned(Scripter) and (RoutineName > '') then
     Scripter.ExecuteSubroutine(RoutineName, [Control, Index,
       integer(TRectWrapper.Create(Rect)),
       IntFromSet(State)]);


   if AssignedMethod(AfterCall) then
     TDrawItemEvent(AfterCall)(Control, Index, Rect, State);
 end;
end;

Thank