[wxPython-users] RE: SpinCtrl and forward tab-cycle

mawe mawe at typeofundefined.com
Wed Jan 2 13:31:51 PST 2008


Mike, thanks for the reply.

You're right, it's just that the demo is using a Panel instead of a BoxSizer.

Strange enough that it works if I cycle backwards through the widgets (SHIFT + TAB).

Regards,
Matthias

Mike Driscoll schrieb:
> Matthias, 
> 
>> -----Original Message-----
>> From: mawe [mailto:mawe at typeofundefined.com] 
>> Sent: Tuesday, January 01, 2008 7:11 PM
>> To: wxPython-users at lists.wxwidgets.org
>> Subject: SpinCtrl and forward tab-cycle
>>
>> Hello there list,
>>
>> I noticed that it's not possible to tab-cycle forward when 
>> using the code below. It however works fine in the wxPython 
>> demos when I add some more widgets to it.
>>
>> What's wrong with the code below?
>>
>> Regards,
>> Matthias
>>
>> Code:
>>
>> import wx
>>
>> class TestFrame(wx.Frame):
>>     def __init__(self, parent, ID, title, style):
>>         wx.Frame.__init__(self, parent, ID, title, size=(300, 
>> 250), style=style)
>>
>>         self.box = wx.BoxSizer(wx.VERTICAL)
>>
>>         self.TelephoneText = wx.TextCtrl(self, -1, "", size=(200, -1))
>>         self.NumberPackagesText = wx.SpinCtrl(self, -1)
>>         self.TelephoneText11 = wx.TextCtrl(self, -1, 
>> "Blablabla", size=(150, -1))
>>         self.DeliveryDateText = wx.DatePickerCtrl(self, 
>> size=(100,-1),style=wx.DP_DROPDOWN | wx.DP_SHOWCENTURY)
>>
>>         self.box.Add(self.TelephoneText)
>>         self.box.Add(self.NumberPackagesText)
>>         self.box.Add(self.TelephoneText11)
>>         self.box.Add(self.DeliveryDateText)
>>
>>         self.SetAutoLayout(True)
>>         self.SetSizer(self.box)
>>         self.Layout()
>>
>> app = wx.PySimpleApp()
>> frame = TestFrame(None, -1, "Test app", wx.MINIMIZE_BOX | 
>> wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.CLIP_CHILDREN 
>> | wx.TAB_TRAVERSAL)
>> frame.Show()
>> app.MainLoop()
>>
> 
> 
> The difference between your code and the demo code is that the demo puts
> its widgets on a panel and you do not. I added a panel to your code and
> then added the widgets to the panel and it worked.
> 
> Give it a whirl and see for yourself.
> 
> Mike




More information about the wxpython-users mailing list