OK, I've been hoping for this for some time, and now Martin Heller just posted a wiki page on how to trap the mouse events on an Xdialog! He posted an example put together by the Alpha Software team, and it's slick.
See http://wiki.alphasoftware.com/How+to...+in+an+xdialog
For some reason (see the comment at the bottom of the page) there's a '<x>' in the middle of the function name of a few of the functions, so you can click on File Attached at the bottom to get a clean copy of the code (or just delete the <x> manually).
With a little experimenting, I found it easy to add OnRButtonDown and OnRButtonUp functions -- just copy the OnLButtonUp() function and change the name -- but OnMouseWheel() and OnMouseEnter() weren't recognized. I'd love to see more documentation - I've used ui_bitmap_draw() but never heard of ui_generate_quick_draw, which seems virutally identical -- but I'll have to test it to make sure. But it's nice to be able to get left and right mouse button up/down events with the x/y pixel positions, and it's very fast and smooth - much better than using the timer event.
BTW, if you haven't used the bitmap drawing functions, you're missing a lot. Enter "bitmap and graphic functions" in the wiki search box and click on Titles (or find it in the local help). I've used these extensively to create a graphic-design module in 100% A5 code, and was just missing the full mouse package (kinda lame to not be able to directly select graphic objects with the mouse!). With this functionality, I should now be able to rewrite my modules to move and resize graphic objects.
In running the example (just copy/paste it into a new script) I noticed that key events are passed to the control you click on, but you have to click on it first.
For me, this is huge. And it completes the package for anyone needing full mouse and/or graphics abilities all from inside AlphaFive.
- Eric
See http://wiki.alphasoftware.com/How+to...+in+an+xdialog
For some reason (see the comment at the bottom of the page) there's a '<x>' in the middle of the function name of a few of the functions, so you can click on File Attached at the bottom to get a clean copy of the code (or just delete the <x> manually).
With a little experimenting, I found it easy to add OnRButtonDown and OnRButtonUp functions -- just copy the OnLButtonUp() function and change the name -- but OnMouseWheel() and OnMouseEnter() weren't recognized. I'd love to see more documentation - I've used ui_bitmap_draw() but never heard of ui_generate_quick_draw, which seems virutally identical -- but I'll have to test it to make sure. But it's nice to be able to get left and right mouse button up/down events with the x/y pixel positions, and it's very fast and smooth - much better than using the timer event.
BTW, if you haven't used the bitmap drawing functions, you're missing a lot. Enter "bitmap and graphic functions" in the wiki search box and click on Titles (or find it in the local help). I've used these extensively to create a graphic-design module in 100% A5 code, and was just missing the full mouse package (kinda lame to not be able to directly select graphic objects with the mouse!). With this functionality, I should now be able to rewrite my modules to move and resize graphic objects.
In running the example (just copy/paste it into a new script) I noticed that key events are passed to the control you click on, but you have to click on it first.
For me, this is huge. And it completes the package for anyone needing full mouse and/or graphics abilities all from inside AlphaFive.
- Eric
Comment