5/19/2022 6:44 AM | |
Joined: 11/4/2021 Last visit: 4/19/2024 Posts: 64 Rating:
|
Hi gvatte, There is a way to get the mouse events indirectly through a dynamic svg, attached is a rough proof of concept. By rough I mean I just knocked it together and it does 'stuff' but it is far from polished or ready for production. A few comments and issues that I ran into:
If anyone is interested in how I figured this out, here are some places to start:
If anyone wants to take this further or has some ideas on how to turn this into a viable drag and drop solution without using a custom web control, I'd be keen to see the result. Regards, Michael AttachmentMoveArea.zip (626 Downloads) |
This contribution was helpful to
2 thankful Users |
5/20/2022 6:17 AM | |
Joined: 11/4/2021 Last visit: 4/19/2024 Posts: 64 Rating:
|
A quick follow up, here is video of it working with a translucent background for debug purposes. AttachmentMoveArea_Debug.avi (733 Downloads) |
5/20/2022 6:20 AM | |
Joined: 11/4/2021 Last visit: 4/19/2024 Posts: 64 Rating:
|
And again with fully transparent background and no border. Full disclosure, the behaviour is slightly different on a physical panel when I tested it. This is due to the lack of mouse hover events which should set the drag anchor point. A different approach would be needed so that it doesn't just drag from the top corner.
AttachmentMoveArea_Transparent.avi (628 Downloads) |
2/5/2025 4:38 PM | |
Joined: 1/11/2023 Last visit: 7/29/2025 Posts: 2 Rating:
|
Old thread but just in case you are interested I was able to find a workaround and get the X Y coordinates back to Runtime. Your MoveArea is the proof that it's possible to influence some attributes at least as it can modify the Top and Left parameters. So we can simply repurpuse the rotation pivot points, and we just have to monitor RotationCenterX and RotationCenterY parameters of the SVG objects. I modified your MoveArea and attached it. Just drop it to a screen then you can monitor the X Y coordinates with IO fields using
Currently it works in a way that X/Y is only calculated when mouse button is kept pressed inside the object. Output value is kept until you leave the object boundary. In case of touch operation, output is 0 as soon as finger is lifted. I had to use onPan because for some reason onMouseDown and onMouseUp events does not seem to be working in case of widgets. That's the last thing I have to solve to able to output press parameters also without panning. Attachmentcoordinatesniffer.zip (187 Downloads) |
Last edited by: Pitykee at: 02/05/2025 16:48:00 |
|
This contribution was helpful to
2 thankful Users |
Follow us on