def _presentConfig(self):
     if self._config is not None:
         rows = []
         rows.append([SectionHeading3('Tool'), SectionHeading3('Path')])
         rows.append(
             [self._toolLabel('dot'),
              Label(self._config.getDotPath())])
         rows.append(
             [self._toolLabel('neato'),
              Label(self._config.getNeatoPath())])
         rows.append(
             [self._toolLabel('twopi'),
              Label(self._config.getTwopiPath())])
         rows.append(
             [self._toolLabel('circo'),
              Label(self._config.getCircoPath())])
         rows.append(
             [self._toolLabel('fdp'),
              Label(self._config.getFdpPath())])
         rows.append(
             [self._toolLabel('sfdp'),
              Label(self._config.getSfdpPath())])
         rows.append(
             [self._toolLabel('osage'),
              Label(self._config.getOsagePath())])
         return self._configTableStyle.applyTo(Table(rows)).pad(15.0, 5.0)
	def currentComponentUI():
		component = currentComponent.getValue()
		if component is not None:
			editUI = component._editUI()
			return Section(SectionHeading3(component.componentName), editUI)
		else:
			return Blank()
Ejemplo n.º 3
0
def _addPanelButtons(sourceElement, menu):
	# Side panel
	def _onShow(button, event):
		showSidePanel(sourceElement.rootElement)

	def _onHide(button, event):
		hideSidePanel(sourceElement.rootElement)

	panelButtons = ControlsRow([Button.buttonWithLabel('Show', _onShow), Button.buttonWithLabel('Hide', _onHide)])
	panelSection = Section(SectionHeading3('Side panel'), panelButtons)
	menu.add(panelSection)
Ejemplo n.º 4
0
def componentContextMenu(element, menu):
	# Components under pointer
	guiEditorRootProp = element.findPropertyInAncestors(GUIEdProp.instance)
	guiEditorRootElement = guiEditorRootProp.element

	# Components under pointer
	menu.add(Section(SectionHeading3('Components under pointer'), _presentComponentsUnderPointer(element, guiEditorRootElement)))

	current = currentComponentEditor(element.rootElement)
	menu.add(current)


	# Side panel
	_addPanelButtons(element, menu)

	return True
Ejemplo n.º 5
0
	def __present__(self, fragment, inheritedState):
		self._incr.onAccess()

		title = SectionHeading2( 'Unit tests' )

		nameEntry = _nameBorder.surround( EditableLabel( self._name, _notSet ).regexValidated( Tokens.identifierPattern, 'Please enter a valid identifier' ) )

		header = Row( [ title, Spacer( 25.0, 0.0 ), nameEntry ] )

		contents = [ header.padY( 0.0, 5.0 ), _standardCodeBorder.surround( self._suite ).padY( 3.0 ).alignHExpand() ]

		if self.__passes is not None  and  self.__failures is not None:
			resultsTitle = SectionHeading3( 'Test results:' )
			passes = _standardPassStyle( Label( '%d / %d test(s) passed' % ( self.__passes, self.__passes + len( self.__failures ) ) ) )
			failuresLabel = _standardFailStyle( Label( '%d test(s) failed:' % len( self.__failures ) ) )
			failures = [ Column( [ _standardFailedTestStyle( Label( name ) ), Pres.coerce( exception ).padX( 5.0, 0.0 ) ] ).padX( 5.0, 0.0 )   for name, exception in self.__failures ]
			results = _standardResultsBorder.surround( Column( [ resultsTitle, passes, failuresLabel ] + failures ) ).pad( 3.0, 3.0 )
			contents.append( results )


		return _standardInlineTestBorder.surround( Column( contents ) )
Ejemplo n.º 6
0
 def __present__(self, fragment, inh):
     title = Row([SectionHeading3('Note: '), self.title_elem])
     return _section_border.surround(Column([title, self.text]))
def registerPaletteSubsection(title, items):
    sec = Section(SectionHeading3(title), FlowGrid(4, items))
    _paletteSections.append(sec)