Revision: 4596 http://sourceforge.net/p/vexi/code/4596 Author: clrg Date: 2013-11-21 19:19:25 +0000 (Thu, 21 Nov 2013) Log Message: ----------- Feature - 'interactive' property for edit implementations - put false to disable mouse interaction (enabled by default)
Modified Paths: -------------- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/default.t branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/edit.t Modified: branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/default.t =================================================================== --- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/default.t 2013-11-21 19:00:50 UTC (rev 4595) +++ branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/default.t 2013-11-21 19:19:25 UTC (rev 4596) @@ -85,7 +85,7 @@ thisbox.cursorcolor ++= static.cursorcolorWrite; - .util.redirect..addRedirect(thisbox, v_edit, "multiline", "textalign", "wraptext", "wrapwidth"); + .util.redirect..addRedirect(thisbox, v_edit, "interactive", "multiline", "textalign", "wraptext", "wrapwidth"); </ui:box> Modified: branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/edit.t =================================================================== --- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/edit.t 2013-11-21 19:00:50 UTC (rev 4595) +++ branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/edit.t 2013-11-21 19:19:25 UTC (rev 4596) @@ -1644,7 +1644,7 @@ } /** select word if double-clicked on */ - thisbox.DoubleClick1 ++= function(v) { + const selectWordUnderMouse = function(v) { cascade = v; if (!mBlock or !mBlock.mWord) { return; @@ -1680,7 +1680,7 @@ } /** standard mouse interaction */ - thisbox.Press1 ++= function(v) { + const startMouseSelect = function(v) { cascade = v; if (select) { // previously in select mode @@ -1712,6 +1712,21 @@ surface ++= releaseSelected; } + /** enables/disables mouse text selection */ + thisbox.interactive ++= function(v) { + cascade = v; + if (v) { + thisbox.Press1 ++= startMouseSelect; + thisbox.DoubleClick1 ++= selectWordUnderMouse; + } else { + thisbox.Press1 --= startMouseSelect; + thisbox.DoubleClick1 --= selectWordUnderMouse; + } + }; + // defaulting to on for now + // TODO: remove this + interactive = true; + /** selects all available words */ thisbox.selectAll = function() { // TODO - is this next line even needed? @@ -2232,16 +2247,16 @@ } static.charCaretLookup = { - "65":194, "194":65, // A->\xC2 - "97":226, "226":97, // a->\xE2 - "69":202, "202":69, // E->\xCA - "101":234, "234":101, // e->\xEA - "73":206, "206":73, // I->\xCE - "105":238, "238":105, // i->\xEE - "79":212, "212":79, // O->\xD4 - "111":244, "244":111, // o->\xF4 - "85":219, "219":85, // U->\xDB - "117":251, "251":117, // u->\xFB + "65":194, "194":65, // A->� + "97":226, "226":97, // a->� + "69":202, "202":69, // E->� + "101":234, "234":101, // e->� + "73":206, "206":73, // I->� + "105":238, "238":105, // i->� + "79":212, "212":79, // O->� + "111":244, "244":111, // o->� + "85":219, "219":85, // U->� + "117":251, "251":117, // u->� "87":372, "372":87, // W-> "119":373, "373":119, // w-> "89":374, "374":89, // Y-> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn