This is very interesting. Event bubbling is a really nice feature.
I have two thoughts that come to mind. Feel free to disregard if they make no sense as I'm just responding without reflecting here.
The first is that it's worth thinking about how these events can be sent programatically rather than just by a real mouse. Either this or drag/drop targeting may be a good reason for the capturing phase - so that you can send an event to a view and have it travel down the hierarchy until it finds a target. Sending events programatically would be helpfull for creating macros that simulate user interaction both for testing and possibly for creating acessibility tools, which I think could be a big opportunity for lzx, especially in the post Legals distribution.
The other is that it will probably be a good speed improvement to be able to override where to bubble to, rather than always to immediateparent. That way if you have a nest of views grouped together in some hierarchy that you weren't able to control for some reason, perhaps you have lots of visual views and just a few interactive ones, you can explicity say, "target the X view as my parent" This might either encourage bad structure, or be a lifesaver in certain situations, or both. But you do often have a dozen views for every one that is clickable, so the ability to have a click structure that is seperate from you actual view structure seems usefull for speed and possibly for simplicity as well.
Also isn't clickable still usefull just in order to trigger the mouseover cursor changes?
Feel free to ignore, but I thought to mention them in case it helps spark a synapse or two in the early stages. Thanks for including us with your thoughts.
-Cort
On 9/21/06, Adam Wolff <[EMAIL PROTECTED]> wrote:
Here's a very rough proposal for what we could do to implement event
bubbling:
- don't bother with event capture. it seems unnecessary to support
both capture and bubbling
- Modify Laszlo's LzEvent object as follows:
* Add a boolean:bubbles attribute which defaults to false
* Modify LzEvent.prototype.sendEvent as follows:
call back all registered delegates (current behavior)
if bubbling
look up the immediateparent chain for a node which
contains an event of the same name
call sendEvent with the same argument on that event
- Modify LzView's "clickable" attribute as follows
* deprecate it
* all movieclips are clickable in Flash (need to test for perf
implications -- there are other options if this is slow)
* remove the compiler code that sets clickable when you declare
mouseEvent handlers
- Modify LzModeManager attribute as follows
* deprecate or remove LzGlobalMouse; rely instead on bubbling
* consider caching results of bubbling lookups
I'm sure I missed some stuff, but this kind of what I've been thinking.
A
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
_______________________________________________ Laszlo-dev mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
