Revision: 3755
http://vexi.svn.sourceforge.net/vexi/?rev=3755&view=rev
Author: clrg
Date: 2009-11-12 02:45:13 +0000 (Thu, 12 Nov 2009)
Log Message:
-----------
Select first/last by group instead of iterating over children
Modified Paths:
--------------
trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/selectcontainer.t
Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/selectcontainer.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/selectcontainer.t
2009-11-12 02:42:49 UTC (rev 3754)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/selectcontainer.t
2009-11-12 02:45:13 UTC (rev 3755)
@@ -20,27 +20,35 @@
/** select the first available item in the list */
thisbox.selectFirst = function() {
- var content = v_content;
- var n = content.numchildren;
- for (var i=0; n>i; i++) {
- var c = content[i];
- if (c.display and c.enabled) {
- c.selected = true;
+ var group = v_listgroup;
+ if (group==null) {
+ return;
+ }
+ var vec = group.members;
+ var item = vec.first;
+ while (item!=null) {
+ if (item.display and item.enabled) {
+ item.selected = true;
break;
}
+ item = vec.after(item);
}
}
/** select the lastmost available item in the list */
thisbox.selectLast = function() {
- var content = v_content;
- var n = content.numchildren;
- for (var i=n-1; i>=0; i--) {
- var c = content[i];
- if (c.display and c.enabled) {
- c.selected = true;
+ var group = v_listgroup;
+ if (group==null) {
+ return;
+ }
+ var vec = group.members;
+ var item = vec.last;
+ while (item!=null) {
+ if (item.display and item.enabled) {
+ item.selected = true;
break;
}
+ item = vec.before(item);
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn