TAB Traversal

Hi list,

I have troubles getting wxTAB_TRAVERSAL to work. Included is a sample of
a file where it does not work. As you can see, it is generated by BOA.
(I only included the frame in the app to make it simpler).

Obviously I am doing something wrong here, but I _can't_ seem to find
out what...

I hope you can help me.

Kind regards,
Dick Kniep

////------ snip -----////

#!/usr/bin/env python
#Boa:App:BoaApp

from wxPython.wx import *

modules ={'TestFrame': [0, '', 'TestFrame.py'],
'wxFrame1': [1,
              'Main frame of Application',
              '../../../../../../../../../../wxFrame1.py']}

class BoaApp(wxApp):
    def OnInit(self):
        wxInitAllImageHandlers()
        self.main = wxFrame2(None)
        # needed when running from Boa under Windows 9X
        self.main.Show();self.main.Hide();self.main.Show()
        self.SetTopWindow(self.main)
        return true
    
[wxID_WXFRAME2, wxID_WXFRAME2TEXTCTRL1, wxID_WXFRAME2TEXTCTRL2,
wxID_WXFRAME2TEXTCTRL3,
] = map(lambda _init_ctrls: wxNewId(), range(4))

class wxFrame2(wxFrame):
    def _init_utils(self):
        # generated method, don't edit
        pass

    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wxFrame.__init__(self, id=wxID_WXFRAME2, name='', parent=prnt,
              pos=wxPoint(350, 237), size=wxSize(933, 633),
              style=wxTAB_TRAVERSAL | wxDEFAULT_FRAME_STYLE,
title='wxFrame2')
        self._init_utils()
        self.SetClientSize(wxSize(933, 633))

        self.textCtrl1 = wxTextCtrl(id=wxID_WXFRAME2TEXTCTRL1,
name='textCtrl1',
              parent=self, pos=wxPoint(224, 96), size=wxSize(80, 22),
style=0,
              value='textCtrl1')

        self.textCtrl2 = wxTextCtrl(id=wxID_WXFRAME2TEXTCTRL2,
name='textCtrl2',
              parent=self, pos=wxPoint(248, 288), size=wxSize(80, 22),
style=0,
              value='textCtrl2')

        self.textCtrl3 = wxTextCtrl(id=wxID_WXFRAME2TEXTCTRL3,
name='textCtrl3',
              parent=self, pos=wxPoint(576, 176), size=wxSize(80, 22),
style=0,
              value='textCtrl3')

    def __init__(self, parent):
        self._init_ctrls(parent)

def main():
    application = BoaApp(0)
    application.MainLoop()

if __name__ == '__main__':
    main()

I have troubles getting wxTAB_TRAVERSAL to work. Included is a sample of
a file where it does not work.

I tried this on Windows XP and it works fine. The tab key and shift-tab
change the focus as expected.
-Rick King

Rick King wrote:

I have troubles getting wxTAB_TRAVERSAL to work. Included is a sample of
a file where it does not work.
   
I tried this on Windows XP and it works fine. The tab key and shift-tab
change the focus as expected.
-Rick King

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

It worked fine for me with IDLE on XP.

Jorge Hojyo

Dick Kniep wrote:

Hi list,

I have troubles getting wxTAB_TRAVERSAL to work. Included is a sample of
a file where it does not work. As you can see, it is generated by BOA.
(I only included the frame in the app to make it simpler).

Obviously I am doing something wrong here, but I _can't_ seem to find
out what...

Put your controls on a wxPanel, and then put the panel in the wxFrame.

···

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

Hi Robin,

I am a bit confused. wxFrame is derived from wxWindows, and the controls
are those of wxWindows. So I figured, I could use the wxWindows style
also on the wxFrame. Why is this, and why is it working on Windoz? Or is
it a bug?

Thanks for the help

Kind regards,
Dick Kniep

···

On Fri, 2003-05-23 at 18:14, Robin Dunn wrote:

Dick Kniep wrote:
> Hi list,
>
> I have troubles getting wxTAB_TRAVERSAL to work. Included is a sample of
> a file where it does not work. As you can see, it is generated by BOA.
> (I only included the frame in the app to make it simpler).
>
> Obviously I am doing something wrong here, but I _can't_ seem to find
> out what...
>

Put your controls on a wxPanel, and then put the panel in the wxFrame.

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

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

Dick Kniep wrote:

Hi Robin,

I am a bit confused. wxFrame is derived from wxWindows, and the controls
are those of wxWindows. So I figured, I could use the wxWindows style
also on the wxFrame. Why is this, and why is it working on Windoz? Or is
it a bug?

Not all window types honor all style flags. wxPanel is made for containing controls and implementing tab traversal between them. wxFrame is made for being a top-level window (interacting with the window manager or equivallent) optionally hosting a menubar, toolbar and statusbar and containing other windows.

···

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