Signals and slots implementation in Delphi?

青春壹個敷衍的年華 提交于 2019-12-01 06:26:07

Search for multicast events. There are a few implementations out there, e.g.

Some of them need generics, so are D>2009 only.

Whilst you can implement multi-cast events yourself, they are not directly supported in the the language unlike in C# and VB.NET. Lack of language support makes any attempt to emulate multi-cast events rather clumsy.

Interestingly, C++ lacks support for signals and slots and the Qt solution involves an extra process in the compilation tool chain, the Meta Object Compiler.

Nat

I spent some time a while ago getting Allen Bauer's Multicast Event code working. It has some limitations, but works well in my code. You can see the code here.

Of course, it only works in Delphi > 2009

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!