Revision: 4059
http://vexi.svn.sourceforge.net/vexi/?rev=4059&view=rev
Author: mkpg2
Date: 2011-03-21 01:55:25 +0000 (Mon, 21 Mar 2011)
Log Message:
-----------
Make cell creation overrideable.
Modified Paths:
--------------
trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/row.t
Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/row.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/row.t
2011-03-20 23:38:57 UTC (rev 4058)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/row.t
2011-03-21 01:55:25 UTC (rev 4059)
@@ -6,11 +6,11 @@
</meta:doc>
<ui:box>
-
thisbox.curfill = null;
thisbox.selected = false;
thisbox.v_setfill = true;
-
+ thisbox.newCellLabel = static.newCellLabelFunc;
+
thisbox.Children ++= static.childrenWrite;
thisbox.fill ++= static.fillWrite;
thisbox.rowfill ++= static.rowfillWrite;
@@ -19,6 +19,8 @@
</ui:box>
+
+
/** automatically set cell.v_head */
static.childrenWrite = function(v) {
if (!trapee.v_head) {
@@ -80,21 +82,31 @@
}
}
+
+ static.newCellLabelFunc = function(colhead){
+ return new .cell(colhead.datatype);
+ };
+
+
/** default row value write trap */
static.valueWrite = function(v) {
var h = trapee.v_head;
if (!h) {
throw "v_head must be set on a row before the row value is written
to";
}
- // assign new cells
+
+ // cascade before we create cells so value is
+ // make value available (can be useful)
+ cascade = v;
+
+ // assign new cells
var n = h.numchildren;
for (var j=0; n>j; j++) {
if (!trapee[j]) {
- trapee[j] = new .cell(h[j].datatype);
+ trapee[j] = trapee.newCellLabel(h[j]);
}
- trapee[j].value = v ? v[j] : null;
+ trapee[j].value = v?[j];
}
- cascade = v;
- }
+ };
</vexi>
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn