Hooking Delphi TReader.OnFindComponentClass

72 Views Asked by At

How can one make use of TReader.OnFindComponentClass? TReader creation is hard-coded in TStream.ReadComponent. I do not see a place, where one can hook the event.

TStream.ReadComponent is not virtual. And even if it were, if one had to derive TStream, one can as well derive TReader directly and the OnFindComponentClass won't be of much use. I believe that must be some easy way to hook the event, otherwise the even would not make must sense. But I cannot identify it.

The reason I'm asking is the answer by @DavidHeffernan to:
TLabel displays accelerator keys even when the UI state says not to.

I make sure that I always create TUIStateAwareLabel rather than TLabel by hooking the form streaming mechanism with TReader.OnFindComponentClass.

0

There are 0 best solutions below