本文整理匯總了Python中textbutton.TextButton類的典型用法代碼示例。如果您正苦於以下問題:Python TextButton類的具體用法?Python TextButton怎麽用?Python TextButton使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了TextButton類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: createLowRightLeafButton
def createLowRightLeafButton(self, label, xOffset, type, movieIn, movieOut, movieShake):
item = TextButton(label, TextButton.RIGHT, type, self.window.scene,
self.window.mainSceneRoot, TextButton.PANEL)
item.setRecursiveVisible(False)
item.setZValue(10)
sw = self.window.scene.sceneRect().width()
sh = self.window.scene.sceneRect().height()
# Create in-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_IN)
anim.setDuration(1050 * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(sw, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(0.10, QtCore.QPointF(sw, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(0.30, QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(0.35, QtCore.QPointF(xOffset + 30, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(0.40, QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(0.45, QtCore.QPointF(xOffset + 5, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(0.50, QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 35))
anim.setPosAt(1.00, QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 26))
movieIn.append(anim)
# Create out-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_OUT)
anim.hideOnFinished = True
anim.setDuration(300 * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 26))
anim.setPosAt(1.0, QtCore.QPointF(xOffset, sh))
movieOut.append(anim)
示例2: createLowRightButton
def createLowRightButton(self, label, type, movieIn, movieOut, movieShake):
item = TextButton(label, TextButton.RIGHT, type,
self.window.mainSceneRoot, TextButton.PANEL)
item.setRecursiveVisible(False)
item.setZValue(10)
sw = self.window.scene.sceneRect().width()
xOffset = 70
# Create in-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_IN)
anim.setDuration(1800)
anim.setStartValue(QPointF(sw, Colors.contentStartY + Colors.contentHeight - 35))
anim.setKeyValueAt(0.5, QPointF(sw, Colors.contentStartY + Colors.contentHeight - 35))
anim.setKeyValueAt(0.7, QPointF(xOffset + 535, Colors.contentStartY + Colors.contentHeight - 35))
anim.setEndValue(QPointF(xOffset + 535, Colors.contentStartY + Colors.contentHeight - 26))
movieIn.append(anim)
# Create out-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_OUT)
anim.setHideOnFinished(True)
anim.setDuration(400)
anim.setStartValue(QPointF(xOffset + 535, Colors.contentStartY + Colors.contentHeight - 26))
anim.setEndValue(QPointF(sw, Colors.contentStartY + Colors.contentHeight - 26))
movieOut.append(anim)
示例3: createUpnDownButtons
def createUpnDownButtons(self):
xOffset = 15.0
yOffset = 450.0
self.upButton = TextButton("", TextButton.LEFT, MenuManager.UP,
self.window.scene, self.window.mainSceneRoot, TextButton.UP)
self.upButton.prepare()
self.upButton.setPos(xOffset, yOffset)
self.upButton.setState(TextButton.DISABLED)
self.downButton = TextButton("", TextButton.LEFT, MenuManager.DOWN,
self.window.scene, self.window.mainSceneRoot, TextButton.DOWN)
self.downButton.prepare()
self.downButton.setPos(xOffset + 10 + self.downButton.sceneBoundingRect().width(), yOffset)
movieShake = self.score.insertMovie('upndown -shake')
shakeAnim = DemoItemAnimation(self.upButton,
DemoItemAnimation.ANIM_UNSPECIFIED)
shakeAnim.timeline.setCurveShape(QtCore.QTimeLine.LinearCurve)
shakeAnim.setDuration(650)
shakeAnim.setStartPos(self.upButton.pos())
shakeAnim.setPosAt(0.60, self.upButton.pos())
shakeAnim.setPosAt(0.70, self.upButton.pos() + QtCore.QPointF(-2, 0))
shakeAnim.setPosAt(0.80, self.upButton.pos() + QtCore.QPointF(1, 0))
shakeAnim.setPosAt(0.90, self.upButton.pos() + QtCore.QPointF(-1, 0))
shakeAnim.setPosAt(1.00, self.upButton.pos())
movieShake.append(shakeAnim)
shakeAnim = DemoItemAnimation(self.downButton,
DemoItemAnimation.ANIM_UNSPECIFIED)
shakeAnim.timeline.setCurveShape(QtCore.QTimeLine.LinearCurve)
shakeAnim.setDuration(650)
shakeAnim.setStartPos(self.downButton.pos())
shakeAnim.setPosAt(0.60, self.downButton.pos())
shakeAnim.setPosAt(0.70, self.downButton.pos() + QtCore.QPointF(-5, 0))
shakeAnim.setPosAt(0.80, self.downButton.pos() + QtCore.QPointF(-3, 0))
shakeAnim.setPosAt(0.90, self.downButton.pos() + QtCore.QPointF(-1, 0))
shakeAnim.setPosAt(1.00, self.downButton.pos())
movieShake.append(shakeAnim)
示例4: createLowLeftButton
def createLowLeftButton(self, label, type, movieIn, movieOut, movieShake, menuString=""):
button = TextButton(label, TextButton.RIGHT, type, self.window.scene,
self.window.mainSceneRoot, TextButton.PANEL)
if menuString:
button.setMenuString(menuString)
button.setRecursiveVisible(False)
button.setZValue(10)
iw = button.sceneBoundingRect().width()
xOffset = 15
# Create in-animation.
buttonIn = DemoItemAnimation(button, DemoItemAnimation.ANIM_IN)
buttonIn.setDuration(1800 * Colors.animSpeedButtons)
buttonIn.setStartPos(QtCore.QPointF(-iw, Colors.contentStartY + Colors.contentHeight - 35))
buttonIn.setPosAt(0.5, QtCore.QPointF(-iw, Colors.contentStartY + Colors.contentHeight - 35))
buttonIn.setPosAt(0.7, QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 35))
buttonIn.setPosAt(1.0, QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 26))
movieIn.append(buttonIn)
# Create out-animation.
buttonOut = DemoItemAnimation(button, DemoItemAnimation.ANIM_OUT)
buttonOut.hideOnFinished = True
buttonOut.setDuration(400 * Colors.animSpeedButtons)
buttonOut.setStartPos(QtCore.QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 26))
buttonOut.setPosAt(1.0, QtCore.QPointF(-iw, Colors.contentStartY + Colors.contentHeight - 26))
movieOut.append(buttonOut)
if movieShake is not None:
shakeAnim = DemoItemAnimation(button, DemoItemAnimation.ANIM_UNSPECIFIED)
shakeAnim.timeline.setCurveShape(QtCore.QTimeLine.LinearCurve)
shakeAnim.setDuration(650)
shakeAnim.setStartPos(buttonIn.posAt(1.0))
shakeAnim.setPosAt(0.60, buttonIn.posAt(1.0))
shakeAnim.setPosAt(0.70, buttonIn.posAt(1.0) + QtCore.QPointF(-3, 0))
shakeAnim.setPosAt(0.80, buttonIn.posAt(1.0) + QtCore.QPointF(2, 0))
shakeAnim.setPosAt(0.90, buttonIn.posAt(1.0) + QtCore.QPointF(-1, 0))
shakeAnim.setPosAt(1.00, buttonIn.posAt(1.0))
movieShake.append(shakeAnim)
示例5: createLowLeftButton
def createLowLeftButton(self, label, type, movieIn, movieOut, movieShake, menuString=""):
button = TextButton(label, TextButton.RIGHT, type,
self.window.mainSceneRoot, TextButton.PANEL)
if menuString:
button.setMenuString(menuString)
button.setRecursiveVisible(False)
button.setZValue(10)
iw = button.sceneBoundingRect().width()
xOffset = 15
# Create in-animation.
buttonIn = DemoItemAnimation(button, DemoItemAnimation.ANIM_IN)
buttonIn.setDuration(1800)
buttonIn.setStartValue(QPointF(-iw, Colors.contentStartY + Colors.contentHeight - 35))
buttonIn.setKeyValueAt(0.5, QPointF(-iw, Colors.contentStartY + Colors.contentHeight - 35))
buttonIn.setKeyValueAt(0.7, QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 35))
buttonIn.setEndValue(QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 26))
movieIn.append(buttonIn)
# Create out-animation.
buttonOut = DemoItemAnimation(button, DemoItemAnimation.ANIM_OUT)
buttonOut.setHideOnFinished(True)
buttonOut.setDuration(400)
buttonOut.setStartValue(QPointF(xOffset, Colors.contentStartY + Colors.contentHeight - 26))
buttonOut.setEndValue(QPointF(-iw, Colors.contentStartY + Colors.contentHeight - 26))
movieOut.append(buttonOut)
if movieShake is not None:
shakeAnim = DemoItemAnimation(button, DemoItemAnimation.ANIM_UNSPECIFIED)
shakeAnim.setDuration(650)
shakeAnim.setStartValue(buttonIn.endValue())
shakeAnim.setKeyValueAt(0.60, buttonIn.endValue())
shakeAnim.setKeyValueAt(0.70, buttonIn.endValue() + QPointF(-3, 0))
shakeAnim.setKeyValueAt(0.80, buttonIn.endValue() + QPointF(2, 0))
shakeAnim.setKeyValueAt(0.90, buttonIn.endValue() + QPointF(-1, 0))
shakeAnim.setEndValue(buttonIn.endValue())
movieShake.append(shakeAnim)
示例6: createMenu
def createMenu(self, category, type):
sw = self.window.scene.sceneRect().width()
xOffset = 15
yOffset = 10
maxExamples = Colors.menuCount
menuIndex = 1
name = str(category.attribute('name'))
currentNode = category.firstChild()
currentMenu = '%s -menu%d' % (name, menuIndex)
while not currentNode.isNull():
movieIn = self.score.insertMovie(currentMenu)
movieOut = self.score.insertMovie(currentMenu + ' -out')
movieNextTopOut = self.score.insertMovie(currentMenu + ' -top_out')
movieNextBottomOut = self.score.insertMovie(currentMenu + ' -bottom_out')
movieNextTopIn = self.score.insertMovie(currentMenu + ' -top_in')
movieNextBottomIn = self.score.insertMovie(currentMenu + ' -bottom_in')
movieShake = self.score.insertMovie(currentMenu + ' -shake')
i = 0
while not currentNode.isNull() and i < maxExamples:
# Create a normal menu button.
label = str(currentNode.toElement().attribute('name'))
item = TextButton(label, TextButton.LEFT, type,
self.window.scene, self.window.mainSceneRoot)
currentNode = currentNode.nextSibling()
# Skip the OpenGL examples if they can't run.
if str(currentNode.toElement().attribute('dirname')) == 'opengl':
if not Colors.openGlAvailable:
currentNode = currentNode.nextSibling()
item.setRecursiveVisible(False)
item.setZValue(10)
ih = item.sceneBoundingRect().height()
iw = item.sceneBoundingRect().width()
ihp = ih + 3
# Create in-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_IN)
anim.setDuration(float(1000 + (i * 20)) * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(xOffset, -ih))
anim.setPosAt(0.20, QtCore.QPointF(xOffset, -ih))
anim.setPosAt(0.50, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY + (10 * float(i / 4.0))))
anim.setPosAt(0.60, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(0.70, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY + (5 * float(i / 4.0))))
anim.setPosAt(0.80, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(0.90, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY + (2 * float(i / 4.0))))
anim.setPosAt(1.00, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
movieIn.append(anim)
# Create out-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_OUT)
anim.hideOnFinished = True
anim.setDuration((700 + (30 * i)) * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(0.60, QtCore.QPointF(xOffset, 600 - ih - ih))
anim.setPosAt(0.65, QtCore.QPointF(xOffset + 20, 600 - ih))
anim.setPosAt(1.00, QtCore.QPointF(sw + iw, 600 - ih))
movieOut.append(anim)
# Create shake-animation.
anim = DemoItemAnimation(item)
anim.setDuration(700 * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(0.55, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY - i*2.0))
anim.setPosAt(0.70, QtCore.QPointF(xOffset - 10, (i * ihp) + yOffset + Colors.contentStartY - i*1.5))
anim.setPosAt(0.80, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY - i*1.0))
anim.setPosAt(0.90, QtCore.QPointF(xOffset - 2, (i * ihp) + yOffset + Colors.contentStartY - i*0.5))
anim.setPosAt(1.00, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
movieShake.append(anim)
# Create next-menu top-out-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_OUT)
anim.hideOnFinished = True
anim.setDuration((200 + (30 * i)) * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(0.70, QtCore.QPointF(xOffset, yOffset + Colors.contentStartY))
anim.setPosAt(1.00, QtCore.QPointF(-iw, yOffset + Colors.contentStartY))
movieNextTopOut.append(anim)
# Create next-menu bottom-out-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_OUT)
anim.hideOnFinished = True
anim.setDuration((200 + (30 * i)) * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(0.70, QtCore.QPointF(xOffset, (maxExamples * ihp) + yOffset + Colors.contentStartY))
anim.setPosAt(1.00, QtCore.QPointF(-iw, (maxExamples * ihp) + yOffset + Colors.contentStartY))
movieNextBottomOut.append(anim)
# Create next-menu top-in-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_IN)
anim.setDuration((700 - (30 * i)) * Colors.animSpeedButtons)
anim.setStartPos(QtCore.QPointF(-iw, yOffset + Colors.contentStartY))
anim.setPosAt(0.30, QtCore.QPointF(xOffset, yOffset + Colors.contentStartY))
anim.setPosAt(1.00, QtCore.QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
movieNextTopIn.append(anim)
# Create next-menu bottom-in-animation.
reverse = maxExamples - i
#.........這裏部分代碼省略.........
示例7: MenuManager
#.........這裏部分代碼省略.........
elif userCode == MenuManager.BACK:
if self.currentMenuCode == MenuManager.MENU2:
# Out.
self.score.queueMovie(self.currentInfo + ' -out',
Score.NEW_ANIMATION_ONLY)
self.score.queueMovie(self.currentInfo + ' -buttons -out',
Score.NEW_ANIMATION_ONLY)
if self.qmlRoot is not None:
self.qmlRoot.setProperty('show', False)
# Book-keeping.
self.currentMenuCode = MenuManager.MENU1
self.currentMenuButtons = self.currentCategory + ' -buttons'
self.currentInfo = self.currentCategory + ' -info'
# In/shake.
self.score.queueMovie('upndown -shake')
self.score.queueMovie(self.currentMenu + ' -shake')
self.score.queueMovie(self.currentInfo,
Score.NEW_ANIMATION_ONLY)
self.score.queueMovie(self.currentInfo + ' -buttons',
Score.NEW_ANIMATION_ONLY)
if not Colors.noTicker:
self.ticker.doIntroTransitions = False
self.tickerInAnim.startDelay = 500
self.score.queueMovie('ticker', Score.NEW_ANIMATION_ONLY)
elif self.currentMenuCode != MenuManager.ROOT:
self.itemSelected(MenuManager.ROOT, Colors.rootMenuName)
# Update back and more buttons.
if self.info.setdefault(self.currentMenu, {}).get('back'):
back_state = TextButton.OFF
else:
back_state = TextButton.DISABLED
if self.info[self.currentMenu].get('more'):
more_state = TextButton.OFF
else:
more_state = TextButton.DISABLED
self.upButton.setState(back_state)
self.downButton.setState(more_state)
if self.score.hasQueuedMovies():
self.score.playQue()
# Playing new movies might include loading etc., so ignore the FPS
# at this point.
self.window.fpsHistory = []
def showDocInAssistant(self, name):
url = self.resolveDocUrl(name)
Colors.debug("Sending URL to Assistant:", url)
# Start assistant if it's not already running.
if self.assistantProcess.state() != QtCore.QProcess.Running:
app = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.BinariesPath) + QtCore.QDir.separator()
if sys.platform == 'darwin':
app += 'Assistant.app/Contents/MacOS/Assistant'
else:
app += 'assistant'
args = ['-enableRemoteControl']
self.assistantProcess.start(app, args)
示例8: MenuManager
#.........這裏部分代碼省略.........
self.score.queueMovie(moreMenu + ' -top_in', Score.FROM_START,
Score.UNLOCK_ITEMS)
self.currentMenu = moreMenu
elif userCode == MenuManager.BACK:
if self.currentMenuCode == MenuManager.MENU2:
# Out.
self.score.queueMovie(self.currentInfo + ' -out',
Score.NEW_ANIMATION_ONLY)
self.score.queueMovie(self.currentInfo + ' -buttons -out',
Score.NEW_ANIMATION_ONLY)
# Book-keeping.
self.currentMenuCode = MenuManager.MENU1
self.currentMenuButtons = self.currentCategory + ' -buttons'
self.currentInfo = self.currentCategory + ' -info'
# In/shake.
self.score.queueMovie('upndown -shake')
self.score.queueMovie(self.currentMenu + ' -shake')
self.score.queueMovie(self.currentInfo,
Score.NEW_ANIMATION_ONLY)
self.score.queueMovie(self.currentInfo + ' -buttons',
Score.NEW_ANIMATION_ONLY)
if not Colors.noTicker:
self.ticker.doIntroTransitions = False
self.tickerInAnim.setStartDelay(500)
self.score.queueMovie('ticker', Score.NEW_ANIMATION_ONLY)
elif self.currentMenuCode != MenuManager.ROOT:
self.itemSelected(MenuManager.ROOT, Colors.rootMenuName)
# Update back and more buttons.
if self.info.setdefault(self.currentMenu, {}).get('back'):
back_state = TextButton.OFF
else:
back_state = TextButton.DISABLED
if self.info[self.currentMenu].get('more'):
more_state = TextButton.OFF
else:
more_state = TextButton.DISABLED
self.upButton.setState(back_state)
self.downButton.setState(more_state)
if self.score.hasQueuedMovies():
self.score.playQue()
# Playing new movies might include loading etc., so ignore the FPS
# at this point.
self.window.fpsHistory = []
def showDocInAssistant(self, name):
url = self.resolveDocUrl(name)
Colors.debug("Sending URL to Assistant:", url)
# Start assistant if it's not already running.
if self.assistantProcess.state() != QProcess.Running:
app = QLibraryInfo.location(QLibraryInfo.BinariesPath) + QDir.separator()
if sys.platform == 'darwin':
app += 'Assistant.app/Contents/MacOS/Assistant'
else:
app += 'assistant'
args = ['-enableRemoteControl']
self.assistantProcess.start(app, args)
示例9: createMenu
def createMenu(self, category, type):
sw = self.window.scene.sceneRect().width()
xOffset = 15
yOffset = 10
maxExamples = Colors.menuCount
menuIndex = 1
name = category.getAttribute('name')
currentNode = self._first_element(category)
currentMenu = '%s -menu%d' % (name, menuIndex)
while currentNode is not None:
movieIn = self.score.insertMovie(currentMenu)
movieOut = self.score.insertMovie(currentMenu + ' -out')
movieNextTopOut = self.score.insertMovie(currentMenu + ' -top_out')
movieNextBottomOut = self.score.insertMovie(currentMenu + ' -bottom_out')
movieNextTopIn = self.score.insertMovie(currentMenu + ' -top_in')
movieNextBottomIn = self.score.insertMovie(currentMenu + ' -bottom_in')
movieShake = self.score.insertMovie(currentMenu + ' -shake')
i = 0
while currentNode is not None and i < maxExamples:
# Create a normal menu button.
label = currentNode.getAttribute('name')
item = TextButton(label, TextButton.LEFT, type,
self.window.mainSceneRoot)
item.setRecursiveVisible(False)
item.setZValue(10)
ih = item.sceneBoundingRect().height()
iw = item.sceneBoundingRect().width()
ihp = ih + 3
# Create in-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_IN)
anim.setDuration(1000 + (i * 20))
anim.setStartValue(QPointF(xOffset, -ih))
anim.setKeyValueAt(0.20, QPointF(xOffset, -ih))
anim.setKeyValueAt(0.50, QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY + (10 * float(i / 4.0))))
anim.setKeyValueAt(0.60, QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setKeyValueAt(0.70, QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY + (5 * float(i / 4.0))))
anim.setKeyValueAt(0.80, QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setKeyValueAt(0.90, QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY + (2 * float(i / 4.0))))
anim.setEndValue(QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
movieIn.append(anim)
# Create out-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_OUT)
anim.setHideOnFinished(True)
anim.setDuration(700 + (30 * i))
anim.setStartValue(QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setKeyValueAt(0.60, QPointF(xOffset, 600 - ih - ih))
anim.setKeyValueAt(0.65, QPointF(xOffset + 20, 600 - ih))
anim.setEndValue(QPointF(sw + iw, 600 - ih))
movieOut.append(anim)
# Create shake-animation.
anim = DemoItemAnimation(item)
anim.setDuration(700)
anim.setStartValue(QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setKeyValueAt(0.55, QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY - i*2.0))
anim.setKeyValueAt(0.70, QPointF(xOffset - 10, (i * ihp) + yOffset + Colors.contentStartY - i*1.5))
anim.setKeyValueAt(0.80, QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY - i*1.0))
anim.setKeyValueAt(0.90, QPointF(xOffset - 2, (i * ihp) + yOffset + Colors.contentStartY - i*0.5))
anim.setEndValue(QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
movieShake.append(anim)
# Create next-menu top-out-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_OUT)
anim.setHideOnFinished(True)
anim.setDuration(200 + (30 * i))
anim.setStartValue(QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setKeyValueAt(0.70, QPointF(xOffset, yOffset + Colors.contentStartY))
anim.setEndValue(QPointF(-iw, yOffset + Colors.contentStartY))
movieNextTopOut.append(anim)
# Create next-menu bottom-out-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_OUT)
anim.setHideOnFinished(True)
anim.setDuration(200 + (30 * i))
anim.setStartValue(QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
anim.setKeyValueAt(0.70, QPointF(xOffset, (maxExamples * ihp) + yOffset + Colors.contentStartY))
anim.setEndValue(QPointF(-iw, (maxExamples * ihp) + yOffset + Colors.contentStartY))
movieNextBottomOut.append(anim)
# Create next-menu top-in-animation.
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_IN)
anim.setDuration(700 - (30 * i))
anim.setStartValue(QPointF(-iw, yOffset + Colors.contentStartY))
anim.setKeyValueAt(0.30, QPointF(xOffset, yOffset + Colors.contentStartY))
anim.setEndValue(QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
movieNextTopIn.append(anim)
# Create next-menu bottom-in-animation.
reverse = maxExamples - i
anim = DemoItemAnimation(item, DemoItemAnimation.ANIM_IN)
anim.setDuration(1000 - (30 * reverse))
anim.setStartValue(QPointF(-iw, (maxExamples * ihp) + yOffset + Colors.contentStartY))
anim.setKeyValueAt(0.30, QPointF(xOffset, (maxExamples * ihp) + yOffset + Colors.contentStartY))
anim.setEndValue(QPointF(xOffset, (i * ihp) + yOffset + Colors.contentStartY))
movieNextBottomIn.append(anim)
#.........這裏部分代碼省略.........