当前位置: 首页>>代码示例>>Python>>正文


Python hidden_scrollbar.HiddenScrollbar类代码示例

本文整理汇总了Python中fabmetheus_utilities.hidden_scrollbar.HiddenScrollbar的典型用法代码示例。如果您正苦于以下问题:Python HiddenScrollbar类的具体用法?Python HiddenScrollbar怎么用?Python HiddenScrollbar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了HiddenScrollbar类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: addCanvasMenuRootScrollSkein

	def addCanvasMenuRootScrollSkein(self, repository, skein, suffix, title):
		'Add the canvas, menu bar, scroll bar, skein panes, tableau repository, root and skein.'
		self.imagesDirectoryPath = archive.getFabmetheusUtilitiesPath('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.highlightThickness = 3
		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.showGcode.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(2, 99)
		self.gridPosition.master = self.root
		self.gcodeStringVar = settings.Tkinter.StringVar(self.root)
		self.gcodeLabel = settings.Tkinter.Label(self.root, anchor = settings.Tkinter.W, textvariable = self.gcodeStringVar)
		self.gcodeLabel.grid(row = 0, column = 5, columnspan = 93, sticky = settings.Tkinter.W)
		from fabmetheus_utilities.hidden_scrollbar import HiddenScrollbar
		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 = 2, rowspan = 96, column = 99, sticky = settings.Tkinter.N + settings.Tkinter.S)
		self.canvasHeight = self.root.winfo_screenheight() - repository.screenVerticalInset.value
		self.canvasWidth = 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 = self.highlightThickness, width = self.canvasWidth, height = self.canvasHeight, scrollregion = scrollRegionBoundingBox)
		self.canvas.grid(row = 2, rowspan = 96, 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 = archive.getAbsoluteFolderPath(os.path.dirname(__file__), 'export_canvas_plugins')
		exportCanvasPluginFileNames = archive.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)
开发者ID:Aperture-Laboratories,项目名称:ReplicatorG,代码行数:56,代码来源:tableau.py

示例2: addToDialog

	def addToDialog( self, gridPosition ):
		"Add this to the dialog."
#http://www.pythonware.com/library/tkinter/introduction/x5453-patterns.htm
		self.root = gridPosition.master
		gridPosition.increment()
		scrollbar = HiddenScrollbar( gridPosition.master )
		self.listbox = settings.Tkinter.Listbox( gridPosition.master, selectmode = settings.Tkinter.SINGLE, yscrollcommand = scrollbar.set )
		self.listbox.bind( '<ButtonRelease-1>', self.buttonReleaseOne )
		gridPosition.master.bind( '<FocusIn>', self.focusIn )
		scrollbar.config( command = self.listbox.yview )
		self.listbox.grid( row = gridPosition.row, column = 0, sticky = settings.Tkinter.N + settings.Tkinter.S )
		scrollbar.grid( row = gridPosition.row, column = 1, sticky = settings.Tkinter.N + settings.Tkinter.S )
		self.setStateToValue()
		self.repository.saveListenerTable[ 'updateProfileSaveListeners' ] = updateProfileSaveListeners
开发者ID:elmom,项目名称:Skeinforge-Mirror,代码行数:14,代码来源:skeinforge_profile.py

示例3: activateMouseModeTool

class TableauWindow:
    def activateMouseModeTool(self):
        "Activate the mouse mode tool."
        self.repository.setToDisplaySave()
        self.canvas.focus_set()
        self.createMouseModeTool()
        self.mouseTool.update()

    def addCanvasMenuRootScrollSkein(self, repository, skein, suffix, title):
        "Add the canvas, menu bar, scroll bar, skein panes, tableau repository, root and skein."
        self.imagesDirectoryPath = settings.getPathInFabmetheus(os.path.join("fabmetheus_utilities", "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 addLayer(self, gridPosition):
        "Add the layer frame items."
        self.diveButton = self.getPhotoButtonGridIncrement(self.dive, "dive.ppm", gridPosition)
        self.soarButton = self.getPhotoButtonGridIncrement(self.soar, "soar.ppm", gridPosition)
        gridPosition.increment()
        settings.Tkinter.Label(gridPosition.master, text="Layer:").grid(
            row=gridPosition.row, column=gridPosition.column, sticky=settings.Tkinter.W
        )
        gridPosition.increment()
        self.limitIndex()
        self.layerEntry = settings.Tkinter.Spinbox(
            gridPosition.master,
            command=self.layerEntryReturnPressed,
            from_=0,
            increment=1,
            to=getLengthMinusOneMinimumOne(self.skeinPanes),
        )
        self.layerEntry.bind("<Return>", self.layerEntryReturnPressed)
        self.layerEntry.grid(row=gridPosition.row, column=gridPosition.column, sticky=settings.Tkinter.W)

    def addLine(self, gridPosition):
        "Add the line frame items."
        self.lineDiveButton = self.getPhotoButtonGridIncrement(self.lineDive, "dive.ppm", gridPosition)
#.........这里部分代码省略.........
开发者ID:elmom,项目名称:Skeinforge-Mirror,代码行数:101,代码来源:tableau.py


注:本文中的fabmetheus_utilities.hidden_scrollbar.HiddenScrollbar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。