avoiding doubleclick events in custom control

Alfonso De Prisco adeprisco at almateq.com
Sat Feb 3 06:31:37 PST 2007


Hi Julien,

In plain Windows API programming (not your case then), you have to add 
the CS_DBLCLKS flag which is a window class style flag when you register 
the window class. Then, each time you create a new window you have to 
provide the registered window class and the new window will receive some 
characteristics from that class (e.g. the double click management).
wxMSW implementation hides all these details and just allows you to 
create double click enabled windows.


I don't know the details about how a Mac window is created from the 
system API point of view, but if the double click enabling option exists 
(maybe you just cannot disable the double click management at all...), 
then most probably it has already been managed by wxMac in the OS 
specific window creation code.

If the MacOS allows to disable the double click management for a window 
at run-time, then you can access the WindowRef (OS dependend window 
reference or "handle") associated to your Mac wxWindow and do that in OS 
specific way.

But if Mac requires that to be set at the window creation stage, like 
with MS Windows, then my advice is to create your own window using MacOS 
specific code and then to attach that Mac window (WindowRef) to a new 
wxWindow.

This, of course, would be specific for Apple platforms and should be 
done again for other platforms...

Best Regards,
Alfonso De Prisco




Julien Pommier ha scritto:
> Hi,
> I have written a custom control and I would like to be notified 
> (without delay) of all mouse button up & down events. The problem is 
> that for quick successions of clicks, I get a double click event 
> instead of two successive left click. I can't find a way to say to my 
> wxControl that I do not want doubleclick events. Is there a solution ? 
> (I'm using wxMac right now)
>
> Best regards,
> Julien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
>
>





More information about the wx-users mailing list