Discussion:
AW: Two fast clicks on wxRibbonBar: only one click comes through
Tobias Abt
2014-09-05 07:15:42 UTC
Permalink
Hi,


Sorry, I forgot to mention this problem was under Windows (7) with wxWidgets 3.0.1.


Anyway, I found the cause:

1. wxWindows per default accept double clicks.

2. In this case the following events are generated: WM_LBUTTONDOWN WM_LBUTTONUP WM_LBUTTONDBLCLK WM_LBUTTONUP

(see msdn.microsoft.com/en-us/library/windows/desktop/gg153548(v=vs.85).aspx)


So the solution is pretty simple:

Add

"EVT_LEFT_DCLICK(wxRibbonButtonBar::OnMouseDown)" in ribbon\buttonbar.cpp and

"EVT_LEFT_DCLICK(wxRibbonToolBar::OnMouseDown)" in ribbon\toolbar.cpp

to the event table macro, and the RibbonBar reacts like it's expected.


Is there a chance this change is getting into the trunk?


Regards,

Tobi



Von: wx-***@googlegroups.com <mailto:wx-***@googlegroups.com> [mailto:wx-***@googlegroups.com <mailto:wx-***@googlegroups.com> ] Im Auftrag von Tobias Abt
Gesendet: Mittwoch, 20. August 2014 17:37
An: 'wx-***@googlegroups.com'
Betreff: [MASSMAIL]Two fast clicks on wxRibbonBar: only one click comes through


Hi.


Is there a way to get the wxRibbonBar to recognize fast mouse clicks?


It seems as if the ribbonbar "converts" a double click into a single click... I have some navigation buttons, for which this behavior is very annoying.

In the ribbon-demo: clicking on the buttons which write to the log only works, if the clicks are slow enough.


I looked into the event-handler of the button and the second OnMouseDown-event is never fired with two fast clicks (only the second OnMouseUp-Event, which is discarded).


Regards,

Tobi
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-09-05 12:39:08 UTC
Permalink
On Fri, 5 Sep 2014 09:15:42 +0200 Tobias Abt wrote:

TA> So the solution is pretty simple:
TA>
TA> Add
TA>
TA> "EVT_LEFT_DCLICK(wxRibbonButtonBar::OnMouseDown)" in ribbon\buttonbar.cpp and
TA>
TA> "EVT_LEFT_DCLICK(wxRibbonToolBar::OnMouseDown)" in ribbon\toolbar.cpp
TA>
TA> to the event table macro, and the RibbonBar reacts like it's expected.
TA>
TA>
TA> Is there a chance this change is getting into the trunk?

Please make a patch and post it to our Trac (please see
http://trac.wxwidgets.org/wiki/HowToSubmitPatches if you hadn't done this
before).

I don't know this code well, but I find it surprising that anything at all
happens in reaction to mouse down event. I'd expect the button to be
activated only on mouse up event, for consistency with the normal buttons.
And, of course, this would take care of the double click problem
automatically as even if the second click event is translated into a double
click by Windows, we still get two mouse up events in any case.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Tobias Abt
2014-09-12 13:17:28 UTC
Permalink
Post by Vadim Zeitlin
Please make a patch and post it to our Trac (please see
http://trac.wxwidgets.org/wiki/HowToSubmitPatches if you hadn't done
this before).
I did create a ticket with patch: http://trac.wxwidgets.org/ticket/16551
Is the ticket and patch ok so?
Post by Vadim Zeitlin
I don't know this code well, but I find it surprising that anything at all
happens in reaction to mouse down event. I'd expect the button to be
activated only on mouse up event, for consistency with the normal buttons.
And, of course, this would take care of the double click problem
automatically as even if the second click event is translated into a double
click by Windows, we still get two mouse up events in any case.
It looks like the ribbonbar matches the up-event with the down-event.
Isn't that a good idea, to react only to up-events on buttons where a down-event was before?

Regards,
Tobi
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...