def addCanvasMenuRootScrollSkein( self, repository, skein, suffix, title ): "Add the canvas, menu bar, scroll bar, skein panes, tableau repository, root and skein." self.imagesDirectoryPath = settings.getPathInFabmetheusUtilities('images') self.movementTextID = None self.mouseInstantButtons = [] self.photoImages = {} self.repository = repository self.root = settings.Tkinter.Tk() self.gridPosition = settings.GridVertical( 0, 1 ) self.gridPosition.master = self.root self.root.title( os.path.basename( skein.fileName ) + ' - ' + title ) self.rulingExtent = 24 self.rulingTargetSeparation = 150.0 self.screenSize = skein.screenSize self.skein = skein self.skeinPanes = skein.skeinPanes self.suffix = suffix self.timerID = None repository.animationSlideShowRate.value = max( repository.animationSlideShowRate.value, 0.01 ) repository.animationSlideShowRate.value = min( repository.animationSlideShowRate.value, 85.0 ) repository.drawArrows.setUpdateFunction( self.setWindowToDisplaySaveUpdate ) repository.goAroundExtruderOffTravel.setUpdateFunction( self.setWindowToDisplaySavePhoenixUpdate ) repository.layerExtraSpan.setUpdateFunction( self.setWindowToDisplaySaveUpdate ) repository.widthOfSelectionThread.setUpdateFunction( self.setWindowToDisplaySaveUpdate ) repository.widthOfTravelThread.setUpdateFunction( self.setWindowToDisplaySaveUpdate ) repository.window = self for menuRadio in repository.mouseMode.menuRadios: fileName = menuRadio.name.lower() fileName = fileName.replace(' ', '_') + '.ppm' menuRadio.mouseButton = self.getPhotoButtonGridIncrement( menuRadio.invoke, fileName, self.gridPosition ) self.gridPosition = settings.GridHorizontal( 1, 99 ) self.gridPosition.master = self.root self.xScrollbar = HiddenScrollbar( self.root, orient = settings.Tkinter.HORIZONTAL ) self.xScrollbar.grid( row = 98, column = 2, columnspan = 96, sticky = settings.Tkinter.E + settings.Tkinter.W ) self.yScrollbar = HiddenScrollbar( self.root ) self.yScrollbar.grid( row = 1, rowspan = 97, column = 99, sticky = settings.Tkinter.N + settings.Tkinter.S ) self.canvasHeight = min( int( skein.screenSize.imag ), self.root.winfo_screenheight() - repository.screenVerticalInset.value ) self.canvasWidth = min( int( skein.screenSize.real ), self.root.winfo_screenwidth() - repository.screenHorizontalInset.value ) scrollRegionBoundingBox = ( 0, 0, int( skein.screenSize.real ), int( skein.screenSize.imag ) ) self.canvas = settings.Tkinter.Canvas( self.root, highlightthickness = 3, width = self.canvasWidth, height = self.canvasHeight, scrollregion = scrollRegionBoundingBox ) self.canvas.grid( row = 1, rowspan = 97, column = 2, columnspan = 96, sticky = settings.Tkinter.E + settings.Tkinter.W + settings.Tkinter.N + settings.Tkinter.S ) self.fileHelpMenuBar = settings.FileHelpMenuBar( self.root ) self.exportMenu = settings.Tkinter.Menu( self.fileHelpMenuBar.fileMenu, tearoff = 0 ) self.fileHelpMenuBar.fileMenu.add_cascade( label = "Export", menu = self.exportMenu, underline = 0 ) exportCanvasPluginsFolderPath = gcodec.getAbsoluteFolderPath( os.path.dirname( __file__ ), 'export_canvas_plugins') exportCanvasPluginFileNames = gcodec.getPluginFileNamesFromDirectoryPath( exportCanvasPluginsFolderPath ) for exportCanvasPluginFileName in exportCanvasPluginFileNames: ExportCanvasDialog().addPluginToMenu( self.canvas, skein.fileName, self.exportMenu, exportCanvasPluginFileName, suffix ) self.fileHelpMenuBar.fileMenu.add_separator() self.fileHelpMenuBar.completeMenu( self.close, repository, self.save, self )
def getFontsDirectoryPath(): "Get the fonts directory path." return settings.getPathInFabmetheusUtilities('fonts')