wxMac mouse events problems Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
oplayez
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sun Feb 11, 2007 11:11 am
Contact:

wxMac mouse events problems

Post 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 ?
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

On my wxMac 2.8.0 i do get these events correctly - can you post more of the code?
oplayez
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sun Feb 11, 2007 11:11 am
Contact:

Post 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)
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post 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
oplayez
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sun Feb 11, 2007 11:11 am
Contact:

Post 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 ?
Attachments
minimal.cpp
(8.7 KiB) Downloaded 90 times
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

Very funny... Mouse clicks are not detected, however focus events are sent to "MyFrame::OnMouseLeftUp" !!

This really seems to be a bug
oplayez
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sun Feb 11, 2007 11:11 am
Contact:

Post 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
?
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post 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
oplayez
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sun Feb 11, 2007 11:11 am
Contact:

Post by oplayez »

Post Reply