Board index » cppbuilder » click and double click

click and double click

I an using builder 3 and need to use OnClick and OnDblClick events for a
component.  When I double click the component I get an OnClick event
first and then an OnDblClick event.  I don't want the Click as part of
the DblClick. I tried using the mouse events but get the following.

When I single click I get these events
1. OnMouseDown
2. OnClick
3. OnMouseUp

When I double click I get these events
1. OnMouseDown
2. OnClick
3. OnMouseUp
4. OnDlbClick
5. OnMouseDown
6. OnMouseUp

thus I can't figure out how to differentiate between a single OnClick
and an OnClick that is part of a DblClick.

Kevin

 

Re:click and double click


Hi, Kevin!

That's part of the problem Windows has, also. The only real answer is to
have the OnClick handler set a flag and start a timer, and if the
OnDblClick fires for it to disable the timer. The timer then can execute
the real event handler if OnDblClick never fires.

------
Mark Cashman, TeamB C++ Builder
http://www.temporaldoorway.com/programming/index.htm
C++ Builder, JBuilder programming information
Home of The C++ Builder Programmer's Webring - Join us!
------

Other Threads