I’m new to Xojo and missing something. I am trying to select an object I have drawn in my canvas and drag it. I plan to:
- detect what object to move by the x,y coordinate in MouseDown.
- update the coordinates as MouseDrag occurs and re-paint
- make the coords permanent after MouseUp
But I cannot seem to trigger the MouseDrag event. I am clicking inside the canvas and dragging but nothing is happening (that I can tell). MouseMove works fine but does not fire when the Mouse is down (which seems appropriate).
Is there something else I need to do to enable MouseDrag in a Canvas?
Did you ‘return true’ in the mouse down event?
I did not. Is that required to enable MouseDrag?
something like that should have return true by default in the event method.
its just a stumbling block.
i think usually if you use this event it handle something.
It’s written in bold in the documentation on MouseDrag. I guess it was so obvious I just overlooked it. Sorry for spamming everyone with a silly question.
It’s not a silly question at all.
So easy to overlook things when reading sentences; for anyone.
Actually, when you add a “MouseDrag” event to a window or control, the explanation on the right side ends with “This event will not occur unless you return True in the MouseDown event.”, but all paragraphs are joined together, so easy to miss.