本文整理汇总了Python中SCElement.SCElement类的典型用法代码示例。如果您正苦于以下问题:Python SCElement类的具体用法?Python SCElement怎么用?Python SCElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SCElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, title, menu = None):
SCElement.__init__(self)
self.title = title
scGui = loader.loadModel(SCMenu.GuiModelName)
self.scArrow = scGui.find('**/chatArrow')
self.menu = None
self.setMenu(menu)
示例2: privSetSettingsRef
def privSetSettingsRef(self, settingsRef):
SCElement.privSetSettingsRef(self, settingsRef)
if self._handleWhisperModeFC is None:
self._handleWhisperModeFC = FunctionCall(self._handleWhisperModeSVChanged, self._handleWhisperModeSV)
self._handleWhisperModeFC.pushCurrentState()
self._handleWhisperModeSV.set(self.settingsRef is not None and not self.isWhisperable())
return
示例3: destroy
def destroy(self):
self._handleWhisperModeSV.set(False)
if self._handleWhisperModeFC:
self._handleWhisperModeFC.destroy()
self._handleWhisperModeSV.destroy()
SCElement.destroy(self)
示例4: enterVisible
def enterVisible(self):
SCElement.enterVisible(self)
if hasattr(self, 'lastEmoteIconColor'):
if self.getEmoteIconColor() != self.lastEmoteIconColor:
self.invalidate()
def handleWhisperModeChange(whisperMode, self = self):
if self.hasLinkedEmote():
if self.isVisible() and not self.isWhispering():
self.updateEmoteIcon()
self.accept(self.getEventName(SCWhisperModeChangeEvent), handleWhisperModeChange)
def handleEmoteEnableStateChange(self = self):
if self.hasLinkedEmote():
if self.isVisible() and not self.isWhispering():
self.updateEmoteIcon()
if self.hasLinkedEmote():
if Emote.globalEmote:
self.accept(Emote.globalEmote.EmoteEnableStateChanged, handleEmoteEnableStateChange)
示例5: __init__
def __init__(self, linkedEmote = None):
SCElement.__init__(self)
self.setLinkedEmote(linkedEmote)
scGui = loader.loadModel(SCMenu.GuiModelName)
self.emotionIcon = scGui.find('**/emotionIcon')
self.setDisabled(False)
self._SCTerminal__numCharges = -1
self._handleWhisperModeSV = StateVar(False)
self._handleWhisperModeFC = None
示例6: enterActive
def enterActive(self):
SCElement.enterActive(self)
self.showMenu()
if hasattr(self, 'button'):
r, g, b = self.getColorScheme().getMenuHolderActiveColor()
a = self.getColorScheme().getAlpha()
self.button.frameStyle[DGG.BUTTON_READY_STATE].setColor(r, g, b, a)
self.button.updateFrameStyle()
else:
self.notify.warning('SCMenuHolder has no button (has finalize been called?).')
示例7: finalize
def finalize(self, dbArgs = {}):
if not self.isDirty():
return
args = {}
if self.hasLinkedEmote():
self.lastEmoteIconColor = self.getEmoteIconColor()
self.emotionIcon.setColorScale(*self.lastEmoteIconColor)
args.update({'image': self.emotionIcon,
'image_pos': (self.width - 0.6, 0, -self.height * 0.5)})
if self.isDisabled():
args.update({'rolloverColor': (0, 0, 0, 0),
'pressedColor': (0, 0, 0, 0),
'rolloverSound': None,
'clickSound': None,
'text_fg': self.getColorScheme().getTextDisabledColor() + (1,)})
args.update(dbArgs)
SCElement.finalize(self, dbArgs=args)
return
示例8: finalize
def finalize(self, dbArgs = { }):
if not self.isDirty():
return None
(r, g, b) = self.getColorScheme().getArrowColor()
a = self.getColorScheme().getAlpha()
self.scArrow.setColorScale(r, g, b, a)
if self.menu is not None:
self.menu.setPos(self.getMenuOffset())
if self.isActive():
(r, g, b) = self.getColorScheme().getMenuHolderActiveColor()
a = self.getColorScheme().getAlpha()
frameColor = (r, g, b, a)
else:
frameColor = SCMenuHolder.DefaultFrameColor
args = {
'image': self.scArrow,
'image_pos': (self.width - 0.5, 0, -(self.height) * 0.5),
'frameColor': frameColor }
args.update(dbArgs)
SCElement.finalize(self, dbArgs = args)
示例9: getMinDimensions
def getMinDimensions(self):
width, height = SCElement.getMinDimensions(self)
if self.hasLinkedEmote():
width += 1.3
return (width, height)
示例10: onMouseClick
def onMouseClick(self, event):
if not self.isDisabled():
SCElement.onMouseClick(self, event)
self.handleSelect()
示例11: exitVisible
def exitVisible(self):
SCElement.exitVisible(self)
self.ignore(self.getEventName(SCWhisperModeChangeEvent))
if Emote.globalEmote:
self.ignore(Emote.globalEmote.EmoteEnableStateChanged)
示例12: exitActive
def exitActive(self):
SCElement.exitActive(self)
self.hideMenu()
self.button.frameStyle[DGG.BUTTON_READY_STATE].setColor(*SCMenuHolder.DefaultFrameColor)
self.button.updateFrameStyle()
示例13: onMouseClick
def onMouseClick(self, event):
SCElement.enterActive(self)
self.parentMenu.memberSelected(self)
示例14: destroy
def destroy(self):
if self.menu is not None:
self.menu.destroy()
self.menu = None
SCElement.destroy(self)
return
示例15: invalidate
def invalidate(self):
SCElement.invalidate(self)
if self.menu is not None:
self.menu.invalidate()
return