Ejemplo n.º 1
0
 def addTextArea(self, *args, **kwargs):
     textarea = BeakerxTextArea(
         description=self.getDescription(args, kwargs))
     textarea.cols = getValue(kwargs, 'width', -1)
     textarea.rows = getValue(kwargs, 'height', -1)
     self.children += (textarea, )
     self.components[textarea.description] = textarea
     return textarea
Ejemplo n.º 2
0
 def addTextArea(self, *args, **kwargs):
     textarea = BeakerxTextArea(
         description=self.getDescription(args, kwargs))
     textarea.cols = getValue(kwargs, 'width', -1)
     textarea.rows = getValue(kwargs, 'height', -1)
     textarea.value = getValue(kwargs, 'value', "")
     textarea.placeholder = getValue(kwargs, 'placeholder', "")
     self.children += (textarea,)
     self.components[textarea.description] = textarea
     return textarea
Ejemplo n.º 3
0
    def addList(self, *args, **kwargs):
        multi_select = getValue(kwargs, 'multi', True)
        if multi_select:
            list = SelectMultipleWithRows(
                description=self.getDescription(args, kwargs))
        else:
            list = SelectMultipleSingle(
                description=self.getDescription(args, kwargs))
        list.options = self.getOptions(args, kwargs)
        list.size = getValue(kwargs, 'rows', len(list.options))

        self.children += (list,)
        self.components[list.description] = list
        return list
Ejemplo n.º 4
0
    def addList(self, *args, **kwargs):
        multi_select = getValue(kwargs, 'multi', True)
        if multi_select:
            list = SelectMultipleWithRows(
                description=self.getDescription(args, kwargs))
        else:
            list = SelectMultipleSingle(
                description=self.getDescription(args, kwargs))
        list.options = self.getOptions(args, kwargs)
        list.size = getValue(kwargs, 'rows', 2)

        self.children += (list, )
        self.components[list.description] = list
        return list
Ejemplo n.º 5
0
 def addPasswordField(self, *args, **kwargs):
     password = BeakerxPassword(
         description=self.getDescription(args, kwargs))
     password.size = getValue(kwargs, 'width', -1)
     self.children += (password, )
     self.components[password.description] = password
     return password
Ejemplo n.º 6
0
 def addCheckBox(self, *args, **kwargs):
     checkbox = BeakerxCheckbox(
         description=self.getDescription(args, kwargs))
     checkbox.value = getValue(kwargs, 'value', False)
     self.children += (checkbox, )
     self.components[checkbox.description] = checkbox
     return checkbox
Ejemplo n.º 7
0
 def addComboBox(self, *args, **kwargs):
     dropdown = BeakerxComboBox(description=self.getDescription(args, kwargs))
     dropdown.options = self.getOptions(args, kwargs)
     dropdown.original_options = self.getOptions(args, kwargs)
     dropdown.editable = getValue(kwargs, 'editable', False)
     self.children += (dropdown,)
     self.components[dropdown.description] = dropdown
     return dropdown
Ejemplo n.º 8
0
 def addComboBox(self, *args, **kwargs):
     dropdown = BeakerxComboBox(description=self.getDescription(args, kwargs))
     dropdown.options = self.getOptions(args, kwargs)
     dropdown.original_options = self.getOptions(args, kwargs)
     dropdown.editable = getValue(kwargs, 'editable', False)
     self.children += (dropdown,)
     self.components[dropdown.description] = dropdown
     return dropdown
Ejemplo n.º 9
0
 def addRadioButtons(self, *args, **kwargs):
     orientation = getValue(kwargs, 'orientation', EasyForm.VERTICAL)
     radio_buttons = RadioButtons(options=self.getOptions(args, kwargs),
                                  description=self.getDescription(
                                      args, kwargs))
     radio_buttons.index = None
     if orientation == EasyForm.VERTICAL:
         self.children += (radio_buttons, )
     else:
         box = BeakerxHBox()
         box.children += (radio_buttons, )
         self.children += (box, )
     self.components[radio_buttons.description] = radio_buttons
     return radio_buttons
Ejemplo n.º 10
0
 def addRadioButtons(self, *args, **kwargs):
     orientation = getValue(kwargs, 'orientation', EasyForm.VERTICAL)
     radio_buttons = RadioButtons(options=self.getOptions(args, kwargs),
                                  description=self.getDescription(args,
                                                                  kwargs))
     radio_buttons.index = None
     if orientation == EasyForm.VERTICAL:
         self.children += (radio_buttons,)
     else:
         box = BeakerxHBox()
         box.children += (radio_buttons,)
         self.children += (box,)
     self.components[radio_buttons.description] = radio_buttons
     return radio_buttons
Ejemplo n.º 11
0
    def addCheckBoxes(self, *args, **kwargs):
        layout = BeakerxHBox()
        orientation = getValue(kwargs, 'orientation', EasyForm.VERTICAL)
        if orientation == EasyForm.HORIZONTAL:
            
            box = BeakerxHBox()
        else:
            box = BeakerxVBox()
        checkbox = BeakerxCheckboxGroup()

        for checkBoxItem in self.getOptions(args, kwargs):
            children = BeakerxCheckbox(description=checkBoxItem)
            checkbox.addChildren(children)
            box.children += (children,)

        layout.children += (BeakerxLabel(value=self.getDescription(args, kwargs)), box,)
        self.children += (layout,)
        self.components[self.getDescription(args, kwargs)] = checkbox
        return layout
Ejemplo n.º 12
0
    def addCheckBoxes(self, *args, **kwargs):
        layout = BeakerxHBox()
        orientation = getValue(kwargs, 'orientation', EasyForm.VERTICAL)
        if orientation == EasyForm.HORIZONTAL:
            
            box = BeakerxHBox()
        else:
            box = BeakerxVBox()
        checkbox = BeakerxCheckboxGroup()

        for checkBoxItem in self.getOptions(args, kwargs):
            children = BeakerxCheckbox(description=checkBoxItem)
            checkbox.addChildren(children)
            box.children += (children,)

        layout.children += (BeakerxLabel(value=self.getDescription(args, kwargs)), box,)
        self.children += (layout,)
        self.components[self.getDescription(args, kwargs)] = checkbox
        return layout
Ejemplo n.º 13
0
 def getOptions(args, kwargs):
     if len(args) > 1:
         return args[1][:]
     else:
         return getValue(kwargs, 'options', [])
Ejemplo n.º 14
0
 def getDescription(args, kwargs):
     if len(args) > 0:
         return args[0]
     else:
         return getValue(kwargs, 'description', "")
Ejemplo n.º 15
0
 def addPasswordField(self, *args, **kwargs):
     password = BeakerxPassword(description=self.getDescription(args, kwargs))
     password.size = getValue(kwargs, 'width', -1)
     self.children += (password,)
     self.components[password.description] = password
     return password
Ejemplo n.º 16
0
 def addButton(self, *args, **kwargs):
     button = BeakerxButton(description=self.getDescription(args, kwargs))
     button.tag = getValue(kwargs, 'tag', "")
     button.on_click(self.buttonCallback)
     self.children += (button, )
     return button
Ejemplo n.º 17
0
 def addCheckBox(self, *args, **kwargs):
     checkbox = BeakerxCheckbox(description=self.getDescription(args, kwargs))
     checkbox.value = getValue(kwargs, 'value', False)
     self.children += (checkbox,)
     self.components[checkbox.description] = checkbox
     return checkbox
Ejemplo n.º 18
0
 def addDatePicker(self, *args, **kwargs):
     data_picker = DatePicker(description=self.getDescription(args, kwargs))
     data_picker.value = getValue(kwargs, 'value', '')
     self.children += (data_picker,)
     self.components[data_picker.description] = data_picker
     return data_picker
Ejemplo n.º 19
0
 def getOptions(args, kwargs):
     if len(args) > 1:
         return args[1][:]
     else:
         return getValue(kwargs, 'options', [])
Ejemplo n.º 20
0
 def addButton(self, *args, **kwargs):
     button = BeakerxButton(description=self.getDescription(args, kwargs))
     button.tag = getValue(kwargs, 'tag', "")
     button.on_click(self.buttonCallback)
     self.children += (button,)
     return button
Ejemplo n.º 21
0
 def __init__(self, *args, **kwargs):
     super(EasyForm, self).__init__(**kwargs)
     self.easyFormName = getValue(kwargs, 'title', "")
     if self.easyFormName == "" and len(args) > 0:
         self.easyFormName = args[0]
Ejemplo n.º 22
0
 def __init__(self, *args, **kwargs):
     super(EasyForm, self).__init__(**kwargs)
     self.easyFormName = getValue(kwargs, 'title', "")
     if self.easyFormName == "" and len(args) > 0:
         self.easyFormName = args[0]
Ejemplo n.º 23
0
 def addTextField(self, *args, **kwargs):
     text = BeakerxText(description=self.getDescription(args, kwargs))
     text.size = getValue(kwargs, 'width', -1)
     self.children += (text, )
     self.components[text.description] = text
     return text
Ejemplo n.º 24
0
 def getDescription(args, kwargs):
     if len(args) > 0:
         return args[0]
     else:
         return getValue(kwargs, 'description', "")
Ejemplo n.º 25
0
 def addDatePicker(self, *args, **kwargs):
     data_picker = DatePicker(description=self.getDescription(args, kwargs))
     data_picker.value = getValue(kwargs, 'value', '')
     self.children += (data_picker, )
     self.components[data_picker.description] = data_picker
     return data_picker
Ejemplo n.º 26
0
 def addTextField(self, *args, **kwargs):
     text = BeakerxText(description=self.getDescription(args, kwargs))
     text.size = getValue(kwargs, 'width', -1)
     self.children += (text,)
     self.components[text.description] = text
     return text