[Laszlo-checkins] r10937 - in openlaszlo/trunk: lps/components/base lps/components/incubator/opttree test/components/base
jcrowley@openlaszlo.org
jcrowley at openlaszlo.org
Tue Sep 9 16:04:08 PDT 2008
Author: jcrowley
Date: 2008-09-09 16:03:57 -0700 (Tue, 09 Sep 2008)
New Revision: 10937
Modified:
openlaszlo/trunk/lps/components/base/basedatacombobox.lzx
openlaszlo/trunk/lps/components/base/basedatepicker.lzx
openlaszlo/trunk/lps/components/base/baseform.lzx
openlaszlo/trunk/lps/components/base/baseformitem.lzx
openlaszlo/trunk/lps/components/incubator/opttree/baseopttreenode.lzx
openlaszlo/trunk/lps/components/incubator/opttree/opttree.lzx
openlaszlo/trunk/test/components/base/lzunit-baseform.lzx
openlaszlo/trunk/test/components/base/test-basedatepicker.lzx
Log:
Change 20080909-laszlo-6 by laszlo at T43-L3XEXMW on 2008-09-09 16:08:56 EDT
in /home/laszlo/src/svn/openlaszlo/trunk-ocelot
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: A handful of components updates for SWF9
New Features:
Bugs Fixed: LPP-6949 - Base components need to be updated to 4.2
LPP-6945 - Incubator opttree components need to be updated to 4.2
Technical Reviewer: promanik
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Made some manual changes that eliminated compiler
and ActionScript errors/warnings in SWF9. These things
should now all run. (I also updated basedatacombobox
to include Phil's changes.)
There's an issue with datepicker, a difference in behavior
between SWF8/DHTML and SWF9: You can only select yesterday
in the current month, for some reason. I'm filing a
separate bug about it.
Tests: Run the test files for the components involved in SWF8
and SWF9. They should be identical (save for the
aforementioned bug with datepicker). The opttree test can
be found in lps/components/incubator/test and the other test
files (basedatepicker, baseform, basedatacombobox) can be
found in test/components/base.
Modified: openlaszlo/trunk/lps/components/base/basedatacombobox.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/basedatacombobox.lzx 2008-09-09 22:18:31 UTC (rev 10936)
+++ openlaszlo/trunk/lps/components/base/basedatacombobox.lzx 2008-09-09 23:03:57 UTC (rev 10937)
@@ -40,7 +40,7 @@
<attribute name="defaulttext" value="$once{null}" type="string" />
<!--- The value of the selected item. -->
- <attribute name="value" value="null" setter="this.setValue(value)" />
+ <attribute name="value" value="null" setter="this.doSetValue(value, false, false)" />
<!--- Datapointer to selected item.
@keywords readonly -->
@@ -147,7 +147,7 @@
} else {
if (this._selectedIndex != -1) {
//fix for LPP-5549
- this._updateSelectionByIndex(this._selectedIndex, true);
+ this._updateSelectionByIndex(this._selectedIndex, true, false);
}
}
} else {
@@ -184,7 +184,7 @@
This also updates the selected value in the combobox to reflect
the new value (in case it was changed).
@param Boolean isChanged: true if changed, else false. -->
- <method name="setChanged" args="isChanged"><![CDATA[
+ <method name="doSetChanged" args="isChanged"><![CDATA[
super.setChanged( isChanged );
// Be sure to update the selection, because value might have been
// changed programmatically
@@ -230,7 +230,7 @@
} else {
var v = null;
}
- this.setValue(v, true, true);
+ this.doSetValue(v, true, true);
}
this.setAttribute('text', t);
@@ -356,7 +356,7 @@
lz.ModeManager.makeModal( this );
- this._setupcblist();
+ this._setupcblist(false);
this._cblist.bringToFront();
this._cblist.setAttribute('visible', true);
@@ -444,7 +444,7 @@
Debug.warn("null item value in _flistselect");
}
}
- this.setValue(item.value);
+ this.doSetValue(item.value, false, false);
if ( item && this.statictext == null ) this._cbtext.setAttribute('text', item.text);
}
@@ -482,7 +482,7 @@
@param Object value: the value of the item to select. -->
<method name="selectItem" args="value"><![CDATA[
var i = this.getItemIndex(value);
- if (i != -1) this._updateSelectionByIndex(i);
+ if (i != -1) this._updateSelectionByIndex(i, false, false);
]]></method>
<!--- Get item's index by value. Returns
@@ -509,14 +509,14 @@
<!--- Select an item by index.
@param Number index: the index of the item to select. -->
<method name="selectItemAt" args="index" ><![CDATA[
- this._updateSelectionByIndex(index);
- this._setupcblist();
+ this._updateSelectionByIndex(index, false, false);
+ this._setupcblist(false);
]]></method>
<!--- Set value of combobox.
@param String|Number value: value to set.
@param Boolean isinitvalue: true if value is an init value. -->
- <method name="setValue" args="value, isinitvalue, ignoreselection"><![CDATA[
+ <method name="doSetValue" args="value, isinitvalue, ignoreselection"><![CDATA[
if (this['value'] != value) {
var i = this.getItemIndex(value);
this._selectedIndex = i;
@@ -526,7 +526,7 @@
}
if ( i != -1 && !ignoreselection) {
- this._updateSelectionByIndex(i, true);
+ this._updateSelectionByIndex(i, true, false);
}
}
]]></method>
Modified: openlaszlo/trunk/lps/components/base/basedatepicker.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/basedatepicker.lzx 2008-09-09 22:18:31 UTC (rev 10936)
+++ openlaszlo/trunk/lps/components/base/basedatepicker.lzx 2008-09-09 23:03:57 UTC (rev 10937)
@@ -134,7 +134,9 @@
if( this.latestdate == null ) {
this.latestdate = new Date();
- this.latestdate.setYear( this.latestdate.getFullYear() + 1 );
+ if(this.latestdate['setYear']){
+ this.latestdate.setYear( this.latestdate.getFullYear() + 1 );
+ }
}
if( this.xinset == null ) {
@@ -329,13 +331,13 @@
this.focusPreviousDay();
}
else if ( k == 38 ) {
- this.focusPreviousWeek( this._focusDay );
+ this.focusPreviousWeek();
}
else if ( k == 39 ) {
- this.focusNextDay( this._focusDay );
+ this.focusNextDay();
}
else if ( k == 40 ) {
- this.focusNextWeek( this._focusDay );
+ this.focusNextWeek();
} else if ( k == 13 ) {
this.selectFocusDay();
content.subviews[this._focusDay[0]].subviews[this._focusDay[1]].buttonpush();
Modified: openlaszlo/trunk/lps/components/base/baseform.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/baseform.lzx 2008-09-09 22:18:31 UTC (rev 10936)
+++ openlaszlo/trunk/lps/components/base/baseform.lzx 2008-09-09 23:03:57 UTC (rev 10937)
@@ -13,7 +13,7 @@
<!--- Boolean to determine whether the baseformitem was changed. Default
is false. -->
<attribute name="changed" value="false"
- setter="this.setChanged(changed)" />
+ setter="this.setChanged(changed, false)" />
<!--- Event sent when baseformitem is changed. Only sent once when true
or once when false. -->
Modified: openlaszlo/trunk/lps/components/base/baseformitem.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/baseformitem.lzx 2008-09-09 22:18:31 UTC (rev 10936)
+++ openlaszlo/trunk/lps/components/base/baseformitem.lzx 2008-09-09 23:03:57 UTC (rev 10937)
@@ -97,7 +97,7 @@
if (this['_parentform'] &&
this._parentform['changed'] != undefined &&
! this._parentform.changed) {
- this._parentform.setChanged(changed);
+ this._parentform.setChanged(changed, false);
}
}
// notify about reset to original state...
Modified: openlaszlo/trunk/lps/components/incubator/opttree/baseopttreenode.lzx
===================================================================
--- openlaszlo/trunk/lps/components/incubator/opttree/baseopttreenode.lzx 2008-09-09 22:18:31 UTC (rev 10936)
+++ openlaszlo/trunk/lps/components/incubator/opttree/baseopttreenode.lzx 2008-09-09 23:03:57 UTC (rev 10937)
@@ -39,7 +39,7 @@
<method name="startDrag">
this.setAttribute( "dragging", true );
- parent.beginDrag( this , _ix, _iy );
+ parent.beginDrag( this , this._ix, this._iy );
</method>
<handler name="onmouseup">
Modified: openlaszlo/trunk/lps/components/incubator/opttree/opttree.lzx
===================================================================
--- openlaszlo/trunk/lps/components/incubator/opttree/opttree.lzx 2008-09-09 22:18:31 UTC (rev 10936)
+++ openlaszlo/trunk/lps/components/incubator/opttree/opttree.lzx 2008-09-09 23:03:57 UTC (rev 10937)
@@ -42,7 +42,7 @@
value="${ opttreecontroller.nodelist }"/>
<attribute name="nodelist" value="nodecollection" when="always"
- setter="nodeinst.datapath.setNodes( nodelist )"/>
+ setter="this.nodeinst.datapath.setNodes( nodelist )"/>
<include href="opttreecontroller.lzx"/>
@@ -103,7 +103,7 @@
var curr = this.highlighted;
if ( !curr ){
- var cls = nodeinst.clones;
+ var cls = this.nodeinst.clones;
if ( !cls.length ) return;
this.select( cls[ 0 ] );
return;
@@ -152,7 +152,7 @@
//returns the next clone in the flattened list given an existing
//clone and a direction to move in. adjusts the position of the
//opttree within its clipping region if necessary.
- var cls = nodeinst.clones;
+ var cls = this.nodeinst.clones;
if ( !cls.length ) return null;
var clnum = null;
@@ -184,7 +184,7 @@
var clptr = who.datapath.p;
var clptrnum = null;
- var nodes = nodeinst.nodes;
+ var nodes = this.nodeinst.nodes;
var clptrnum = null;
for ( var i = 0; i < nodes.length; i++ ){
@@ -207,7 +207,7 @@
<method name="_adjustMargin" args="dir">
//moves the opttree up or down (depending on the dir) in within
//its clipping region.
- var cls = nodeinst.clones;
+ var cls = this.nodeinst.clones;
var itheight = cls[ 0 ].height;
var adj = itheight * -dir;
var ny = y + adj;
@@ -220,7 +220,7 @@
<![CDATA[
//finds the clone pointing to the given LzDataElement or returns
//null if that clone is not mapped
- var cls = nodeinst.clones;
+ var cls = this.nodeinst.clones;
for ( var i = 0; i < cls.length; i++ ){
if ( cls[ i ].datapath.p == p ) {
return cls[ i ];
@@ -270,15 +270,15 @@
this.cpos = Math.floor( ( py - czero.y ) / h );
}
- if ( dragisover ){
- parent.select( parent.nodeinst.clones[ cpos ] );
+ if ( this.dragisover ){
+ parent.select( parent.nodeinst.clones[ this.cpos ] );
} else {
- this.setAttribute('y', cy + cpos * h );
+ this.setAttribute('y', cy + this.cpos * h );
parent.select( null );
}
- if ( visible != !dragisover ){
- this.setAttribute('visible', !dragisover );
+ if ( visible != !this.dragisover ){
+ this.setAttribute('visible', !this.dragisover );
}
]]>
</method>
@@ -301,43 +301,43 @@
dragged.setAttribute('visible', true );
this.dragdata = who.datapath.p;
- var dragparent = dragdata.parentNode
+ var dragparent = this.dragdata.parentNode
- dragparent.removeChild( dragdata );
+ dragparent.removeChild( this.dragdata );
var dpc = this._findInClones( dragparent );
if ( dpc ) dpc.checkChildren();
- dragged.datapath.setPointer( dragdata );
+ dragged.datapath.setPointer( this.dragdata );
dragged.bringToFront();
- dragupdel.register( lz.Idle, "onidle" );
+ this.dragupdel.register( lz.Idle, "onidle" );
_clicker.drag( true );
</method>
<!--- @access private -->
<method name="_updateDragged">
- dragged.setAttribute('y', this.getMouse( 'y' ) - _ydragoff );
+ dragged.setAttribute('y', this.getMouse( 'y' ) - this._ydragoff );
</method>
<method name="endDrag" args="who">
<![CDATA[
- dragupdel.unregisterAll();
+ this.dragupdel.unregisterAll();
dragged.setAttribute('visible', false );
_clicker.drag( false );
if ( _clicker.dragisover ){
var p = selman.getSelection()[ 0 ].p;
if ( p.childNodes && p.childNodes.length ){
- p.insertBefore( dragdata , p.getFirstChild() );
+ p.insertBefore( this.dragdata , p.getFirstChild() );
} else {
- p.appendChild( dragdata );
+ p.appendChild( this.dragdata );
}
this._findInClones( p ).checkChildren();
} else {
var cn = _clicker.cpos;
- var ac = nodeinst.clones[ cn - 1 ];
+ var ac = this.nodeinst.clones[ cn - 1 ];
if ( !ac ){
return;
}
@@ -345,18 +345,18 @@
var p = ac.datapath.p;
if ( p.attributes[ openattr ] == "true" &&
ac.datapath.xpathQuery( nodepath ) ){
- p.insertBefore( dragdata , p.getFirstChild() );
+ p.insertBefore( this.dragdata , p.getFirstChild() );
} else{
var ns = p.getNextSibling();
if ( ns ){
- ns.parentNode.insertBefore( dragdata , ns );
+ ns.parentNode.insertBefore( this.dragdata , ns );
} else {
- p.parentNode.appendChild( dragdata );
+ p.parentNode.appendChild( this.dragdata );
}
}
}
- this.updateHierarchy( dragdata );
+ this.updateHierarchy( this.dragdata );
]]>
</method>
Modified: openlaszlo/trunk/test/components/base/lzunit-baseform.lzx
===================================================================
--- openlaszlo/trunk/test/components/base/lzunit-baseform.lzx 2008-09-09 22:18:31 UTC (rev 10936)
+++ openlaszlo/trunk/test/components/base/lzunit-baseform.lzx 2008-09-09 23:03:57 UTC (rev 10937)
@@ -61,10 +61,10 @@
<method name="testToXML">
// this is related to LPP-1535
- var str = bf1.cb1.toXML();
+ var str = bf1.cb1.toXML(false);
assertTrue(str.indexOf("cb1") >= 0);
bf1.cb1.setAttribute("submitname", "carabiner");
- str = bf1.cb1.toXML();
+ str = bf1.cb1.toXML(false);
assertTrue(str.indexOf("carabiner") >= 0);
</method>
<method name="addTests">
@@ -120,7 +120,7 @@
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2005-2006 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2005-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@ -->
Modified: openlaszlo/trunk/test/components/base/test-basedatepicker.lzx
===================================================================
--- openlaszlo/trunk/test/components/base/test-basedatepicker.lzx 2008-09-09 22:18:31 UTC (rev 10936)
+++ openlaszlo/trunk/test/components/base/test-basedatepicker.lzx 2008-09-09 23:03:57 UTC (rev 10937)
@@ -23,8 +23,8 @@
<class name="mydatepicker"
extends="basedatepicker"
- weekclass="myweek"
- dayclass="myday"
+ weekclass="lz.myweek"
+ dayclass="lz.myday"
xinset="0"
yinset="0">
@@ -32,16 +32,16 @@
super.setMonthToShow(month,year);
this.display.month.datapath.setXPath(
"datepicker_strings_en:/months/month[@index='" + month + "']/@full" );
- this.display.year.setText( year );
+ this.display.year.setAttribute('text', year );
</method>
<handler name="onselecteddate">
if( this.selecteddate != null ) {
- this.selected.year.setText( this.selecteddate.getFullYear() );
+ this.selected.year.setAttribute('text', this.selecteddate.getFullYear() );
this.selected.month.datapath.setXPath(
"datepicker_strings_en:/months/month[@index='" +
this.selecteddate.getMonth() + "']/@full" );
- this.selected.date.setText( this.selecteddate.getDate() );
+ this.selected.date.setAttribute('text', this.selecteddate.getDate() );
}
</handler>
More information about the Laszlo-checkins
mailing list