Mouse button up events don't seem to work

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
philrosenberg
Knows some wx things
Knows some wx things
Posts: 40
Joined: Mon Jun 09, 2008 9:59 pm

Mouse button up events don't seem to work

Post by philrosenberg »

Hi
I'm trying to click and drag a rectangular selection area on a wxFrame, but I don't seem able to capture the mouse button release.

I have tried using EVT_MOUSE_EVENTS and EVT_LEFT_UP, but neither seem to capture the button release. How do I do this?

Phil
User avatar
doublemax
Moderator
Moderator
Posts: 19163
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Mouse button up events don't seem to work

Post by doublemax »

I assume there's a wxPanel on the wxFrame? Mouse events don't propagate upwards in the window hierarchy, so you have to catch them in the window you actually click on.
Use the source, Luke!
philrosenberg
Knows some wx things
Knows some wx things
Posts: 40
Joined: Mon Jun 09, 2008 9:59 pm

Re: Mouse button up events don't seem to work

Post by philrosenberg »

Actually I was just rendering directly to the wxFrame. Perhaps this is the problem?
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2409
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: Mouse button up events don't seem to work

Post by evstevemd »

philrosenberg wrote:Actually I was just rendering directly to the wxFrame. Perhaps this is the problem?
Explaining what you are attempting with minimal code helps a lot.

That being said, do you have any child on wxFrame? Can you add wxPanel to wxFrame and catch events in wxPanel?
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Post Reply