本文整理汇总了Python中direct.gui.DirectGui.DirectScrolledList.scrollTo方法的典型用法代码示例。如果您正苦于以下问题:Python DirectScrolledList.scrollTo方法的具体用法?Python DirectScrolledList.scrollTo怎么用?Python DirectScrolledList.scrollTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类direct.gui.DirectGui.DirectScrolledList
的用法示例。
在下文中一共展示了DirectScrolledList.scrollTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PartyEditor
# 需要导入模块: from direct.gui.DirectGui import DirectScrolledList [as 别名]
# 或者: from direct.gui.DirectGui.DirectScrolledList import scrollTo [as 别名]
#.........这里部分代码省略.........
for item in self.elementList['items']:
item.clearPartyGrounds()
self.initPartyClock()
if self.currentElement:
self.currentElement.checkSoldOutAndPaidStatusAndAffordability()
def buyCurrentElement(self):
if self.currentElement:
purchaseSuccessful = self.currentElement.buyButtonClicked()
if purchaseSuccessful:
self.handleMutuallyExclusiveActivities()
else:
self.partyPlanner.instructionLabel['text'] = TTLocalizer.PartyPlannerEditorInstructionsNoRoom
def mouseEnterTrash(self, mouseEvent):
self.mouseOverTrash = True
self.oldInstructionText = self.partyPlanner.instructionLabel['text']
self.partyPlanner.instructionLabel['text'] = TTLocalizer.PartyPlannerEditorInstructionsTrash
def mouseExitTrash(self, mouseEvent):
self.mouseOverTrash = False
self.partyPlanner.instructionLabel['text'] = self.oldInstructionText
def enterHidden(self):
PartyEditor.notify.debug('Enter Hidden')
def exitHidden(self):
PartyEditor.notify.debug('Exit Hidden')
def enterIdle(self, fromDragging = False):
PartyEditor.notify.debug('Enter Idle')
if not fromDragging:
self.elementList.scrollTo(0)
self.elementList['items'][0].elementSelectedFromList()
self.currentElement = self.elementList['items'][self.elementList.getSelectedIndex()]
self.currentElement.checkSoldOutAndPaidStatusAndAffordability()
self.partyPlanner.instructionLabel['text'] = TTLocalizer.PartyPlannerEditorInstructionsIdle
self.updateCostsAndBank()
self.handleMutuallyExclusiveActivities()
def handleMutuallyExclusiveActivities(self):
mutSet = self.getMutuallyExclusiveActivities()
if not mutSet:
return
currentActivities = self.partyEditorGrid.getActivitiesElementsOnGrid()
lastActivity = self.partyEditorGrid.lastActivityIdPlaced
for act in currentActivities:
if act.id in mutSet and not lastActivity == act.id:
act.removeFromGrid()
removedName = TTLocalizer.PartyActivityNameDict[act.id]['editor']
addedName = TTLocalizer.PartyActivityNameDict[lastActivity]['editor']
instr = TTLocalizer.PartyPlannerEditorInstructionsRemoved % {'removed': removedName,
'added': addedName}
self.partyPlanner.instructionLabel['text'] = instr
self.updateCostsAndBank()
def getMutuallyExclusiveActivities(self):
currentActivities = self.partyEditorGrid.getActivitiesOnGrid()
actSet = Set([])
for act in currentActivities:
actSet.add(act[0])
result = None
for mutuallyExclusiveTuples in PartyGlobals.MutuallyExclusiveActivities:
mutSet = Set(mutuallyExclusiveTuples)