Revision: 4402 http://vexi.svn.sourceforge.net/vexi/?rev=4402&view=rev Author: clrg Date: 2012-06-03 03:02:31 +0000 (Sun, 03 Jun 2012) Log Message: ----------- Sync cursor after cut/paste operations
Modified Paths: -------------- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/edit.t Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/edit.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/edit.t 2012-06-01 19:24:14 UTC (rev 4401) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/edit.t 2012-06-03 03:02:31 UTC (rev 4402) @@ -152,41 +152,12 @@ thisbox.selectAll; // publicly accessible function for selecting all text thisbox.unselectAll; // publicly accessible function for unselecting all text - thisbox.copy = function() { - if (select) { - var t = getSelectedText(); - vexi.ui.clipboard = t; - } - } + thisbox.copy; + thisbox.copyAll; + thisbox.cut; + thisbox.cutAll; + thisbox.paste; - thisbox.copyAll = function() { - selectAll(); - copy(); - unselectAll(); - } - - thisbox.cut = function() { - if (select) { - var t = getSelectedText(); - vexi.ui.clipboard = t; - deleteSelectedText(); - } - } - - thisbox.cutAll = function() { - selectAll(); - copy(); - deleteSelectedText(); - } - - thisbox.paste = function() { - if (select) { - deleteSelectedText(); - } - var t = vexi.ui.clipboard; - insertText(t); - } - /////////////////////////////////////////////////////////////// //////// Internal Behaviour /////////////////////////////////// /////////////////////////////////////////////////////////////// @@ -1783,6 +1754,44 @@ cursorLock = false; // unlock cursor } + thisbox.copy = function() { + if (select) { + var t = getSelectedText(); + vexi.ui.clipboard = t; + } + } + + thisbox.copyAll = function() { + selectAll(); + copy(); + unselectAll(); + } + + thisbox.cut = function() { + if (select) { + var t = getSelectedText(); + vexi.ui.clipboard = t; + deleteSelectedText(); + syncCursorAndOffset(true); + } + } + + thisbox.cutAll = function() { + selectAll(); + copy(); + deleteSelectedText(); + syncCursorAndOffset(true); + } + + thisbox.paste = function() { + if (select) { + deleteSelectedText(); + } + var t = vexi.ui.clipboard; + insertText(t); + syncCursorAndOffset(true); + } + // functions for read only theme access to c* variabels thisbox.getCBlock = function() { return cBlock; } thisbox.getCWord = function() { return cWord; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn