Controlling tab behavior

Thanks, Nir. I was looking for a solution to that myself.

Ron

···

-----Original Message-----
From: Nir [mailto:nir_python1@digitalpeers.com]
Sent: Thursday, May 26, 2005 2:01 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Controlling tab behavior

Ok,

I found a code that does the trick. I paste it here in case it is of
interest to anyone:

     def OnKeyPressed(self, event):
         key_code = event.KeyCode()

         if key_code == wx.WXK_TAB:
             forward = not event.ShiftDown()
             ne = wx.NavigationKeyEvent()
             ne.SetDirection(forward)
             ne.SetCurrentFocus(self)
             ne.SetEventObject(self)
             self.GetParent().GetEventHandler().ProcessEvent(ne)
             event.Skip()
             return

         event.Skip()

Nir wrote:

Hi,

1. How can I control which widgets are traversed by clicking the 'tab' key?
2. How can I suppress the default behavior of the 'tab' key inside a
(read-only) StyledTextCtrl, so that clicking the 'tab' key will move
focus to the next widget?

Thanks,
Nir

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org