[wxPython] Navigation in dialog

Hello,

wxDialog automatically traverses between controls, while pressing TAB key.

Is there a possibility to exclude some controls from the tabbing cycle (so they are skipped)?

Thank you, Tomas Cerha

···

--
PGP keyID: 0x0C441CA3
work phone: +420 2 24917311 (l. 33)

--

Intellectual property has been driving the species for some five million
years. In the past 100 or so years, it's increasingly been saddled with
the chore of lining the pockets of middlemen and parasites who, sans
this lining, would lack sufficient intellect to open a can of beer.

                                                   - Tom Matrullo

wxDialog automatically traverses between controls, while pressing TAB key.

Is there a possibility to exclude some controls from the tabbing cycle
(so they are skipped)?

I think the only way is to disable them (call Enable(false).)

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

Robin Dunn wrote:

wxDialog automatically traverses between controls, while pressing TAB key.

Is there a possibility to exclude some controls from the tabbing cycle
(so they are skipped)?

I think the only way is to disable them (call Enable(false).)

Yes, but this is not, what I need, so I tryed to hack it. For the case someone else could find it interesting, I'll try to describe:

I catch the wxNavigationKeyEvent for the control, which I want to be skipped and then I create a new wxNavigationKeyEvent and get it processed by parent wxDialog.

···

-----------------
  # I create a wxButton, which I want to be skipped
         ....
         # Then I assign it this event handler
         wx.EVT_NAVIGATION_KEY(button, self._skip_navigation)
         ....

     def _skip_navigation(self, event):
         # This is based on Robin Dunn's example, which I found
         # somwhere in this mailing list...
         nav = wx.wxNavigationKeyEvent()
         nav.SetDirection(event.GetDirection())
         nav.SetEventObject(event.GetEventObject())
         nav.SetCurrentFocus(self._parent) # self._parent is wxDialog
         self._parent.GetEventHandler().ProcessEvent(nav)
-----------------

best regards, Tom Cerha.

--
PGP keyID: 0x0C441CA3
work phone: +420 2 24917311 (l. 33)

--

Intellectual property has been driving the species for some five million
years. In the past 100 or so years, it's increasingly been saddled with
the chore of lining the pockets of middlemen and parasites who, sans
this lining, would lack sufficient intellect to open a can of beer.

                                                   - Tom Matrullo

> I think the only way is to disable them (call Enable(false).)
>

Yes, but this is not, what I need, so I tryed to hack it. For the case
someone else could find it interesting, I'll try to describe:

I catch the wxNavigationKeyEvent for the control, which I want to be
skipped and then I create a new wxNavigationKeyEvent and get it
processed by parent wxDialog.

Good idea. I had forgotten about this.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!