Beispiel #1
0
    msg = self.help_msgs[0]
    container_width, _ = self.panel.Size
    text_width, _ = msg.Size

    if text_width != container_width:
      msg.SetLabel(msg.GetLabelText().replace('\n', ' '))
      msg.Wrap(container_width)
    evt.Skip()

  def GetValue(self):
    vals = [button.GetValue() for button in self.radio_buttons]
    try:
      return self.option_stings[vals.index(True)][0]
    except:
      return ''

  def _GetWidget(self):
    return self.radio_buttons


FileChooser       = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.FileChooserPayload())
MultiFileChooser  = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.MultiFileSaverPayload())
DirChooser        = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.DirChooserPayload())
FileSaver         = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.FileSaverPayload())
DateChooser       = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.DateChooserPayload())
TextField         = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.TextInputPayload())
Dropdown          = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.DropdownPayload())
Counter           = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.CounterPayload())
MultiDirChooser   = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.MultiDirChooserPayload())

Beispiel #2
0
    def GetValue(self):
        vals = [button.GetValue() for button in self.radio_buttons]
        try:
            return self.option_stings[vals.index(True)][0]
        except:
            return ''

    def _GetWidget(self):
        return self.radio_buttons


FileChooser = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.FileChooserPayload())
MultiFileChooser = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.MultiFileSaverPayload())
DirChooser = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.DirChooserPayload())
FileSaver = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.FileSaverPayload())
DateChooser = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.DateChooserPayload())
TextField = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.TextInputPayload())
Dropdown = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.DropdownPayload())
Counter = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.CounterPayload())
MultiDirChooser = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.MultiDirChooserPayload())
Beispiel #3
0
            msg.SetLabel(msg.GetLabelText().replace('\n', ' '))
            msg.Wrap(container_width)
        evt.Skip()

    def get_value(self):
        return [button.GetValue() for button in self.radio_buttons]

    def set_value(self, val):
        pass


def build_subclass(name, widget_class):
    # this seemed faster than typing class X a bunch
    return type(name, (BaseGuiComponent, ), {'widget_class': widget_class})


FileChooser = build_subclass('FileChooser', widget_pack.FileChooserPayload)
MultiFileChooser = build_subclass('MultiFileChooser',
                                  widget_pack.MultiFileSaverPayload)
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)
MultiDirChooser = build_subclass('MultiDirChooser',
                                 widget_pack.MultiDirChooserPayload)
Beispiel #4
0
    if text_width != container_width:
      msg.SetLabel(msg.GetLabelText().replace('\n', ' '))
      msg.Wrap(container_width)
    evt.Skip()

  def GetValue(self):
    vals = [button.GetValue() for button in self.radio_buttons]
    try:
      return self.option_strings[vals.index(True)][0]
    except:
      return ''

  def HasOptionString(self):
    return bool(self.option_strings)

  def _GetWidget(self):
    return self.radio_buttons


FileChooser       = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.FileChooserPayload())
MultiFileChooser  = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.MultiFileSaverPayload())
DirChooser        = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.DirChooserPayload())
FileSaver         = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.FileSaverPayload())
DateChooser       = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.DateChooserPayload())
TextField         = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.TextInputPayload())
CommandField      = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.TextInputPayload(no_qouting=True))
Dropdown          = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.DropdownPayload())
Counter           = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.CounterPayload())
MultiDirChooser   = lambda data: BaseGuiComponent(data=data, widget_pack=widget_pack.MultiDirChooserPayload())

Beispiel #5
0
        except:
            return ''

    def HasOptionString(self):
        return bool(self.option_strings)

    def _GetWidget(self):
        return self.radio_buttons


FileChooser = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.FileChooserPayload())
MultiFileChooser = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.MultiFileSaverPayload())
DirChooser = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.DirChooserPayload())
FileSaver = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.FileSaverPayload())
DateChooser = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.DateChooserPayload())
TextField = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.TextInputPayload())
CommandField = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.TextInputPayload(no_quoting=True))
Dropdown = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.DropdownPayload())
Counter = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.CounterPayload())
MultiDirChooser = lambda data: BaseGuiComponent(
    data=data, widget_pack=widget_pack.MultiDirChooserPayload())
Beispiel #6
0

class Listbox(BaseGuiComponent):
  widget_class = widget_pack.ListboxPayload

  def set_value(self, val):
    if val:
      self.widget_pack.set_value(val)


def build_subclass(name, widget_class):
  # this seemed faster than typing class X a bunch
  return type(name, (BaseGuiComponent,), {'widget_class': widget_class})





FileChooser       = build_subclass('FileChooser', widget_pack.FileChooserPayload)
MultiFileChooser  = build_subclass('MultiFileChooser', widget_pack.MultiFileSaverPayload)
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)
MultiDirChooser   = build_subclass('MultiDirChooser', widget_pack.MultiDirChooserPayload)
PasswordField     = build_subclass('PasswordField', widget_pack.PasswordInputPayload)