I think Xojo could well do with this functionality as native feature, but until then I need a sensible work around. We need to both drag and drop an array of canvas controls as well as open an edit window for each one, by way of say a mouse DoubleClick. This is where the problems begin.
The discussion(s) at propose a good browser side way to do what we want and we have this working verbatim. But as soon as any Mouse* event is added to the canvas it appears the event gets gobbled up by the backend and this browser side drag behaviour is never initiated. Even empty Mouse* events obscure the message.
Any clever thoughts on what’s happening here and how we might work around it to achieve both drag and Mouse* events?
[quote=145280:@Ian Ramsay]I think Xojo could well do with this functionality as native feature, but until then I need a sensible work around. We need to both drag and drop an array of canvas controls as well as open an edit window for each one, by way of say a mouse DoubleClick. This is where the problems begin.
The discussion(s) at propose a good browser side way to do what we want and we have this working verbatim. But as soon as any Mouse* event is added to the canvas it appears the event gets gobbled up by the backend and this browser side drag behaviour is never initiated. Even empty Mouse* events obscure the message.
Any clever thoughts on what’s happening here and how we might work around it to achieve both drag and Mouse* events?[/quote]
I forgot a big deal of that discussion but remember it was not quite as easy once could wish. From discussions over the Internet, it appears such feature is not very easy to implement across all browsers, especially FireFox. Events snatching the control are never quite easy to debug in JS.
Why not simply place a small Edit button next to the Canvas instead ?
Maybe a solution : Double click goes through a canvas and fires in the WebPage. So instead of adding it to the canvas, add it to the WebPage and check the boundaries to make sure it happens in the canvas.
Your good thinking has been implemented and seems to work just fine. However, the overall approach seems rather fragile. Not really a production class solution. For now this is OK as we are just using Xojo for the proof of concept.
I simply let the mouse events drop through to the control on the web page and send them back to Xojo.Server as appropriate. Have added some extra event types in JavaScript to the original solution as linked to above … code is available if anybody would like to see the (ever so slight) extension.