2012-04-28 105 views
0

我有一個窗口包含不同種類的控件。WxPython在使用標籤按鈕的控件之間切換

class FindReplaceWindow(wx.MiniFrame): 
    def __init__(self, parent): 
    Style = wx.DEFAULT_MINIFRAME_STYLE|wx.SYSTEM_MENU|wx.CLOSE_BOX 
    super(FindReplaceWindow, self).__init__(parent, -1, 'Find and Replace', style = Style) 
    self.BackgroundColour = wx.WHITE 
    self.MaxSize = wx.Size(400,300) 
    self.MinSize = self.MaxSize 
    self.CenterOnParent() 
    self.LabelFind = wx.StaticText(self, label = 'Find') 
    self.LabelReplace = wx.StaticText(self, label = 'Replace') 
    self.LabelTransparency = wx.StaticText(self, label = 'Transparency') 
    self.TextFind = wx.TextCtrl(self, size = (350,20), style = wx.TE_PROCESS_TAB) 
    self.TextReplace = wx.TextCtrl(self, size = (350,20), style = wx.TE_PROCESS_TAB) 
    self.SearchDirection = wx.RadioBox(self, -1, 'Search Direction', 
    size = (110,-1), choices = ('Up','Down'), style = wx.RA_VERTICAL) 
    self.SearchMode = wx.RadioBox(self, -1, 'Search Mode', 
    size = (110, -1), choices = ('Text','Regex'), style = wx.RA_VERTICAL) 
    self.Flags = wx.CheckListBox(self, -1, wx.DefaultPosition, 
    (95,-1), ('Ignore Case','Whole Word(s)','Selection Only'), wx.VERTICAL) 
    self.ButtonFind = wx.Button(self, wx.ID_FIND, 'Find') 
    self.ButtonReplace = wx.Button(self, wx.ID_REPLACE, 'Replace') 
    self.ButtonReplaceAll = wx.Button(self, wx.ID_REPLACE_ALL, 'Replace All') 

如何使用Tab鍵切換它們?

回答