Tuesday, May 19, 2009

Messages from the Mouse

The handling of mouse button messages is a mess :-(

An attempt to start dragging of a control, from a click on the zone header, seems to block proper processing of further messages. We should re-think the handling of WM_LBUTTONDOWN, with regards to multiple widgetsets and dragging.

When the left button is pressed over a control with DragMode=dmAutomatic, the drag manager should handle this and further messages. It seems not to be a problem to capture input, but the drag manager is responsible for the distinction of immedately started dragging, delayed started dragging (using threshold), and simple clicks on mouse up before dragging starts (threshold not reached). When dragging starts, the dragged control should either not have processed the button down message, or must be reset into unpressed state (CancelMode). When no drag really starts, the drag manager can send both an down and up message to the control, so that it can react on an click in the usual way.

Effectively a mouse button down message should be processed either by the drag manager or by the control, but not by both at the same time!

BTW, dragging from the zone header now works on Linux/gtk2, but no more on Windows/win32 widgetset.

No comments:

Post a Comment