I am implementing a graphical user interface with Morphic / Squeak. Some of the items have drag & drop functionality. While dragging, I want to be able to rotate these items with the mousewheel.
The first problem is that using the mousewheel ends the drag-action and leads to a drop (attempt). How can I suppress that – and fire the mouseWheelEvent at the same time?
The second problem: How can I assign a mousewheel-event to my Morph? As mentioned above, this event only is relevant while dragging this Morph. (solved)
Appears that on VM implementations that have chosen to support it, Squeak maps the mouse wheel to Ctrl Up-Arrow and Ctrl-Down-Arrow key events. For instance, on Win32 in sqWin32Window.c:
So that’s pretty much what you’ve got to work with inside Squeak. (If you’re using the Polymorph extensions, there is a special
mouseWheelevent, but all they’re doing is filtering Ctrl-Up and Ctrl-Down and generating a “fake”MouseWheelEventmessage.)Looking at a bit of code for
handleEventinHandMorph:The Polymorph
MouseWheelEventis a subclass of MouseEvent that doesn’t return true toisMove, hence you get a drop. You’ll have to change something here if you want this to work.