Revision: 4482 http://vexi.svn.sourceforge.net/vexi/?rev=4482&view=rev Author: clrg Date: 2013-01-18 03:21:42 +0000 (Fri, 18 Jan 2013) Log Message: ----------- Live value puts for textarea by default (disable by setting liveValuePut=false)
Modified Paths: -------------- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/textarea.t trunk/org.vexi-vexi.widgets/src_poke/visualtest/text.t Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/textarea.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/textarea.t 2013-01-17 14:16:41 UTC (rev 4481) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/textarea.t 2013-01-18 03:21:42 UTC (rev 4482) @@ -8,6 +8,7 @@ <text.contextmenu /> <ui:box> + thisbox.liveValuePut = true; thisbox.th_scroll; thisbox.KeyPressed ++= static.keypressWrite; @@ -23,7 +24,11 @@ static.valueRead = function() { return trapee.v_edit.text; } /** set text on value writes */ - static.valueWrite = function(v) { trapee.v_edit.text = v; return; } + static.valueWrite = function(v) { + if (!trapee.v_valueput) + trapee.v_edit.text = v; + return; + } /** pass on focus notification to editbox */ static.enableWrite = function(v) { cascade = v; trapee.v_edit.enabled = trapee.enabled; } @@ -32,6 +37,11 @@ static.keypressWrite = function(v) { cascade = v; trapee.v_edit.KeyPressed = v; + if (trapee.liveValuePut) { + trapee.v_valueput = true; + trapee.value = trapee.value; + trapee.v_valueput = false; + } } /** set up editbox */ @@ -50,7 +60,8 @@ var scroll = trapee.th_scroll; if (!focused) { - trapee.value = trapee.value; + if (!trapee.liveValuePut); + trapee.value = trapee.value; } else if (focused and cursor!=null and scroll!=null) { /** syncs the view to be make sure the cursor is visible */ var sync = function(v) { Modified: trunk/org.vexi-vexi.widgets/src_poke/visualtest/text.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_poke/visualtest/text.t 2013-01-17 14:16:41 UTC (rev 4481) +++ trunk/org.vexi-vexi.widgets/src_poke/visualtest/text.t 2013-01-18 03:21:42 UTC (rev 4482) @@ -22,6 +22,7 @@ <w:button id="get" text="Get Cursor Index" /> <ui:box id="output" /> </ui:box> + $edit.value ++= function(v) { $edit2.value = v; cascade = v; } $get.action ++= function(v) { cascade = v; $output.text = "Cursor position: "+$edit.v_edit.getCursorCharIndex(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812 _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn