Browse Source

copy-pasta textarea component

pull/167/head
chriskiehl 8 years ago
parent
commit
a4d69b5f56
2 changed files with 20 additions and 0 deletions
  1. 1
      gooey/gui/widgets/components.py
  2. 19
      gooey/gui/widgets/widget_pack.py

1
gooey/gui/widgets/components.py

@ -229,6 +229,7 @@ DirChooser = build_subclass('DirChooser', widget_pack.DirChooserPayload)
FileSaver = build_subclass('FileSaver', widget_pack.FileSaverPayload)
DateChooser = build_subclass('DateChooser', widget_pack.DateChooserPayload)
TextField = build_subclass('TextField', widget_pack.TextInputPayload)
Textarea = build_subclass('TextField', widget_pack.TextAreaPayload)
CommandField = build_subclass('CommandField', widget_pack.TextInputPayload(no_quoting=True))
Dropdown = build_subclass('Dropdown', widget_pack.DropdownPayload)
Counter = build_subclass('Counter', widget_pack.CounterPayload)

19
gooey/gui/widgets/widget_pack.py

@ -131,6 +131,25 @@ class TextInputPayload(WidgetPack):
def get_value(self):
return self.widget.GetValue()
class TextAreaPayload(WidgetPack):
def __init__(self, no_quoting=False):
self.widget = None
self.option_string = None
self.no_quoting = no_quoting
def build(self, parent, data, choices=None):
self.widget = wx.TextCtrl(parent, style=wx.TE_MULTILINE)
dt = FileDrop(self.widget)
self.widget.SetDropTarget(dt)
self.widget.SetMinSize((0, -1))
self.widget.SetDoubleBuffered(True)
self.widget.AppendText('')
return self.widget
def get_value(self):
return self.widget.GetValue()
class DropdownPayload(WidgetPack):
default_value = 'Select Option'

Loading…
Cancel
Save