Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL/Core VCL Classes    [ Add a report in this area ]  
Report #:  91796   Status: Reported
Add MultiCast Delegate Event To All Controls
Project:  Delphi Build #:  Any
Version:    15.0 Submitted By:   An Pham
Report Type:  New Feature Request Date Reported:  2/26/2011 6:19:35 AM
Severity:    Serious / Highly visible problem Last Updated: 2/27/2011 7:07:13 AM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 12
Description
Currently, Delphi only supports single delegate but since it is now support generic, it is easy to implement multicast delegate without difficulty. The over all effects will be below. Attached is how to do it. If you need help on how to add to all your core Controls, contact me.

  1. 3 more methods
  2. Increase a pointer size of each delegate
  3. A change in Do... to signal events
  4. A New public property to support multicast

Example:
Current
TFoo = class(TObject)
private
  FOnChange: TNotifyEvent;
protected
  procedure DoChange;
published
  property OnChange: TNotifyEvent read FOnChange ..
end;

Will be
TFoo = class(TObject)
private
  FOnChange: TNotifyDelegate;
protected
  procedure DoChange;
public
  property OnChanges: INotifyDelegate read GetOnChanges;
published
  property OnChange: TNotifyEvent read GetOnChange write SetOnChange
end;
Steps to Reproduce:
None
Workarounds
None
Attachment
MultiCastDelegate.zip
Comments

None

Server Response from: ETNACODE01