def _editUIFormSections(self): expr = Form.SmallSection('Expression', None, self.expr.editUI()) displayedText = Form.SmallSection( 'Displayed text', None, TextEntry.textEntryCommitOnChange(self.displayedText.live)) superSections = super(GUIEval, self)._editUIFormSections() return [expr, displayedText] + superSections
def _editUIFormSections(self): direction = Form.SmallSection( 'Direction', None, self.direction.editUI(self._arrowDirectionEditor)) size = Form.SmallSection( 'Size', None, self.size.editUI( lambda live: RealSpinEntry(live, 0.0, 1048576.0, 1.0, 10.0))) superSections = super(GUIArrow, self)._editUIFormSections() return [direction, size] + superSections
def _editUIFormSections(self): width = Form.SmallSection( 'Width', None, self.width.editUI( lambda live: RealSpinEntry(live, 0.0, 1048576.0, 1.0, 10.0))) height = Form.SmallSection( 'Height', None, self.height.editUI( lambda live: RealSpinEntry(live, 0.0, 1048576.0, 1.0, 10.0))) superSections = super(GUISpacer, self)._editUIFormSections() return [width, height] + superSections
def _editUIFormSections(self): sections = [] sections.extend( unaryBranchChildEditUIFormSections(self) ) sections.append(Form.SmallSection('On click', None, exprBorder.surround( self.onClick.editUI() ))) superSections = super(GUIButton, self)._editUIFormSections() return sections + superSections
def _editUIFormSections(self): text = Form.SmallSection( 'Text', None, self.text.editUI( lambda live: TextEntry.textEntryCommitOnChange(live))) superSections = super(GUIText, self)._editUIFormSections() return [text] + superSections
def unaryBranchChildEditUIFormSections(branch): child = branch.child.node if child is not None: if isinstance(child, GUIEditor.PrimitiveComponents.GUILabel): textField = child.text if textField.isConstant(): textLive = textField.constantValueLive return [Form.SmallSection('Label text', None, TextEntry.textEntryCommitOnChange(textLive))] return []
def _editUIFormSections(self): width = Form.SmallSection( 'Width', None, self.width.editUI( lambda live: RealSpinEntry(live, 0.0, 1048576.0, 1.0, 10.0))) height = Form.SmallSection( 'Height', None, self.height.editUI( lambda live: RealSpinEntry(live, 0.0, 1048576.0, 1.0, 10.0))) sizeConstraintX = Form.SmallSection( 'Constraint-X', None, self.sizeConstraintX.editUI(_sizeConstraintEditor)) sizeConstraintY = Form.SmallSection( 'Constraint-Y', None, self.sizeConstraintY.editUI(_sizeConstraintEditor)) superSections = super(GUISpaceBin, self)._editUIFormSections() return [width, height, sizeConstraintX, sizeConstraintY ] + superSections
def _editUIFormSections(self): hAlign = Form.SmallSection('H alignment', None, self.hAlignment.editUI(_hAlignmentEditor)) vAlign = Form.SmallSection('V alignment', None, self.vAlignment.editUI(_vAlignmentEditor)) @LiveFunction def paddingUI(): padding = self.padding.value if padding is None: def onPadUniform(button, event): self.padding.value = UniformPadding() def onPadNonUniform(button, event): self.padding.value = NonUniformPadding() return ControlsRow([ Button.buttonWithLabel('Uniform', onPadUniform), Button.buttonWithLabel('Non-uniform', onPadNonUniform) ]).alignHPack() else: def onRemove(button, event): self.padding.value = None def setPadding(padding): self.padding.value = padding removeButton = Button.buttonWithLabel('Remove padding', onRemove).alignHPack() return Column([ removeButton.alignHPack(), Spacer(0.0, 5.0), padding.editUI(setPadding) ]) padding = Form.SmallSection('Padding', None, paddingUI) return [hAlign, vAlign, padding]
def formSections(self): return [ Form.SmallSection( 'Thickness', None, self.thickness.editUI(lambda live: RealSpinEntry( live, 0.0, 10240.0, 0.1, 10.0))), Form.SmallSection( 'Inset', None, self.inset.editUI(lambda live: RealSpinEntry( live, 0.0, 10240.0, 0.1, 10.0))), Form.SmallSection( 'Round-X', None, self.roundingX.editUI(lambda live: RealSpinEntry( live, 0.0, 10240.0, 0.1, 10.0))), Form.SmallSection( 'Round-Y', None, self.roundingY.editUI(lambda live: RealSpinEntry( live, 0.0, 10240.0, 0.1, 10.0))), Form.SmallSection( 'Border colour', None, self.borderPaint.editUI( lambda live: ColourPicker(live).alignHPack())), Form.SmallSection( 'Background colour', None, self.backgroundPaint.editUI(lambda live: optionalTypedEditor( live, Color.WHITE, lambda live: ColourPicker(live). alignHPack()))), Form.SmallSection( 'Hover border colour', None, self.highlightBorderPaint.editUI( lambda live: optionalTypedEditor( live, Color.BLACK, lambda live: ColourPicker(live). alignHPack()))), Form.SmallSection( 'Hover background colour', None, self.highlightBackgroundPaint.editUI( lambda live: optionalTypedEditor( live, Color.WHITE, lambda live: ColourPicker(live). alignHPack()))), ]