Dplug icon indicating copy to clipboard operation
Dplug copied to clipboard

Possibility for onMouseClick to consume the click event, but not initiate dragging.

Open p0nce opened this issue 4 years ago • 1 comments

For now:

  • returning false from onMouseClick does not consume the event
  • returning true from onMouseClick always initiate dragging

Need a third way that says "consume the event, but do not initiate dragging. Dragging effect is:

  • lock mouse to the window
  • transform onMouseMove into onMouseDrag
  • delay calling onMouseExit until dragging is terminated (mouse is released)

p0nce avatar Jul 05 '20 10:07 p0nce

I have this in a prototype:

enum ClickOutcome
{
    ignored, // Widget did not process the click
    drag,    // Widget processed the click and started dragging
    consumed // Widget consumed the click.
}

but I think returning bool + a startDragging call is a bit better?

p0nce avatar Sep 05 '21 10:09 p0nce

Perhaps separate "initiate/abandon mouse dragging" from "respond on a click"

p0nce avatar Oct 13 '22 18:10 p0nce

Done in v13

p0nce avatar Oct 31 '22 10:10 p0nce