cut copy paste selectall menu while right click mouse

How to implement the cut / copy / paste / selectall menu for textarea and webtextarea when i right click the mouse. This was there bu default in the editfiled but now that is depreceated. I need it both for desktop and web application.

For desktop check Popup at http://documentation.xojo.com/index.php/MenuItem

For Web see http://documentation.xojo.com/index.php/WebMenuItem WebControl.ContextualMenu.

it is still there in the Desktop TextArea.

You won’t be able to control the clipboard from a web app, so implementing your own contextual menu will not work.
You will have to turn the system-provided one back on because Xojo turns it off.

Place a WebCanvas overlaid on top of the WebTextArea. That reinstates the browser right click contextual menu.

[quote=259606:@Tim Parnell]You won’t be able to control the clipboard from a web app, so implementing your own contextual menu will not work.
You will have to turn the system-provided one back on because Xojo turns it off.[/quote]
How to enable the system provided one. Is there any way to enable via javascript

I just told you how to, no need for JS :

I kinda like Michel’s suggestion. Sounds like you can implement it on a field-by-field basis. Unfortunately… I’ve not been able to make it work. Perhaps Michel could elaborate. I’ve placed a WebTextArea on a form. What exactly does he mean by Placing a WebCanvas “overlaid” on top of the WebTextArea? I’ve placed a WebCanvas on my form…I can’t get the browser right-click to work on that object. If I place the WebCanvas over my WebText Area…how can a person type in the WebTextArea? I can set the visibility for False…and this allows my to type in the underlying field…but I still get no browser right click menu. I’ve tried most combinations I can think of except maybe rendering the textfield “inside” the WebCanvas.

Indeed I just tried in the very latest version of Xojo, and it does not work.

The solution is to use the MouseDown event and check for Details.RightMouseButton, then display a Xojo contextual menu.

Yes, I can use the XOJO contextual menus. It’s really rough working with the “clipboard” though. I have a “Notepad” or “Text Edit” document that has several server URLs. A server URL may be something like… http://la5gpprd01.ccpd.ds.really.long.com and is a pain to type. users just want to “select” the text in notepad and paste it into the URL textbox in my XOJO app. Fortunately…the keyboard shortcuts seem to work fine. I received some user feedback that says they expect right click to work. I use the browser copy/paste function in all my other apps built with PHP or .NET etc. I know there is a Javascript command to disable/re-enable the browser right click functionality for a page. I figure maybe I can just execute the Javascript to force right click to return. So far…I haven’t been lucky with that… but I found this thread and thought maybe there was a better way.

Feedback report for contextual menu: feedback://showreport?report_id=23071
Doesn’t mention that it should be an option, but add points to it if you need the menu.

Also, Xojo is a name and should not be in all caps :slight_smile:

I know how to disable the right click menu by using preventDefault in the JavaScript oncontextmenu event, but it seems Xojo uses another way of disabling it.

A quick glance at the frameworks seems to indicate Xojo has placed a hook on the event. Probably to manage the right click. It maybe possible to take over that, but it may also break things in Xojo.

A feature request seems in order to have an option to reinstate the default right click contextual menu.

Thanks for your responses experts. I’ll update the XOJO…errr…I mean Xojo feedback case as I think this would be handy.
I used the browser developer tools to take a peek at the framework as well. I hadn’t found the hook in the framework yet when I noticed Michel’s reply. Thanks again TIM & Michel. :slight_smile:

There are 4 listeners in framework.js for contextmenu. I have absolutely no idea about how to short circuit that.

I’m not looking at the js framework right now, but there is a removeEventListener function.

Sure. But here is the kind of listener the framework uses :

Xojo.events.addListener(caption,'contextmenu',action,false);

It is not exactly the same kind of object as what W3School cites as example. Besides, I do not like the idea to start doing surgery on the framework itself. God knows what it can break.