Thanks Max & Tucker. I'll make the changes to omit the eval. As for
the debug statement, it is expected behavior to get null for the view
when your mouse doesn't land on a clickable view or selectable/editable
text.
On Thu, Mar 22, 2007 at 7:17 AM, Max Carlson wrote:
I approve, provided you take Tucker's changes - this looks good!
Thanks for the heads up - it's probably rotted in OL4 also. Filed
here to track for OL4:
http://jira.openlaszlo.org/jira/browse/LPP-3755
P T Withington wrote:
I'm cc-ing max, because this may be important to track in OL4
Sprites. He might also have some ideas on how it rotted. It looks
to me like what may have rotted was the assumption that you could
find the view associated with a clip by looking for the field named
view in its parent clip. That's what I think the substring malarkey
is all about. If you cast a clip to a string, it will come out as
`_root. ... .<parent>.<child>`, and the substring looks like it is
trying to get the property `view` from the parent clip. Your
solution of an explicit backpointer on every clip is better.
Approved with the following comment:
This:
var focusview = eval( ss + ".__lzview");
_root.Debug.warn("Selection.getFocus: %w, %w",
focusview, ss);
if ( focusview ) view = focusview;
is better written:
var focusview = ss['__lzview'];
if ( focusview ) {
view = focusview;
} else if ($debug) {
Debug.warn("LzModeManager: Can't find view for %s from %w",
eventStr, ss);
}
That is, avoid `eval`, and you left a debug statement in, but maybe
you want to have a warning for when you can't find the view?
On 2007-03-21, at 22:50 EDT, Sarah Allen wrote:
Tucker,
Please review, see detailed description below. It's definitely some
achaic LFC/Flash lore. This is something that use to work years ago
and I don't know when it broke. Pablo and I worked on it together,
but I think it is important that it be reviewed by someone on the
platform team.
Thanks,
Sarah
--------------------------------------------------------
Change 20070321-sallen-4 by [EMAIL PROTECTED] on 2007-03-21 19:15:50
PDT
in /cygdrive/c/laszlo/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: mouse events for input and selectable text
Bugs Fixed: LPP-3753 onmouseup and onmousedown not reported by
LzGlobalMouse for inputtext and selectable text
Technical Reviewer: [EMAIL PROTECTED] (review code)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: in sending events the LFC has special logic to tell if the
user clicks on an input text or selectable text field (since we
don't get the movie clip that was clicked on from Flash, but we can
find out what movie clip is the selection. This logic is in
LzModeManger. To find the view associated with the movie clip, we
rely on a property that the text views set on their corresponding
movie clip. That used to be called 'view' but was changed to
'__lzview' at some point for inputtext and seems to have gotten lost
for test. This change fixes that.
Tests:
Files:
A test/text/mouse_events.lzx
M WEB-INF/lps/lfc/services/LzModeManager.as
M WEB-INF/lps/lfc/views/LzText6.as
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/20070321-sallen-4.tar\n
--
Regards,
Max Carlson
OpenLaszlo.org