wlandgraf
(Wagner Landgraf)
November 17, 2022, 1:17pm
2
You have to register the event type in scripter, so the event can be supported. This is indeed not trivial and must be done for each different event type you want to use.
Here are a few previous Support Center topics with explanation and sample code for such process:
Yes I have found the problem.
I have used :
Scripter.DefineClassByRTTI(TECCanvas);
But DefineClassByRTTI seem to fail with record argument like Trect ?
So I have fixed it with :
With Scripter.DefineClass(TECCanvas) do
begin
DefineMethod('TextRect',4,tkNone,nil,__TECCanvasTextRect,false,0,'rect: TRect; X: integer; Y: integer; Text: string');
end;
I never know if I must use RTTI or not (with Scripter Studio Import tool) because both have it advantage and inconvenient...
Hello, use this: DefineEventAdapter(TypeInfo(TDrawColumnCellEvent), TMyDBGridsDispatcher, @TMyDBGridsDispatcher.__TDBGridDrawColumnCell);
type
TMyDBGridsDispatcher = class(TatEventDispatcher)
private
procedure __TDBGridDrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
end;
uses ap_Types
procedure TMyDBGridsDispatcher.__TDBGridDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn; St…
For some reason a customer who upgraded to our latest version is having an issue with an OnDrawCell event. They get the error: "TRzStringGrid: OnDrawCell Event adapter not defined." I see in the manual this:"the OnEvent handlers are not automatically defined by scripter. You must implement aTatEventDispatcher descendant class and use DefineEventAdapter method." But I couldn't find any information on how the DefineEventAdapter methods work in the docs. Here is how the procedure is defined:procedu…