pharo-graphics / Roassal

The Roassal Visualization Engine
MIT License
16 stars 12 forks source link

Double click processing for roassal #41

Closed akevalion closed 10 months ago

akevalion commented 1 year ago

From discord Pavel said

looking into trustworthy Programming Windows 3.1 book , I found this:

If you want your window procedure to receive double-click mouse messages, you must include the identifier CS-DBLCLKS when initializing the window style in the window class structure before calling Register Class:

wndcl ass. style = CS_H REDRAW ! CS.VREDRAW ! CS_DBLCLKS ;

If you do not include CS_DBLCLKS in the window style and the user clicks the left mouse button twice in quick succession, your window procedure receives these messages: WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDOWN, and WM-LBUT- TONUP. (The window procedure might also receive other messages between these button messages.) If you want to implement your own double-click logic, you can use the Win¬ dows function GetMessageTime to obtain the relative times of the WM-LBUTTONDOWN messages. This function is discussed in more detail in Chapter 5.

If you include CS_DBLCLKS in your window class, the window procedure receives these messages for a double-click: WM-LBUTTONDOWN, WM-LBUTTONUP, WM- _LBUTTONDBLCLK, and WM_LBUTTONUP. The WM-LBUTTONDBLCLK message sim¬ ply replaces the second WM-LBUTTONDOWN message.

...this is nice and reasonable solution of double-click processing instead of direct detection, it may just check if there is a handler for a double click

akevalion commented 10 months ago

moved to roassal3