[Laszlo-checkins] r6050 - openlaszlo/branches/wafflecone/lps/components/incubator/rich-text
ben@openlaszlo.org
ben at openlaszlo.org
Tue Aug 14 16:36:56 PDT 2007
Author: ben
Date: 2007-08-14 16:36:50 -0700 (Tue, 14 Aug 2007)
New Revision: 6050
Modified:
openlaszlo/branches/wafflecone/lps/components/incubator/rich-text/richtexteditarea.lzx
Log:
Change 20070813-ben-I by ben at slim.local on 2007-08-13 17:54:29 PDT
in /Users/ben/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Fix rich text editor: now you can change the formatting before typing
New Features:
Bugs Fixed: LPP-4489 Can't change format before typing
LPP-4495 Richedittext: can't change font
LPP-4477 Selecting all of the text in a richedittext and then changing the text's properties doesn't change the final character.
LPP-4479 Richedittext: Successive changing of a text's properties shortens the selected text range by one character.
Technical Reviewer: max
QA Reviewer: jcrowley
Doc Reviewer: (pending)
Documentation:
There was an onblur handler for the rich text edit area that was just a horrible idea,
and never helped. The LzModeManager.rawMouseEvent handler (added in the previous change to
this file) now handles selection management when the focus changes. Getting rid of this
onblur handler fixes four bugs, listed above.
Release Notes:
Details:
Still present:
LPP-4480 Richedittext: Moving focus outside the text editor doesn't clear selection. STILL PRESENT
Tests:
http://localhost:8080/wafflecone/lps/components/incubator/rich-text/test/richtexteditarea-test.lzx?lzr=swf8&debug=true
Modified: openlaszlo/branches/wafflecone/lps/components/incubator/rich-text/richtexteditarea.lzx
===================================================================
--- openlaszlo/branches/wafflecone/lps/components/incubator/rich-text/richtexteditarea.lzx 2007-08-14 20:57:52 UTC (rev 6049)
+++ openlaszlo/branches/wafflecone/lps/components/incubator/rich-text/richtexteditarea.lzx 2007-08-14 23:36:50 UTC (rev 6050)
@@ -38,6 +38,7 @@
var beginIndex = Selection.getBeginIndex();
var endIndex = Selection.getEndIndex();
if (-1 != beginIndex && -1 != endIndex) {
+ // Debug.warn("rawMouseEvent is changing the ssel and esel to %d-%d", beginIndex, endIndex);
textclip.__LZrte._ssel = beginIndex;
textclip.__LZrte._esel = endIndex;
}
@@ -248,21 +249,7 @@
}
}
]]></method>
-
- <!--- Forget the selection if we lose focus to a focusable widget, but
- keep the selection if we lose focus to a non-focusable widget, like
- the toolbar buttons.
- @param view s: the view which is gaining the selection
- -->
- <method event="onblur" args="s">
- var start = this._field.getSelectionPosition();
- var size = this._field.getSelectionSize();
- this._ssel = start;
- this._esel = start + size;
- this._fieldhasfocus = false;
- </method>
-
<!--- If the mouse down is over me or any of my children, remember that,
so we can listen for an onmouseup anywhere. A mouseup after a mousedown
indicates that the selection has changed.
@@ -271,14 +258,15 @@
<method event="onmousedown" reference="LzGlobalMouse" args="who"><![CDATA[
if ((who != null) && (this._containsView(who))) {
// the mouse went down on a child of me
- // Debug.write("mousedown on child of me");
+ // Debug.info("mousedown on child of me, this is %w, who is %#w", this, who);
this._mousedownorigin = who;
} else if ((who == null) && (inp.containsPt(this.getMouse("x"), this.getMouse("y")))) {
// the mouse went down on me
// Debug.write("mousedown on me");
this._mousedownorigin = this;
} else {
- // the mouse went down on someone other than me; i'm not interested.
+ // the mouse went down on someone other than me,
+ // Debug.info("mousedown on someone else: %w", who);
this._mousedownorigin = null;
}
]]>
@@ -304,6 +292,7 @@
// If the mouse click also ended on the rich text editor,
// it's just a caret move.
if (inp.containsPt(this.getMouse("x"), this.getMouse("y"))) {
+ // Debug.info("mouse click starts and ends on RTE");
this._caretmove();
} else {
// Debug.write("handleLostMouseDown");
@@ -314,7 +303,6 @@
} else {
// We have focus, and there's a mousedown/mouseup pair in progress,
// and it started on one of the subviews of the RTE.
- // Debug.write("lost mousedown, origin was ", this._mousedownorigin);
}
} else {
@@ -332,7 +320,7 @@
<!--- Save selected region. -->
<method name="saveSelectionRegion"><![CDATA[
- if (LzFocus.getFocus() == this._field) {
+ if (LzFocus.getFocus() == this._field) {
var selpos = this._field.getSelectionPosition();
var selsize = this._field.getSelectionSize();
if( selpos >= 0 && selsize >= 0){
@@ -401,7 +389,7 @@
var ssel = this._ssel;
var esel = this._esel;
-
+ // Debug.write("setFormatAttribute, sel is %d to %d", ssel, esel);
this.currentformat[attr] = val;
this.isHTML = true;
More information about the Laszlo-checkins
mailing list