panel (wxPanel) keyboard (arrow) focus

James Bigler bigler at cs.utah.edu
Mon Nov 6 07:25:08 PST 2006


I have a class that derives from a wxPanel that then contains an OSG 
Producer window.  In my frame I also have a wxNotebook with a wxTreeCtrl 
inside.

In my wxPanel can get mouse events just fine, and I can get simple 
character events, but I seem to be unable to get keyboard arrow events. 
  The wxTreeCtrl seems to steal them away.

wxWidgets (wxMSW): 2.6.3
OS: WinXP
Compiler: VS Express 2005

Here are some things I tried:

Inside my OnEnterWindow function I call this->SetFocus().  This doesn't 
seem to help.

I added OnSetFocus and OnKillFocus event handlers, and I noticed that if 
my panel has focus, pressing an arrow key causes my panel to lose focus 
and it goes to the wxTreeCtrl.  How can I keep the arrow keys on my panel?

Thanks,
James




More information about the wx-users mailing list