Re: New event system...
"Bryan Bulten" <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.wxnet |
|---|---|
| Message-ID | <[email protected]> |
> Well, it works. And we do not have to add a HashTable to EvtHandler, > because with the new system the EventListener doesn't get added to a > Frame-, Dialog-... EvtHandler.listeners but to the EvtHandler of the > window it belongs to. ( A new instance of EvtHandler is created every > time a new Window instance is created as it is the base class of all > Windows). The Hashtable idea was driven by the desire to have the existing event system work the same as the .NET system. After looking over your changes, and trying a few things of my own, this goal is non trivial. Your way is the best combination. > What we also do not need is a parameter EventType in the callback > function ForwardEvent, as we are already forwarding an Event and so we > can check its type... The only thing with doing this is that it involves an extract call to unmanaged code. I'm not sure what extra overhead may be involved with this. Nonetheless, it's not hard to add it later, if necessary. > For example, button.Clicked += gets added to > Button.Control.Window.EvtHandler.listeners. EVT_BUTTON on the other hand > would add it to Frame.Window.EvtHandler.listeners. > > The old system ( EVT_... ) gets handled like before. So it doesn't > benefit from the new possibility to add more than one EventListener to a > control, etc... OK. I'll look over the changes tonight... Excellent work! -- Bryan Bulten http://bulten.ca/ http://wxnet.sourceforge.net/ ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3