copy contents of mle

This forum is for general support of Xbase++
Post Reply
Message
Author
bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

copy contents of mle

#1 Post by bwolfsohn »

Is it possible to copy contents of an mle that is editprotected ??

i'd like to right click to bring up a menu with copy as an option, but that doesn't seem possible.
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: copy contents of mle

#2 Post by Tom »

Code: Select all

@ n,n DCMULTILINE cText .... EDITPROTECT {||!lEdit} EVAL {|o|o:RbDown := {|x,y,z|IF(!lEdit,oMyMenu:PopUp(z,x,2,XBPMENU ...),nil)}}
"oMyMenu" maybe a DCMENU with only one item "copy". It will take the data (oMemo:GetData()) and copy it to the clipboard.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: copy contents of mle

#3 Post by rdonnay »

EDITPROTECT will not even allow the MLE to gain focus, thus you can't use the mouse to copy contents.

If you want to protect from editing but still allow the mouse to work, try this:

Code: Select all

@ .. DCMULTILINE .. EVAL {|o|o:keyboard := {|a,b,o|o:undo()}}
Don't use the EDITPROTECT clause.
The eXpress train is coming - and it has more cars.

Post Reply