Author: hqm
Date: 2008-01-30 18:02:45 -0800 (Wed, 30 Jan 2008)
New Revision: 7931

Added:
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzInputTextSprite.as
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzKeyboardKernel.as
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/swf9/
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/swf9/LzKeys.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzInputText.js
Modified:
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/Library.lzs
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/Library.lzs
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzScript.lzs
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js
Log:
Change 20080130-hqm-0 by [EMAIL PROTECTED] on 2008-01-30 20:57:17 EST
    in /cygdrive/c/users/hqm/openlaszlo/devildog
    for http://svn.openlaszlo.org/openlaszlo/branches/devildog

Summary: preliminary input text support

New Features:

Bugs Fixed:

Technical Reviewer: hqm
QA Reviewer: max
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
    
defined lzinput text sprite, LFC LzInputText and keyboard handling, 


Tests:



Modified: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.js 
2008-01-30 18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.js 
2008-01-31 02:02:45 UTC (rev 7931)
@@ -37,7 +37,6 @@
   * @modifiers override 
   */
   static var tagname = 'animator';
-  ConstructorMap[tagname] = LzAnimator;
 
     static var getters = new LzInheritedHash(LzAnimatorGroup.getters);
     static var defaultattrs = new 
LzInheritedHash(LzAnimatorGroup.defaultattrs);
@@ -431,3 +430,4 @@
 } // End of LzAnimator
 
 
+ConstructorMap[LzAnimator.tagname] = LzAnimator;

Modified: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.js    
2008-01-30 18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.js    
2008-01-31 02:02:45 UTC (rev 7931)
@@ -65,7 +65,6 @@
   * @modifiers override 
   */
   static var tagname = 'layout';
-  ConstructorMap[tagname] = LzLayout;
 
     static var getters = new LzInheritedHash(LFCNode.getters);
     static var defaultattrs = new LzInheritedHash(LFCNode.defaultattrs);
@@ -421,3 +420,4 @@
 }
 
 
+ConstructorMap[LzLayout.tagname] = LzLayout;

Modified: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.js 
2008-01-30 18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.js 
2008-01-31 02:02:45 UTC (rev 7931)
@@ -47,7 +47,6 @@
   * @modifiers override 
   */
   static var tagname = 'animatorgroup';
-  ConstructorMap[tagname] = LzAnimatorGroup;
 
     static var getters = new LzInheritedHash(LFCNode.getters);
     static var defaultattrs = new LzInheritedHash(LFCNode.defaultattrs);
@@ -560,3 +559,4 @@
 
 } // End of LzAnimatorGroup
 
+ConstructorMap[LzAnimatorGroup.tagname] = LzAnimatorGroup;

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js 2008-01-30 
18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js 2008-01-31 
02:02:45 UTC (rev 7931)
@@ -1142,7 +1142,7 @@
         // TODO [hqm 2008-01] enable this warning unconditionally for now for 
swf9 debugging
         //    if ($debug) {
         if ((! x) || (! (x is Class))) {
-            //trace('Class for tag ', e.name, ' has not been defined yet', x);
+            trace('Class for tag ', e.name, ' has not been defined yet', x);
         }
         //}
 
@@ -2108,18 +2108,14 @@
 
 
 dynamic class LzNode extends LFCNode {
-
-/** @access private
-  * @modifiers override 
-  */
-  static var tagname = 'node';
-  ConstructorMap[tagname] = LzNode;
-
-    
     function LzNode ( parent:* , attrs:* , children:* = null, instcall:*  = 
null) {
         super(parent,attrs,children,instcall);
     }
 
+    static var tagname = 'node';
+
 }
 
+ConstructorMap[LzNode.tagname] = LzNode;
 
+

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js   
2008-01-30 18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js   
2008-01-31 02:02:45 UTC (rev 7931)
@@ -101,7 +101,11 @@
 public class LzFocus {
     static function getFocus() {
     }
+    static function setFocus(...rest) {
+    }
 
+
+
     static function clearFocus() {
     }
     static function __LZcheckFocusChange(...rest) {

Modified: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as  
2008-01-30 18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as  
2008-01-31 02:02:45 UTC (rev 7931)
@@ -24,18 +24,6 @@
 
     public function LFCApplication () {
 
-        var forceload =  [LzText,
-                          // LzInputText.
-                          LzView,
-                          LzNode,
-                          LzAnimator,
-                          LzAnimatorGroup,
-                          LzLayout,
-                          LzScript
-                          //LzState
-                          //LzCommand
-                          ];
-
         // Start up idle service timer. LzIdle is a global
         LzIdle = new LzIdleClass ();
         
@@ -47,6 +35,14 @@
         trace('idle timer period = ', idleTimerPeriod , 'msecs');
         LzIdleKernel.startTimer( idleTimerPeriod );
 
+
+        stage.addEventListener(KeyboardEvent.KEY_DOWN,reportKeyDown);
+        stage.addEventListener(KeyboardEvent.KEY_UP,reportKeyUp);
+        stage.addEventListener(MouseEvent.CLICK, reportClick);
+        stage.addEventListener(MouseEvent.MOUSE_WHEEL, reportWheel);
+
+        LzKeyboardKernel.setCallback(LzKeys, '__keyEvent');
+
         ////////////////////////////////////////////////////////////////
         // cheapo debug console
         lzconsole = this;
@@ -61,6 +57,38 @@
 
     }
 
+
+      function reportWheel(event:MouseEvent):void
+    {
+        trace(event.currentTarget.toString() + 
+              " dispatches MouseWheelEvent. delta = " + event.delta);
+        //        LzKeys.__mousewheelEvent(event.delta);
+    }
+
+
+    function reportClick(event:MouseEvent):void
+    {
+        trace(event.currentTarget.toString() + 
+              " dispatches MouseEvent. Local coords [" + 
+              event.localX + "," + event.localY + "] Stage coords [" + 
+              event.stageX + "," + event.stageY + "]");
+    }
+
+    function reportKeyUp(event:KeyboardEvent):void {
+        trace("Key Released: " + String.fromCharCode(event.charCode) + 
+              " (key code: " + event.keyCode + " character code: " + 
+              event.charCode + ")");
+        LzKeyboardKernel.__keyboardEvent(event.charCode, 'onkeyup');
+    }
+
+    function reportKeyDown(event:KeyboardEvent):void {
+        trace("Key Pressed: " + String.fromCharCode(event.charCode) + 
+              " (key code: " + event.keyCode + " character code: " 
+              + event.charCode + ")");
+        LzKeyboardKernel.__keyboardEvent(event.charCode, 'onkeydown');
+    }
+
+
     public var consoletext:TextField;
     
     public function write (msg:*) {
@@ -89,3 +117,4 @@
 
 
 
+

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/Library.lzs        
2008-01-30 18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/Library.lzs        
2008-01-31 02:02:45 UTC (rev 7931)
@@ -12,6 +12,7 @@
 #include "kernel/swf9/LzIdleKernel.as"
 #include "kernel/swf9/LzSprite.as"
 #include "kernel/swf9/LzTextSprite.as"
+#include "kernel/swf9/LzInputTextSprite.as"
 #include "kernel/swf9/LzFontManager.as"
 
     //#include "kernel/swf/LzRequires.as"
@@ -29,7 +30,7 @@
 #include "kernel/swf9/LzXMLTranslator.as"
 #include "kernel/swf9/LzHTTPLoader.as"
     //#include "kernel/swf/LzMouseKernel.as"
-    //#include "kernel/swf/LzKeyboardKernel.as"
+#include "kernel/swf9/LzKeyboardKernel.as"
     //#include "kernel/swf/LzAudio.as"
     //#include "kernel/swf/LzScreenKernel.as"
     //#include "kernel/swf/LzContextMenu.lzs"

Added: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzInputTextSprite.as


Property changes on: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzInputTextSprite.as
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzKeyboardKernel.as


Property changes on: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzKeyboardKernel.as
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as    
2008-01-30 18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as    
2008-01-31 02:02:45 UTC (rev 7931)
@@ -16,16 +16,12 @@
 
 public class LzTextSprite extends LzSprite {
     #passthrough (toplevel:true) {  
-
-  import flash.display.*;
-  import flash.events.*;
-  import flash.text.*;
-  import flash.net.URLRequest;  
-
+        import flash.display.*;
+        import flash.events.*;
+        import flash.text.*;
+        import flash.net.URLRequest;  
     }#
 
-
-
         #passthrough  {  
 
         public var textfield:TextField = null;
@@ -53,7 +49,7 @@
         public var scrollheight:Number = 0;
 
         public function LzTextSprite (newowner = null) {
-            super(newowner,false)
+            super(newowner,false);
             // owner:*, isroot:Boolean
             this.textfield = createTextField(0,0,400,20);
         }
@@ -85,7 +81,7 @@
             return tfield;
         }
 
-        public function __initTextProperties (args:Object):void {
+        public  function __initTextProperties (args:Object) {
             this.password = args.password  ? true : false;
             var textclip:TextField = this.textfield;
             textclip.displayAsPassword = this.password;
@@ -343,7 +339,7 @@
 
 
 
-        function getTextfieldHeight ( ) {
+        public function getTextfieldHeight ( ) {
         }
 
 

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/Library.lzs   
2008-01-30 18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/Library.lzs   
2008-01-31 02:02:45 UTC (rev 7931)
@@ -27,7 +27,7 @@
     #include "services/platform/dhtml/LzKeys.js"
     #include "services/platform/dhtml/LzHistory.js"
 } else if ($swf9) {
-    //
+    #include "services/platform/swf9/LzKeys.js"
 } else if ($as2) {
     #include "services/platform/swf/LzModeManager.as"
     #include "services/platform/swf/LzKeys.as"

Added: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/swf9/LzKeys.js


Property changes on: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/swf9/LzKeys.js
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 
2008-01-30 18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 
2008-01-31 02:02:45 UTC (rev 7931)
@@ -426,7 +426,7 @@
   */
 function init (){
     Debug.write("LzCanvas.init called");
-    new LzText(canvas, {x: 0, y:0, text: 'elapsed time '+getTimer()+' msec'});
+    new LzText(canvas, {x: 600, y:0, text: 'elapsed time '+getTimer()+' 
msec'});
 }
 
 /**

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js    
2008-01-30 18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js    
2008-01-31 02:02:45 UTC (rev 7931)
@@ -382,7 +382,7 @@
   * @lzxtype boolean
   * @keywords readonly
   */
-var focusable = false;
+public var focusable = false;
 
 /** If true, this view "traps" the focus, for example in a window or dialog.
   * See focus manager (LzFocus) for more details.
@@ -1571,11 +1571,11 @@
     static var __LZdelayedSetters:* = new 
LzInheritedHash(LFCView.__LZdelayedSetters);
     static var earlySetters:* = new LzInheritedHash(LFCView.earlySetters);
 
-
     static var tagname = 'view';
-    ConstructorMap[tagname] = LzView;
     function LzView ( parent:* , attrs:* , children:* = null, instcall:*  = 
null) {
         super(parent,attrs,children,instcall);
     }
 
 }
+
+ConstructorMap[LzView.tagname] = LzView;

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs      
2008-01-30 18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs      
2008-01-31 02:02:45 UTC (rev 7931)
@@ -11,11 +11,9 @@
 
     #include "views/LaszloView.js"
     #include "views/LzViewLinkage.js"
-
     #include "views/LzText.js"
-    //#include "views/LzInputText.js"
+    #include "views/LzInputText.js"
 
-
     #include "views/LaszloCanvas.js"
 
 } else {

Added: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzInputText.js


Property changes on: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzInputText.js
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzScript.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzScript.lzs     
2008-01-30 18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzScript.lzs     
2008-01-31 02:02:45 UTC (rev 7931)
@@ -67,7 +67,6 @@
   * @modifiers override 
   */
 static var tagname = 'script';
-ConstructorMap['script'] = LzScript;
 
 function LzScript ( parent, args ) {
     super(parent, args);
@@ -77,3 +76,4 @@
 }; // End of LzScript
 
 
+ConstructorMap[LzScript.tagname] = LzScript;

Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js        
2008-01-30 18:28:06 UTC (rev 7930)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js        
2008-01-31 02:02:45 UTC (rev 7931)
@@ -84,7 +84,7 @@
     static var earlySetters:* = new LzInheritedHash(LFCView.earlySetters);
 
 
-    function LFCText ( parent:* , attrs:* = null , children:* = null, 
instcall:*  = null) {
+    function LFCText ( parent:* = null, attrs:* = null , children:* = null, 
instcall:*  = null) {
         super(parent,attrs,children,instcall);
 
         // TODO [hqm 2008-01] How can we make this a static block
@@ -366,13 +366,10 @@
   * @access private
   */
 override function __makeSprite(args) {
-    this.sprite = new LzTextSprite(this);
-    this.tsprite = LzTextSprite(this.sprite);
+    this.tsprite = new LzTextSprite(this);
+    this.sprite = this.tsprite;
 }
 
-
-
-
 /**
   * Get a reference to the control mc (overridden from LFCView)
   * @access private
@@ -726,10 +723,14 @@
 /**
   * setText sets the text of the field to display
   * @param String t: the string to which to set the text
+  
   */
+
 function setText ( t, force = null ){
-    // force to a string
     t = '' + t;
+    /// TODO [hqm 2008-01] This is a setter, so we should not be using
+    /// a second arg for a flag, until applyArgs is fixed to stop
+    /// supplying a second arg!
     if (force != true && t == this.text) return;
     if (this.visible) this.tsprite.setVisible(this.visible);
     if (this.maxlength != null && t.length > this.maxlength){
@@ -861,7 +862,7 @@
   * Sets the selectability (with Ibeam cursor) of the text field
   * @param Boolean isSel: true if the text may be selected by the user
   */
-    function setSelectable ( isSel, ignore = null ){
+    public function setSelectable ( isSel, ignore = null ){
     this.selectable = isSel;
     this.tsprite.setSelectable(isSel);
 }
@@ -1133,21 +1134,28 @@
 } // End of LFCText
 
 
+// This is a dynamic wrapper class around the 'real' LFC class. This
+// is so that the Flash 9 compiler will make efficient code for the
+// built-in methods and attributes, while giving us a dynamic class
+// for the user to see, to allow attaching properties at runtime.
 public dynamic class LzText extends LFCText {
-    static var tagname = 'text';
-    ConstructorMap[tagname] = LzText;
+    // We can just point to the 'real class' setters tables, we don't need to
+    // make copies of them.
+    static var getters = LFCText.getters;
+    static var defaultattrs = LFCText.defaultattrs;
+    static var options = LFCText.options;
+    static var setters = LFCText.setters;
+    static var __LZdelayedSetters:* = LFCText.__LZdelayedSetters;
+    static var earlySetters:* = LFCText.earlySetters;
 
-    static var getters = new LzInheritedHash(LFCText.getters);
-    static var defaultattrs = new LzInheritedHash(LFCText.defaultattrs);
-    static var options = new LzInheritedHash(LFCText.options);
-    static var setters = new LzInheritedHash(LFCText.setters);
-    static var __LZdelayedSetters:* = new 
LzInheritedHash(LFCText.__LZdelayedSetters);
-    static var earlySetters:* = new LzInheritedHash(LFCText.earlySetters);
 
-
-    function LzText ( parent:* , attrs:* , children:* = null, instcall:*  = 
null) {
+    static var tagname = 'text';
+    function LzText ( parent:* = null, attrs:* = null, children:* = null, 
instcall:*  = null) {
         super(parent,attrs,children,instcall);
     }
 
 }
 
+
+ConstructorMap[LzText.tagname] = LzText;
+


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to