Revision: 2945
          http://vexi.svn.sourceforge.net/vexi/?rev=2945&view=rev
Author:   clrg
Date:     2008-06-17 21:01:58 -0700 (Tue, 17 Jun 2008)

Log Message:
-----------
More option/combo refinement

Modified Paths:
--------------
    trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/combo.t
    trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/option.t

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/combo.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/combo.t      
2008-06-16 15:02:09 UTC (rev 2944)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/combo.t      
2008-06-18 04:01:58 UTC (rev 2945)
@@ -11,7 +11,7 @@
         
         // public vars
         thisbox.matchtext = false;
-        thisbox.showvalue = true;
+        thisbox.showvalue = false;
         
         // assign event traps
         KeyPressed ++= static.keypressEvent;

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/option.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/option.t     
2008-06-16 15:02:09 UTC (rev 2944)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/option.t     
2008-06-18 04:01:58 UTC (rev 2945)
@@ -30,7 +30,7 @@
         Press1     ++= static.pressEvent;
         
         // assign property traps
-        popup   ++= static.popupWrite;
+        //popup   ++= static.popupWrite;
         popdown ++= static.popdownWrite;
         enabled ++= static.enableWrite;
         value   ++= static.valueWrite;
@@ -98,21 +98,22 @@
         cascade = v;
     }
     
-    /** popdown post-selection of item */
+    /** set value on popdown to selected item */
     static.popdownWrite = function(v) {
-        cascade = v;
         var t = trapee;
         var s = t.v_listgroup ? t.v_listgroup.selected : null;
         if (s and s.selected and s!=t.value) {
             t.value = s.value;
         }
+        cascade = v;
     }
     
-    /** popdown post-selection of item */
+    /** start with selected item on popup */
     static.popupWrite = function(v) {
         cascade = v;
         var t = trapee;
-        if (t.value) {
+        var s = t.v_listgroup ? t.v_listgroup.selected : null;
+        if (t.value and !s) {
             var n = t.numchildren;
             for (var i=0; n>i; i++) {
                 if (t[i].value == t.value) {
@@ -120,8 +121,6 @@
                     break;
                 }
             }
-            if (t.selected and t.selected.value!=t.value)
-                t.selected = null;
         }
     }
     
@@ -129,7 +128,7 @@
     static.valueWrite = function(v) {
         var t = trapee;
         var s = t.v_listgroup ? t.v_listgroup.selected : null;
-        if (t.value != v) {
+        if (t.value != v and !t.popped) {
             cascade = v;
             if (v==null) {
                 if (s and s.selected) s.selected = false;
@@ -138,11 +137,12 @@
                 for (var i=0; n>i; i++) {
                     if (t[i].value == t.value) {
                         t[i].selected = true;
+                        s = t[i];
                         break;
                     }
                 }
             }
-        }
+        } else cascade = v;
         t.text = t.showvalue ? t.value : s ? s.text : "";
     }
     


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to