LeftIsDown() on wxEVT_LEFT_DOWN event?

Alex Bligh alex at alex.org.uk
Mon Aug 14 04:30:34 PDT 2006



--On 14 August 2006 04:18 -0700 Christian Walther <walther at indel.ch> wrote:

>
> What's the return value of LeftIsDown() being called on a
> wxEVT_LEFT_DOWN mouse event supposed to be?
>
> The section about wxMouseEvent::LeftIsDown in the documentation says
> "... Rather, it describes the state of the mouse button *before* the
> event happened." (emphasis mine), which would imply that the returned
> value should be false.
>
> What I observe on wxMSW 2.6.3 and wxMac 2.6.3 is that it returns true,
> i.e. the state *after* the event happened.
>
> Who is right?

I read "before" as meaning "immediately before the event is generated" as
opposed to "causing the event to be generated". So, if there was a left
button down event, but (because the application was not yield()ing for a
while), the left button event was not processed before the button was
released, then LeftDown() would return true, but IsLeftDown() would return
false.

I believe that's the intention. I think however that there is an unintended
wrinkle, which is that the position passed on the event (on GTK anyway)
is not actually the position the mouse was at when the left down happened
(which you would expect), but the current mouse position (certainly
on mouse up events). I haven't had time to look into that though.

Alex




More information about the wx-users mailing list