def addEdit(self, title): pt = wx.Panel(self) wgt = edit(pt) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(wgt, 1, wx.ALL|wx.EXPAND, 5) pt.SetSizer(sizer) self.AddPage(pt, title) return wgt
def createEdit(self, text): box = wx.BoxSizer(wx.HORIZONTAL) label = wx.StaticText(self, -1, text) box.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5) text = edit(self, (0, 0), (self.width, -1), 0, 0) #text.SetHelpText("Here's some help text for field #1") box.Add(text, 1, wx.ALIGN_CENTRE|wx.ALL, 5) #self.sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5) self.sizer.Add(box, 0, wx.EXPAND|wx.ALL, 0) return text
def createEdit(self, x, y, w, h = 1, arg = None): """创建 编辑框(Edit) """ x = self.__GET_POS(x, w) y = self.__GET_POS_Y(y, h) if (h == 1): style = wx.TR_DEFAULT_STYLE else: style = wx.TR_DEFAULT_STYLE | wx.TE_MULTILINE #style = style | wx.TE_PROCESS_ENTER [x, y, w, h] = self.__GET_POS_SIZE(x, y, w, h) self.__GET_MAX(x, y, w, h) wdt = edit(self.panel, (x, y), (w, h), style, arg) return wdt