Revision: 4487 http://vexi.svn.sourceforge.net/vexi/?rev=4487&view=rev Author: clrg Date: 2013-02-15 13:05:29 +0000 (Fri, 15 Feb 2013) Log Message: ----------- Fix mouse-based copy/paste access in disabled edit widgets.
Modified Paths: -------------- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/contextmenu.t trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/menuitem.t Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/contextmenu.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/contextmenu.t 2013-02-11 19:30:23 UTC (rev 4486) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/text/contextmenu.t 2013-02-15 13:05:29 UTC (rev 4487) @@ -13,11 +13,13 @@ static.getContext = function() { var edit = trapee.v_edit; + var enabled = trapee.enabled; return [ new .widget.menuitem({ text: "Cut", icon: .icon.cut, - action: function(v) { cascade = v; edit.cut(); } + action: function(v) { cascade = v; edit.cut(); }, + enabled: enabled }), new .widget.menuitem({ text: "Copy", @@ -27,13 +29,15 @@ new .widget.menuitem({ text: "Paste", icon: .icon.paste, - action: function(v) { cascade = v; edit.paste(); } + action: function(v) { cascade = v; edit.paste(); }, + enabled: enabled }), new .widget.separator(), new .widget.menuitem({ text: "Cut all", icon: .icon.cut, - action: function(v) { cascade = v; edit.cutAll(); } + action: function(v) { cascade = v; edit.cutAll(); }, + enabled: enabled }), new .widget.menuitem({ text: "Copy all", @@ -43,7 +47,8 @@ new .widget.menuitem({ text: "Select all", icon: .icon.select, - action: function(v) { cascade = v; edit.selectAll(); } + action: function(v) { cascade = v; edit.selectAll(); }, + enabled: enabled }) ]; } Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/menuitem.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/menuitem.t 2013-02-11 19:30:23 UTC (rev 4486) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/menuitem.t 2013-02-15 13:05:29 UTC (rev 4487) @@ -24,6 +24,8 @@ text = arg.text; icon = arg.icon; action ++= arg.action; + if (arg.enabled!=null) + enabled = arg.enabled; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn