• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python menumanager.MenuManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: toggleFullscreen

 def toggleFullscreen(self):
     if self.isFullScreen():
         self.enableMask(True)
         self.showNormal()
         if MenuManager.instance().ticker:
             MenuManager.instance().ticker.pause(False)
     else:
         self.enableMask(False)
         self.showFullScreen()
开发者ID:AmerGit,项目名称:Examples,代码行数:9,代码来源:mainwindow.py


示例2: focusOutEvent

    def focusOutEvent(self, event):
        if not Colors.pause:
            return

        if MenuManager.instance().ticker:
            MenuManager.instance().ticker.pause(True)

        code = MenuManager.instance().currentMenuCode
        if code in (MenuManager.ROOT, MenuManager.MENU1):
            self.switchTimerOnOff(False)

        self.pausedLabel.setRecursiveVisible(True)
开发者ID:AmerGit,项目名称:Examples,代码行数:12,代码来源:mainwindow.py


示例3: tick

    def tick(self):
        medianChanged = self.measureFps()
        self.checkAdapt()

        if medianChanged and self.fpsLabel and Colors.showFps:
            self.fpsLabel.setText("FPS: %d" % int(self.currentFps))

        if MenuManager.instance().ticker:
            MenuManager.instance().ticker.tick()

        self.viewport().update()

        if self.useTimer:
            self.updateTimer.start(int(1000 / Colors.fps))
开发者ID:CarlosAndres12,项目名称:pyqt5,代码行数:14,代码来源:mainwindow.py


示例4: checkAdapt

    def checkAdapt(self):
        if self.doneAdapt or Colors.noTimerUpdate or self.demoStartTime.elapsed() < 2000:
            return

        self.doneAdapt = True
        self.forceFpsMedianCalculation()
        Colors.benchmarkFps = self.fpsMedian
        Colors.debug("- benchmark: %d FPS" % int(Colors.benchmarkFps))

        if Colors.noAdapt:
            return

        if self.fpsMedian < 30:
            ticker = MenuManager.instance().ticker
            if ticker and ticker.scene():
                self.scene.removeItem(ticker)
                Colors.noTimerUpdate = True
                self.switchTimerOnOff(False)

                if self.fpsLabel:
                    self.fpsLabel.setText("FPS: (%d)" % int(self.fpsMedian))

                Colors.debug("- benchmark adaption: removed ticker (fps < 30)")

            if self.fpsMedian < 20:
                Colors.noAnimations = True
                Colors.debug("- benchmark adaption: animations switched off (fps < 20)")

            Colors.adapted = True
开发者ID:AmerGit,项目名称:Examples,代码行数:29,代码来源:mainwindow.py


示例5: __init__

    def __init__(self, text, align=LEFT, userCode=0, parent=None, type=SIDEBAR):
        super(TextButton, self).__init__(parent)

        # Prevent a circular import.
        from menumanager import MenuManager
        self._menu_manager = MenuManager.instance()

        self.menuString = text
        self.buttonLabel = text
        self.alignment = align
        self.buttonType = type
        self.userCode = userCode
        self.scanAnim = None
        self.bgOn = None
        self.bgOff = None
        self.bgHighlight = None
        self.bgDisabled = None
        self.state = TextButton.OFF

        self.setAcceptHoverEvents(True)
        self.setCursor(Qt.PointingHandCursor)

        # Calculate the button size.
        if type in (TextButton.SIDEBAR, TextButton.PANEL):
            self.logicalSize = QSize(TextButton.BUTTON_WIDTH, TextButton.BUTTON_HEIGHT)
        else:
            self.logicalSize = QSize(int((TextButton.BUTTON_WIDTH / 2.0) - 5), int(TextButton.BUTTON_HEIGHT * 1.5))

        self._prepared = False
开发者ID:death-finger,项目名称:Scripts,代码行数:29,代码来源:textbutton.py


示例6: onUpdate

	def onUpdate(self, args):

		Menu.onUpdate(self, args)

		sinceAct = (self.currTime - self.actTime) / 1000.0
		
		#print("Since=%.2f, curr=%d" % (sinceAct, self.curInd))

		if self.curInd < 0 \
		   or (sinceAct > self.Messages[self.curInd].time + self.Messages[self.curInd].dur):

			# Next message : if none left, wait a little, and then switch to next menu. 
			if self.curInd == len(self.Messages) - 1:

				if sinceAct > self.Messages[self.curInd].time + self.Messages[self.curInd].dur + 2.0:
					self.switchTo(MenuManager.get("Results"))
				else:
					self.prbProgress.hide()
					time.sleep(0.01) # Let the CPU keep cool (no hurry).

			# Next message : if at least one left ... 
			else:

				self.curInd = self.curInd + 1
				
				# Create and add the static text for the new message.
				scpItem = PyCEGUI.WindowManager.getSingleton().createWindow("CEGUIDemo/StaticText", "MenuLoading/ScpMessages/Msg%d" % self.curInd)
				scpItem.setText(self.Messages[self.curInd].txt + " ...")
				scpItem.setProperty("FrameEnabled", "false")
				scpItem.setProperty("BackgroundEnabled", "false")
				scpItem.setXPosition(PyCEGUI.UDim(0.0, 0.0))
				scpItem.setYPosition(PyCEGUI.UDim(1.0 + self.curInd * 0.10, 0.0))
				scpItem.setWidth(PyCEGUI.UDim(1.0, 0.0))
				scpItem.setHeight(PyCEGUI.UDim(0.10, 0.0))
				self.scpMessages.addChildWindow(scpItem)

				# Adjust alpha for all messages.
				nChildren = self.scpMessages.getContentPane().getChildCount()
				for chldInd in range(nChildren):
					txtChld = self.scpMessages.getContentPane().getChildAtIdx(chldInd)
					txtChld.setAlpha(0.85 ** (nChildren - 1 - chldInd))
				
				# Scroll down to show the added static text.
				self.scpMessages.setVerticalScrollPosition(1.0)

				# Hide any scrollbar (might get shown after every call to addChildWindow).
				self.scpMessages.getVertScrollbar().hide()
				self.scpMessages.getHorzScrollbar().hide()

				# Reset progress-bar.
				self.prbProgress.setProgress(0)
				self.prbProgress.show()

		else:

			# Update progress-bar.
			progress = (sinceAct - self.Messages[self.curInd].time) / self.Messages[self.curInd].dur
			self.prbProgress.setProgress(progress)
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:58,代码来源:menuloading.py


示例7: __init__

    def __init__(self, name, scene=None, parent=None):
        super(ExampleContent, self).__init__(scene, parent)

        # Prevent a circular import.
        from menumanager import MenuManager
        self._menu_manager = MenuManager.instance()

        self.name = name
        self.heading = None
        self.description = None
        self.screenshot = None
开发者ID:felipebetancur,项目名称:pyside2-examples,代码行数:11,代码来源:examplecontent.py


示例8: switchTimerOnOff

    def switchTimerOnOff(self, on):
        ticker = MenuManager.instance().ticker
        if ticker and ticker.scene():
            ticker.tickOnPaint = not on or Colors.noTimerUpdate

        if on and not Colors.noTimerUpdate:
            self.useTimer = True
            self.fpsTime = QTime.currentTime()
            self.updateTimer.start(int(1000 / Colors.fps))
            update_mode = QGraphicsView.NoViewportUpdate
        else:
            self.useTimer = False
            self.updateTimer.stop()

            if Colors.noTicker:
                update_mode = QGraphicsView.MinimalViewportUpdate
            else:
                update_mode = QGraphicsView.SmartViewportUpdate

        self.setViewportUpdateMode(update_mode)
开发者ID:CarlosAndres12,项目名称:pyqt5,代码行数:20,代码来源:mainwindow.py


示例9: onContinueButtonClicked

	def onContinueButtonClicked(self, args):

		self.switchTo(MenuManager.get("Main"))
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:3,代码来源:menuresults.py


示例10: QApplication

if __name__ == '__main__':

    import sys

    app = QApplication(sys.argv)
    Colors.parseArgs(sys.argv)

    if sys.platform == 'win32':
        QMessageBox.information(None, "Documentation Warning",
                "If you are using the GPL version of PyQt from the binary "
                "installer then you will probably see warning messages about "
                "missing documentation.  This is because the installer does "
                "not include a copy of the Qt documentation as it is so "
                "large.")

    mainWindow = MainWindow()
    MenuManager.instance().init(mainWindow)
    mainWindow.setFocus()

    if Colors.fullscreen:
        mainWindow.showFullScreen()
    else:
        mainWindow.enableMask(True)
        mainWindow.show()

    artisticSleep(500)
    mainWindow.start()

    sys.exit(app.exec_())
开发者ID:Axel-Erfurt,项目名称:pyqt5,代码行数:29,代码来源:qtdemo.py


示例11: onSingleEventButtonClicked

	def onSingleEventButtonClicked(self, args):

		self.switchTo(MenuManager.get("TrackSelect"))
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:3,代码来源:menumain.py


示例12: onQuickRaceButtonClicked

	def onQuickRaceButtonClicked(self, args):

		self.switchTo(MenuManager.get("TrackSelect"))
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:3,代码来源:menumain.py


示例13: onOptionsButtonClicked

	def onOptionsButtonClicked(self, args):

		self.switchTo(MenuManager.get("Options"))
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:3,代码来源:menustandard.py


示例14: onProfilesButtonClicked

	def onProfilesButtonClicked(self, args):

		self.switchTo(MenuManager.get("Profiles"))
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:3,代码来源:menustandard.py


示例15: onCreditsButtonClicked

	def onCreditsButtonClicked(self, args):

		self.switchTo(MenuManager.get("Credits"))
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:3,代码来源:menustandard.py


示例16: start

 def start(self):
     self.switchTimerOnOff(True)
     self.demoStartTime.restart()
     MenuManager.instance().itemSelected(MenuManager.ROOT,
             Colors.rootMenuName)
     Colors.debug("- starting demo")
开发者ID:AmerGit,项目名称:Examples,代码行数:6,代码来源:mainwindow.py


示例17: setupInterface

	def setupInterface(self):

		MenuManager.get("Main").activate()
开发者ID:Donald-Otto,项目名称:SpeedDreamsForkProject,代码行数:3,代码来源:gui.py


示例18: initialize

	def initialize():

		MenuManager.register("Credits",  MenuCredits.instance)
		MenuManager.register("Options",  MenuOptions.instance)
		MenuManager.register("Profiles", MenuProfiles.instance)

		MenuManager.register("Main",        MenuMain.instance)
		MenuManager.register("TrackSelect", MenuTrackSelect.instance)
		MenuManager.register("CarSelect",   MenuCarSelect.instance)
		MenuManager.register("Loading",     MenuLoading.instance)
		MenuManager.register("Results",     MenuResults.instance)
开发者ID:rongzhou,项目名称:speed-dreams,代码行数:11,代码来源:menufactory.py


示例19: onStartButtonClicked

	def onStartButtonClicked(self, args):

		self.switchTo(MenuManager.get("Loading"))
开发者ID:rongzhou,项目名称:speed-dreams,代码行数:3,代码来源:menucarselect.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python menu_pool.apply_modifiers函数代码示例发布时间:2022-05-27
下一篇:
Python menuinst.install函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap