What am I doing wrong? According to my reading of the docs, no special
action is needed so that the tab character can be used to advance
between different TextCtrls, but tabs don't do anything in the code
fragment below -- at least not on Mac and Linux.
Brian
import wx
import sys
···
#---------------------------------------------------------------------------
class InputFrame(wx.Frame):
def __init__(self, parent, log, prefix, inputlist, calibfile):
wx.Frame.__init__(self,
parent=parent,
)
self.statbar = self.CreateStatusBar()
self.userinfo = {}
mainSizer = wx.BoxSizer(wx.VERTICAL)
# box for scan parameters
sizer = self.ScanParmsBox(self)
mainSizer.Add(sizer, 0, wx.ALIGN_CENTER, 0)
mainSizer.Fit(self)
mainSizer.Layout()
self.SetSizer(mainSizer)
self.Fit()
self.Show()
def ScanParmsBox(self, frame):
'create box for scan parameters'
box1 = wx.StaticBox(frame, -1, "Descriptive information")
sizer = wx.StaticBoxSizer(box1, wx.VERTICAL)
sizer0 = wx.FlexGridSizer(rows=2, cols=6)
sizer.Add(sizer0, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
for (widget,label,ToolTip) in [
('proposal',"Proposal Number*",
'Enter a proposal number here'),
('ESAF','ESAF Number*',
'Enter a ESAF number here'),
('sampleid',"Sample Name",
'Enter a name for the sample here'),
('chemname',"Chemical Name*",
'Enter a chemical name for the sample here'),
('formula',"Chemical Formula*",
'Enter a chemical formual for the sample here'),
('barcode', "Database ID*",
'Unique database identifier (barcode)')
]:
label = wx.StaticText(self, -1, label,
style=wx.ALIGN_CENTER)
sizer0.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 3)
if widget == 'proposal':
self.userinfo[widget] = wx.TextCtrl(self, -1,
style=wx.TE_PROCESS_ENTER)
else:
self.userinfo[widget] = wx.TextCtrl(self, -1)
self.userinfo[widget].SetToolTipString(ToolTip)
sizer0.Add(self.userinfo[widget], 0, wx.ALIGN_CENTRE|
wx.ALL, 0)
sizer0 = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(sizer0, 0, wx.ALIGN_LEFT|wx.ALL, 5)
label = wx.StaticText(self, -1, "Scan Parms*: ",
style=wx.ALIGN_CENTER)
sizer0.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 3)
for (widget,label,ToolTip) in [
('startangle',"Start",
'Enter the scan starting angle here'),
('endangle'," End",
'Enter the scan ending angle here'),
('stepsize'," Step",
'Enter the scan step size here'),
('steptime'," Step time (s)",
'Enter the scan step time here'),
('T',' Temp. (K)','Enter the measurement temperature in K
here'),
]:
label = wx.StaticText(self, -1, label,
style=wx.ALIGN_CENTER)
sizer0.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 3)
self.userinfo[widget] = wx.TextCtrl(self, -1,
size=(50,20))
self.userinfo[widget].SetToolTipString(ToolTip)
sizer0.Add(self.userinfo[widget], 0, wx.ALIGN_CENTRE|
wx.ALL, 0)
return sizer
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = InputFrame(None, sys.stdout, None, None, None)
frame.Show(True)
app.MainLoop()
--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en