|
|
|
|
Re: MouseDoubleClick event [message #445276 is a reply to message #445263] |
Mon, 01 November 2004 14:37 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
Waiting is the right thing to do, even if you were a native MFC application.
The issue is that in a mouse down, you have no way of knowing whether there
is another mouse down coming that will cause a double select, other than
waiting for it. Investigate Display.addTimer() instead of spawning a
thread. Be warned that widgetDefaultSelected() can come from the keyboard
as well as from the mouse, depending on the platform.
"Robert Bacs" <boby@zerosoft.ro> wrote in message
news:cm2rjc$afb$1@eclipse.org...
> Hi,
>
> I have a list control with a SelectionListener attached to it. The problem
> is that when I double-click an item in the list first is called the
> widgetSelected() method and then the widgetDefaultSelected() method. I
need
> to filter the widgetSelected method invocation, how can I do that ?
> I know that is this system specific event generation, ex. Win32:
> "Double-clicking the left mouse button actually generates a sequence of
four
> messages: WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, and
WM_LBUTTONUP.
> "
> But is there a method to avoid this ?
>
> The only solution I found for this is to make a thread when Selection
event
> is generated and sleep this thread for doubleClickTime amount (a little
bit
> more) and if the DefaultSelection event still not arrived consider that
was
> a Selection event (only mouse down).
> Is there another solution for this ?
>
> Best regards,
> Boby
>
>
|
|
|
Re: MouseDoubleClick event [message #445289 is a reply to message #445276] |
Mon, 01 November 2004 16:54 |
Robert Bacs Messages: 165 Registered: July 2009 |
Senior Member |
|
|
Hi,
Do you mean Display.timerExec() ?
I don't see any addTimer() method in Display class.
Yes, it's much better to execute in the user-interface thread than spawning
a new thread but I tried in an asyncExec() - didn't work and I missed the
timerExec() :).
Thanks and regards,
Boby
"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:cm5hn8$int$1@eclipse.org...
> Waiting is the right thing to do, even if you were a native MFC
application.
> The issue is that in a mouse down, you have no way of knowing whether
there
> is another mouse down coming that will cause a double select, other than
> waiting for it. Investigate Display.addTimer() instead of spawning a
> thread. Be warned that widgetDefaultSelected() can come from the keyboard
> as well as from the mouse, depending on the platform.
>
> "Robert Bacs" <boby@zerosoft.ro> wrote in message
> news:cm2rjc$afb$1@eclipse.org...
> > Hi,
> >
> > I have a list control with a SelectionListener attached to it. The
problem
> > is that when I double-click an item in the list first is called the
> > widgetSelected() method and then the widgetDefaultSelected() method. I
> need
> > to filter the widgetSelected method invocation, how can I do that ?
> > I know that is this system specific event generation, ex. Win32:
> > "Double-clicking the left mouse button actually generates a sequence of
> four
> > messages: WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, and
> WM_LBUTTONUP.
> > "
> > But is there a method to avoid this ?
> >
> > The only solution I found for this is to make a thread when Selection
> event
> > is generated and sleep this thread for doubleClickTime amount (a little
> bit
> > more) and if the DefaultSelection event still not arrived consider that
> was
> > a Selection event (only mouse down).
> > Is there another solution for this ?
> >
> > Best regards,
> > Boby
> >
> >
>
>
|
|
|
Re: MouseDoubleClick event [message #445327 is a reply to message #445289] |
Tue, 02 November 2004 15:24 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
Yup, I meant Display.timerExec().
"Robert Bacs" <boby@zerosoft.ro> wrote in message
news:cm5pnc$34s$1@eclipse.org...
> Hi,
>
> Do you mean Display.timerExec() ?
> I don't see any addTimer() method in Display class.
>
> Yes, it's much better to execute in the user-interface thread than
spawning
> a new thread but I tried in an asyncExec() - didn't work and I missed the
> timerExec() :).
>
> Thanks and regards,
> Boby
>
>
>
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:cm5hn8$int$1@eclipse.org...
> > Waiting is the right thing to do, even if you were a native MFC
> application.
> > The issue is that in a mouse down, you have no way of knowing whether
> there
> > is another mouse down coming that will cause a double select, other than
> > waiting for it. Investigate Display.addTimer() instead of spawning a
> > thread. Be warned that widgetDefaultSelected() can come from the
keyboard
> > as well as from the mouse, depending on the platform.
> >
> > "Robert Bacs" <boby@zerosoft.ro> wrote in message
> > news:cm2rjc$afb$1@eclipse.org...
> > > Hi,
> > >
> > > I have a list control with a SelectionListener attached to it. The
> problem
> > > is that when I double-click an item in the list first is called the
> > > widgetSelected() method and then the widgetDefaultSelected() method. I
> > need
> > > to filter the widgetSelected method invocation, how can I do that ?
> > > I know that is this system specific event generation, ex. Win32:
> > > "Double-clicking the left mouse button actually generates a sequence
of
> > four
> > > messages: WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, and
> > WM_LBUTTONUP.
> > > "
> > > But is there a method to avoid this ?
> > >
> > > The only solution I found for this is to make a thread when Selection
> > event
> > > is generated and sleep this thread for doubleClickTime amount (a
little
> > bit
> > > more) and if the DefaultSelection event still not arrived consider
that
> > was
> > > a Selection event (only mouse down).
> > > Is there another solution for this ?
> > >
> > > Best regards,
> > > Boby
> > >
> > >
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04739 seconds