WARNING: This server is unstable and will be retired in the next days.
If you want to keep this forum available, please request immediately a migration
on the Nabble Support forum.
Forums that don't receive any migration request will be deleted forever.
> But it's true that it would be even better if it could be done
> automatically. And for this we indeed need to ask the focused window (and
> its parents) if it needs to intercept the key event even before
> A> And it needs some method to decide that. (what I proposed
> A> earlier are such methods).
> Yes, I didn't like them because they were too specific but something
> generic along the same lines (e.g. a virtual NeedsKey() method) could do
How about this:
1 - We have a function wxKeyEvent::EmitNextKeyEvent()
2 - EVT_CHAR_HOOK is sent to to the active (focused) child window
3 - If not handled it propagates to its parent (up to first TLW).
and in wxListCtrl and wxTreeCtrl we make a handler for EVT_CHAR_HOOK
that calls EmitNextKeyEvent() for the particular case of WXK_ESCAPE
and having a popup edit control open.
There doesn't seem to be a wxListCtrlBase class, so a few files have
to be modified.
What wxEvent flag must be set to propagate just up to first TLW?
> A> Not being an API function it doesn't matter much to me.
> It's certainly part of wx API so it would be nice if it worked... As the
> comment there says, normally sending WM_CANCELMODE should do the trick but
> it didn't do it for me. Maybe you should try changing the code to do it.
Nope, just checked listctrl.h and it's not in there. It's only defined
and used in the MSW case. It is part of treectrl.h though.