I have a control that allows drawing and modifying shapes. I provide context
menu to access common tasks for a chosen shape. So I override OnMouseMove
for dragging shapes and OnMouseDown, OnMouseUp to set dragging flag if LMB
was pressed, or show the context menu if RMB was pressed. If the menu is
cancelled by a mouse click, the app gets nuts and moves shapes because:
1. it detects RMB down on the shape, so it selects current shape and popups
the menu for the shape
2. it detects LMB down in an away location -- since there was no mouse move
in the meantime, it assumes it is valid situation to enable moving the shape
3. now come the previous mouse move events (that should have occurred
between steps 1 & 2), and the shape is being moved (moving is in OnMouseMove
to allow interactive moving)
4. finally mouse up is fired (in the same position as mouse down since it
was merely a click) and the moving operation is finalized.
I either want step 3. to come after step 1., or an idea how to get around
this issue.