Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / pas2js / 2019-08

Change in event handler

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hello,

Based on a recent remark on the list, and after careful checking of the documentation, the TEventListenerEvent class has been made an alias of TJSEvent:

TEventListenerEvent = TJSEvent;

That means that the 2 event handler types

   TJSEventHandler = reference to function(Event: TEventListenerEvent): boolean;
   TJSRawEventHandler = reference to Procedure(Event: TJSEvent);

are now in fact equivalent, except for the return value of the latter.

At the same time, the TJSEvent class definition has been corrected:

The currentTarget and Target properties of TJSEvent are now of type TJSEventTarget, as they are in the official specs:

     property currentTarget : TJSEventTarget Read FCurrentTarget;
     property target : TJSEventTarget Read FTarget;

For convenience, I have added 2 additional properties:

     property currentTargetElement : TJSElement;
     property targetElement : TJSElement;

2 examples were corrected to handle this change, you may need to check your code.

The change has been documented in the wiki:

https://wiki.freepascal.org/Pas2JS_Version_Changes#Trunk

Michael.

Reply by email