wxEVT_:LEFT_DOWN?

BlitzMax Forums/Brucey's Modules/wxEVT_:LEFT_DOWN?

Gabriel(Posted 2008) [#1]
How would I go about finding out what code is normally executed when a wxEVT_LEFT_DOWN event is generated? If I connect my own callback to this event, I am no longer able to generate events which require the widget to have focus, like wxEVT_MOUSEWHEEL, for example. I assume this is because the default callback for wxEVT_LEFT_DOWN tells the widget that it has focus, and can be fixed by doing that in my callback. But I'd like to know the process for finding out for sure exactly what is done. I assume the code can be found, but there's so much of it that I'm not sure where to begin looking.

The widget in question is a wxPanel, and I have already looked through wxWindow\wxWindow.bmx and wxPanel\wxPanel.bmx

Similarly, I noticed that setting a wxEVT_LEFT_UP for the canvas stops me opening a file dialog with Dialog.ShowModal() for some reason. So presumably something is happening in the LEFT_UP callback which I'm not replicating too. Perhaps something which makes the canvas give up the focus or which gives the main window back the focus. But without being able to find the code, I can't tell.


Brucey(Posted 2008) [#2]
If you want the intercepted event to also carry on down to the control/window, you should call event.Skip() in your callback, otherwise, everything stops in your callback - ie. no further propagation.


Gabriel(Posted 2008) [#3]
Thanks, but I've tried that, and it doesn't help me. Well, that is to say it works for LEFT_DOWN but not for LEFT_UP.

If I set any callback for LEFT_UP, then I am not able to open a file dialog with ShowModal(). Specifically, it just returns WX_CANCEL without any dialog box ever being shown.

EDIT: Ok, I think I fixed it now, although I'm unsure why. I changed the file dialog so that it was parented to a panel instead of the frame, and it works. I'm not sure how that ties in with the LEFT_UP event on a canvas though.


DavidDC(Posted 2008) [#4]
Not sure if this would help in this case but wxSTAY_ON_TOP for dialogs is sometimes needed.


Gabriel(Posted 2008) [#5]
Thanks, but that doesn't do it either. I've found something else which causes it too, but it's completely bizarre. If I add more than 11 categories to a PropertyGrid, the filedialog will no longer show up. With 11, it's fine, with 12, it breaks the filedialog, which just makes no sense to me at all.


DavidDC(Posted 2008) [#6]
Are you using glCanvas Gabriel? I experienced some pretty bizarre problems when I was using a) more than 1 glCanvas and b) glCanvas within a dialog. I've also seen a glCanvas repaint attempt to jump in front of a popupmenu dialog. These problems varied from computer to computer and may have been graphics driver related.


Gabriel(Posted 2008) [#7]
No, but I am using TrueVision3D on a wxWindow. I've tried parenting the dialog to the same panel that the wxWindow is on, but I've also tried parenting it to the frame and indeed to null but all sorts of completely random events seem to affect whether it ever shows or not.

I'm pretty sure it's not popping up and vanishing, because program flow does not stop. The dialog is returning wxCancel or whatever to indicate that it's finished acting. I can only assume that it's sending wxCancel because it believes it cannot open for some reason, but I have no idea why that would be. 12 categories in a property grid instead of 11 is not, to me, a valid reason, but that's definitely one example of something which stops it from popping up.

Still, if the GLCanvas does weird stuff too, there might be a connection. I'll see if I can't rearrange the location of this window somehow and maybe I'll make a difference.


DavidDC(Posted 2008) [#8]
Post your file dialog creation code? Have you got file dialog to work OK in isolation?