Page 1 of 1

wxMac mouse events problems

Posted: Sun Feb 11, 2007 11:16 am
by oplayez
I'm porting my game to wxWidgets 2.8.0, it works on Win32 and X11 but on MacOSX 10.4.8, I don't receive EVT_LEFT_UP and EVT_RIGHT_UP events. I had to make the following changes to get mouse events :


#ifdef __WXMAC__
EVT_MOUSE_EVENTS(MyFrame::OnMouseEvent)
#else
EVT_LEFT_UP(MyFrame::OnMouseLeftUp)
EVT_RIGHT_UP(MyFrame::OnMouseRightUp)
#endif



void MyFrame::OnMouseEvent(wxMouseEvent& event)
{
if (event.LeftUp())
OnMouseLeftUp(event);
if (event.RightUp())
OnMouseRightUp(event);
}


is it normal ?

Posted: Sun Feb 11, 2007 2:57 pm
by Auria
On my wxMac 2.8.0 i do get these events correctly - can you post more of the code?

Posted: Sun Feb 11, 2007 4:42 pm
by oplayez
I created a child wxWindow, and now I receive the EVT_LEFT_UP and EVT_RIGHT_UP events. But on the parent window, I have to do as explained in the first post.

Do you use a child window ? (or wxGLCanvas)

Posted: Sun Feb 11, 2007 5:06 pm
by Auria
oplayez wrote:I created a child wxWindow, and now I receive the EVT_LEFT_UP and EVT_RIGHT_UP events. But on the parent window, I have to do as explained in the first post.

Do you use a child window ? (or wxGLCanvas)
Now i do it on a wxGLCanvas, but iirc i've already done it on wxFrames too

once i got a similar error, and it was because 2 components were set to catch the same mouse event

if not, we'll need code to help further :D

Posted: Mon Feb 12, 2007 3:28 pm
by oplayez
I modified the minimal sample to show my problem (no mouse click events in the parent window).

uncomment
//#define SND_WND
to set up a child window, and you will receive the mouse click events.

I never receive the SetFocus and KillFocus events (in the parent or child window). Any idea ?

Posted: Tue Feb 13, 2007 12:17 am
by Auria
Very funny... Mouse clicks are not detected, however focus events are sent to "MyFrame::OnMouseLeftUp" !!

This really seems to be a bug

Posted: Tue Feb 13, 2007 3:04 pm
by oplayez
I tried to do as advised here (use Connect() instread of macro) :
http://wxwidgets.blogspot.com/2007/01/i ... nnect.html

But it doesn't change anything.

Should I report this as a bug on
http://sourceforge.net/tracker/?group_i ... tid=109863
?

Posted: Tue Feb 13, 2007 11:58 pm
by Auria
oplayez wrote: Should I report this as a bug on
http://sourceforge.net/tracker/?group_i ... tid=109863
?
Unless someone knows something i don't, i guess so ;)

good luck

Posted: Mon Feb 19, 2007 12:48 pm
by oplayez