Board index » delphi » Can we separate OnDblClick Event from OnClick Event?

Can we separate OnDblClick Event from OnClick Event?

Hello,
        I need to separate On DblClick event from OnClick event. I
wrote some code in "edit1click" procedure and other code in
"edit1dblclick" procedure. How to do, to not execute the OnClick code
when I dblClick the mouse?
Thank you,
                                Nemecsek
                                nemec...@personal.ro
 

Re:Can we separate OnDblClick Event from OnClick Event?


Quote
"Nemecsek Gyorke" <romaup...@yahoo.com> wrote in message

news:uhi0lt8mtk8qpqr9as7952d45eo478s9tk@4ax.com...

Quote
> Hello,
> I need to separate On DblClick event from OnClick event. I
> wrote some code in "edit1click" procedure and other code in
> "edit1dblclick" procedure. How to do, to not execute the OnClick code
> when I dblClick the mouse?

You can't do it nicely. The sequence of events is
    OnClick
    OnDblClick
IMO its best to try and alter the design so that this distinction is not
necessary. If that isn't possible, have the OnClick start a timer that is
stopped by the OnDblClick. Place the OnClick code in the timer's OnTimer
event.

Re:Can we separate OnDblClick Event from OnClick Event?


Look up the OnMouseDown event and the ssDouble value of the TShiftState
type.

John Randall.

Quote
Nemecsek Gyorke <romaup...@yahoo.com> wrote in message

news:uhi0lt8mtk8qpqr9as7952d45eo478s9tk@4ax.com...
Quote
> Hello,
> I need to separate On DblClick event from OnClick event. I
> wrote some code in "edit1click" procedure and other code in
> "edit1dblclick" procedure. How to do, to not execute the OnClick code
> when I dblClick the mouse?
> Thank you,
> Nemecsek
> nemec...@personal.ro

Re:Can we separate OnDblClick Event from OnClick Event?


It works with TTimer.
Thank you,
                Nemecsek
                nemec...@personal.ro
On Sat, 14 Jul 2001 21:23:55 -0400, "Bruce Roberts"
Quote
<b...@bounceitattcanada.xnet> wrote:

>"Nemecsek Gyorke" <romaup...@yahoo.com> wrote in message
>news:uhi0lt8mtk8qpqr9as7952d45eo478s9tk@4ax.com...
>> Hello,
>> I need to separate On DblClick event from OnClick event. I
>> wrote some code in "edit1click" procedure and other code in
>> "edit1dblclick" procedure. How to do, to not execute the OnClick code
>> when I dblClick the mouse?

>You can't do it nicely. The sequence of events is
>    OnClick
>    OnDblClick
>IMO its best to try and alter the design so that this distinction is not
>necessary. If that isn't possible, have the OnClick start a timer that is
>stopped by the OnDblClick. Place the OnClick code in the timer's OnTimer
>event.

Re:Can we separate OnDblClick Event from OnClick Event?


I find the "ssDouble" property, I handle in this way the DblClick
event, but the click event was also  generated(in that way how I do,
maybe in other way it works).
I try with TTimer and works,
Also thank you for suggestion,
                                Nemecsek
                                nemec...@personal.ro
On Sun, 15 Jul 2001 22:17:50 +0200, "John Randall" <h...@acenet.co.za>
wrote:
Quote
>Look up the OnMouseDown event and the ssDouble value of the TShiftState
>type.

>John Randall.

>Nemecsek Gyorke <romaup...@yahoo.com> wrote in message
>news:uhi0lt8mtk8qpqr9as7952d45eo478s9tk@4ax.com...
>> Hello,
>> I need to separate On DblClick event from OnClick event. I
>> wrote some code in "edit1click" procedure and other code in
>> "edit1dblclick" procedure. How to do, to not execute the OnClick code
>> when I dblClick the mouse?
>> Thank you,
>> Nemecsek
>> nemec...@personal.ro

Other Threads