本文整理汇总了Python中navigation.Navigation.moveDown方法的典型用法代码示例。如果您正苦于以下问题:Python Navigation.moveDown方法的具体用法?Python Navigation.moveDown怎么用?Python Navigation.moveDown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类navigation.Navigation
的用法示例。
在下文中一共展示了Navigation.moveDown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Interface
# 需要导入模块: from navigation import Navigation [as 别名]
# 或者: from navigation.Navigation import moveDown [as 别名]
class Interface(object):
def __init__(self):
self._lcd_plate = LcdPlate()
self._navigation = Navigation()
self.initScreen()
def initScreen(self):
self._lcd_plate.clear()
self._lcd_plate.setBackLightCyan()
# Set the screen to the top of the menu
self._lcd_plate.message(self._navigation.currentItem())
def pressedDown(self):
self._navigation.moveDown()
def pressedLeft(self):
self._navigation.moveLeft()
def pressedRight(self):
self._navigation.moveRight()
def pressedSelect(self):
# TODO: Actually run the process that the navigation items expects
self._lcd_plate.clear()
self._lcd_plate.message("In Select")
def pressedUp(self):
self._navigation.moveUp()
def run(self):
while True:
for button in self._lcd_plate.buttons():
# Check if a button is pressed & there has been pause in pressing the buttons
if self._lcd_plate.pressedSinceLastCheck(button):
# Call function of the button pressed
getattr(self, 'pressed' + self._lcd_plate.titleOfButton(button))()
self.initScreen()