def build(self, parent, data, choices=None): self.widget = wx.TextCtrl(parent, style=wx.TE_PASSWORD) dt = FileDrop(self.widget) self.widget.SetDropTarget(dt) self.widget.SetMinSize((0, -1)) self.widget.SetDoubleBuffered(True) self.widget.AppendText('') return self.widget
def build(self, parent, data): self.option_string = data['commands'][0] if data['commands'] else '' self.widget = wx.TextCtrl(parent) dt = FileDrop(self.widget) self.widget.SetDropTarget(dt) self.widget.SetMinSize((0, -1)) self.widget.SetDoubleBuffered(True) return self.widget
def build(self, parent, data): self.option_string = self.get_command(data) self.widget = wx.TextCtrl(parent) dt = FileDrop(self.widget) self.widget.SetDropTarget(dt) self.widget.SetMinSize((0, -1)) self.widget.SetDoubleBuffered(True) self.widget.AppendText(safe_default(data, '')) return self.widget
def __init__(self, parent, *args, **kwargs): super(TextInput, self).__init__(parent) self.widget = wx.TextCtrl(self, *args, **kwargs) dt = FileDrop(self.widget) self.widget.SetDropTarget(dt) self.widget.SetMinSize((0, -1)) self.widget.SetDoubleBuffered(True) self.widget.AppendText('') self.layout()
def __init__(self, parent, *args, **kwargs): super(Chooser, self).__init__(parent) self.options = parent._options buttonLabel = kwargs.pop('label', _('browse')) self.widget = TextInput(self, *args, **kwargs) self.button = wx.Button(self, label=buttonLabel) self.button.Bind(wx.EVT_BUTTON, self.spawnDialog) self.dropTarget = FileDrop(self.widget, self.dropHandler) self.widget.SetDropTarget(self.dropTarget) self.layout()
def build(self, parent, data): self.parent = parent self.option_string = self.get_command(data) self.text_box = wx.TextCtrl(self.parent) self.text_box.AppendText(safe_default(data, '')) self.text_box.SetMinSize((0, -1)) dt = FileDrop(self.text_box) self.text_box.SetDropTarget(dt) self.button = wx.Button(self.parent, label=self.button_text, size=(73, 23)) widget_sizer = wx.BoxSizer(wx.HORIZONTAL) widget_sizer.Add(self.text_box, 1, wx.EXPAND) widget_sizer.AddSpacer(10) widget_sizer.Add(self.button, 0) parent.Bind(wx.EVT_BUTTON, self.onButton, self.button) return widget_sizer
def build(self, parent, data, choices=None): self.parent = parent self.widget = wx.TextCtrl(self.parent) self.widget.AppendText('') self.widget.SetMinSize((0, -1)) dt = FileDrop(self.widget) self.widget.SetDropTarget(dt) self.button = wx.Button(self.parent, label=self.button_text, size=(73, 23)) widget_sizer = wx.BoxSizer(wx.HORIZONTAL) widget_sizer.Add(self.widget, 1, wx.EXPAND) widget_sizer.AddSpacer(10) widget_sizer.Add(self.button, 0, wx.ALIGN_CENTER_VERTICAL) parent.Bind(wx.EVT_BUTTON, self.on_button, self.button) return widget_sizer
def build(self, parent, data=None): self.parent = parent self.option_string = data['commands'][0] if data['commands'] else '' self.text_box = wx.TextCtrl(self.parent) self.text_box.SetMinSize((0, -1)) dt = FileDrop(self.text_box) self.text_box.SetDropTarget(dt) self.button = wx.Button(self.parent, label=self.button_text, size=(73, 23)) widget_sizer = wx.BoxSizer(wx.HORIZONTAL) widget_sizer.Add(self.text_box, 1, wx.EXPAND) widget_sizer.AddSpacer(10) widget_sizer.Add(self.button, 0) parent.Bind(wx.EVT_BUTTON, self.onButton, self.button) return widget_sizer