Change 20100801-hqm-p by [email protected] on 2010-08-01 06:56:04 EDT
in /Users/hqm/openlaszlo/trunktlf
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: (LPP-9256) click to focus on swf10 bidirectional text doesn't work
properly
New Features:
Bugs Fixed: LPP-9256
Technical Reviewer: max
QA Reviewer: ptw
Doc Reviewer: (pending)
Documentation:
Release Notes:
Overview:
Instances of Bi-direction textfield properly get focus when you click
in it, and gets focus and select-all when you tab into it
Details:
LzTextSprite.as:
+ handle double clicks in selectable text
+ Since we have two disjoint classes that implement TextField now,
some checks for "this.textfield is TextField" need to be changed to
"this.textfield is TextField || this.textfield is LzTLFTextField"
+ LzTLFTextField has a mode which defers re-rendering until the next
Flash enterframe event, but we need to force it to render immediately
when we are initializing and measuring text metrics.
+ Also we set renderImmediate when scroll events are on, to let us
get an updated value of maxscroll immediately (this still doesn't
seem to be working though, maxscroll only updates after next frame).
LzInputTextSprite.as:
+ in gotFocus, set the selection first, then set focus, to workaround bug
(LPP-9257) where setting selection causes focus to blur.
LzTextContainerManager.as:
+ implement setPattern and maxChars
LzTLFTextField.as:
+ implement alwaysShowSelection
+ implement LFC scrolling API, return scroll values in proper units (lines or
pixels)
+ implement restrict and maxChars API
+ implement basic selection API (setSelection, selectionBeginIndex, etc)
LFCApplication.as:
+ prevent non-selectable text fields from gaining focus via mouse click
Deleted versions of files, no longer needed:
Custom versions of the textsprite are not needed since we now
implement the bidi text as a class that's compatible with
flash.text.TextField.
WEB-INF/lps/lfc/kernel/swf9/LzTLFTextSprite.as
WEB-INF/lps/lfc/kernel/swf9/LzTLFInputTextSprite.as
It looks like we do not need to have these custom subclasses of the
flex TLF SelectionManager and EditManager; TextContainerManager looks
like it has the hooks needed for intercepting mouse and keyboard
events, so far:
WEB-INF/lps/lfc/kernel/swf9/LzTLFSelectionManager.as
WEB-INF/lps/lfc/kernel/swf9/LzTLFEditManager.as
Tests:
test/tlf/focus-input.lzx: in swf10, tab to focus should behave same for native
and bidi text field instances
test/tlf/text-test.lzx: in swf10, input text (single and multiline)
should behave properly; click to focus and get blinking I-beam
insertion cursor. input and selectable text fields should allow
mouse-down and drag to select text.
test/tlf/maxscroll.lzx: check that maxscroll is updated properly and
scrolling works. There's still a bug here, when the textheight is
changed, maxscroll does not seem to get updated until the next
enterframe event, or some other delay.
Files:
A test/tlf/focus-input.lzx
A test/tlf/maxscroll.lzx
M test/tlf/text-test.lzx
D WEB-INF/lps/lfc/kernel/swf9/LzTLFTextSprite.as
D WEB-INF/lps/lfc/kernel/swf9/LzTLFSelectionManager.as
D WEB-INF/lps/lfc/kernel/swf9/LzTLFEditManager.as
M WEB-INF/lps/lfc/kernel/swf9/LzInputTextSprite.as
M WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
M WEB-INF/lps/lfc/kernel/swf9/LzTextContainerManager.as
M WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as
M WEB-INF/lps/lfc/kernel/swf9/LzTLFTextField.as
D WEB-INF/lps/lfc/kernel/swf9/LzTLFInputTextSprite.as
M WEB-INF/lps/lfc/kernel/swf9/Library.lzs
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20100801-hqm-p.tar