Revision: 2330 http://vexi.svn.sourceforge.net/vexi/?rev=2330&view=rev Author: clrg Date: 2007-09-24 16:33:20 -0700 (Mon, 24 Sep 2007)
Log Message: ----------- Make selectable use visible/enabled instead of focusable Modified Paths: -------------- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/selectable.t Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/selectable.t =================================================================== --- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/selectable.t 2007-09-24 23:14:18 UTC (rev 2329) +++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/selectable.t 2007-09-24 23:33:20 UTC (rev 2330) @@ -89,11 +89,11 @@ var ns = trapee; var g = ns.groupref; do { - vexi.log.info(ns); ns = g.members.after(ns); if (!ns) ns = g.members.first; - } while (!ns.focusable and ns != trapee); - + if (!ns.visible or !ns.enabled) continue; + return ns; + } while (ns != trapee); return ns; } @@ -104,8 +104,9 @@ do { ps = g.members.before(ps); if (!ps) ps = g.members.last; - } while (!ps.focusable and ps != trapee); - + if (!ps.visible or !ps.enabled) continue; + return ps; + } while (ps != trapee); return ps; } @@ -131,20 +132,23 @@ /** selection by keyboard navigation for selectable groups */ static.keypressWrite = function(v) { - var g = trapee.groupref; + var t = trapee; + var g = t.groupref; // can't do anything if (!g) { cascade = v; return; } // deal with key event g.keygroup = true; // forwards - if (v == "down" or v == "right") - trapee.nextselect.selected = true; + if (v == "down" or v == "right") { + var ns = t.nextselect; + if (ns) ns.selected = true; // backwards - else if (v == "up" or v == "left") - trapee.prevselect.selected = true; + } else if (v == "up" or v == "left") { + var ps = t.prevselect; + if (ps) ps.selected = true; // pass to other widget code - else cascade = v; + } else cascade = v; // finished - move on g.keygroup = false; @@ -167,7 +171,7 @@ var mem = group.members; var obj = mem.first; // reassign group references - must happen before merge - while (obj) { vexi.log.info(obj); obj.groupref = g; obj = mem.after(obj); } + while (obj) { obj.groupref = g; obj = mem.after(obj); } // merge vectors g.members.merge(mem, after); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn