Revision: 4461 http://vexi.svn.sourceforge.net/vexi/?rev=4461&view=rev Author: mkpg2 Date: 2012-12-07 06:56:35 +0000 (Fri, 07 Dec 2012) Log Message: ----------- Fix. Make repeatedly set trap once/text field.
Modified Paths: -------------- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/field.t Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/field.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/field.t 2012-12-06 19:27:02 UTC (rev 4460) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/field.t 2012-12-07 06:56:35 UTC (rev 4461) @@ -128,14 +128,9 @@ var view = tbox.th_view; var viewport = tbox.th_viewport; - edit.focused = f; - if (f) { - if (trapee.selectonfocus) { - edit.selectAll(); - } - - // sync the textfield with the cursor pos so it is always visible - var sync = function(v) { + var sync = trapee.syncTrap; + if(sync==null){ + sync = trapee.syncTrap = function(v) { cascade = v; var viewtoedit = view.distanceto(edit).x; var porttocursor = viewport.distanceto(cursor).x; @@ -158,7 +153,15 @@ view.x = viewport.width - view.width; } }; + } + + edit.focused = f; + if (f) { + if (trapee.selectonfocus) { + edit.selectAll(); + } + // sync the textfield with the cursor pos so it is always visible tbox.v_syncViewWithCursor = v_sync; if (cursor and sync) { cursor.x ++= sync; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn