本文整理汇总了Python中PyGUIBase.PyGUIBase类的典型用法代码示例。如果您正苦于以下问题:Python PyGUIBase类的具体用法?Python PyGUIBase怎么用?Python PyGUIBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PyGUIBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, component = None):
PyGUIBase.__init__(self, component)
self.__history = []
self.__historyShown = -1
if component == None:
self.component = GUI.Window('system/maps/col_white.bmp')
self.component.colour = (0, 0, 0, 255)
self.component.materialFX = 'SOLID'
self.component.height = 0.75
self.component.width = 1.5
self.component.addChild(ScrollableText().component, 'buffer')
self.component.buffer.colour = (0, 0, 0, 0)
self.component.buffer.widthMode = 'CLIP'
self.component.buffer.width = 2.0
self.component.buffer.height = 1.8
self.component.buffer.verticalAnchor = 'TOP'
self.component.buffer.verticalPositionMode = 'CLIP'
self.component.buffer.position.y = 1.0
self.component.addChild(EditField().component, 'editField')
self.component.editField.colour = (64, 64, 64, 255)
self.component.editField.verticalPositionMode = 'CLIP'
self.component.editField.verticalAnchor = 'BOTTOM'
self.component.editField.position.y = -1.0
self.component.editField.height = 0.2
self.component.editField.widthMode = 'CLIP'
self.component.editField.width = 2.0
self.component.script = self
self.onBound()
registerDeviceListener(self)
return
示例2: onLoad
def onLoad(self, dataSection):
PyGUIBase.onLoad(self, dataSection)
self.buttonStyle = dataSection.readString('buttonStyle')
self.buttonDisabled = dataSection.readBool('buttonDisabled', False)
self.groupName = dataSection.readString('groupName')
self.groupDepth = dataSection.readInt('groupDepth', 1)
VisualStateComponent.onLoad(self, dataSection)
示例3: __init__
def __init__(self, component = None):
PyGUIBase.__init__(self, component)
self.cursorIndex = 0
self.scrollInPixels = 0
self.onEnter = None
self.onEscape = None
self.maxLength = 256
self.enabled = True
self.enableIME = False
self.focusViaMouse = True
self.focusObserver = None
self.shouldAdjustClipping = False
self.__externalKeyEventHandler = None
self.__allowAutoDefocus = True
if self.component is None:
self.component = GUI.Window('system/maps/col_white.bmp')
self.component.colour = (0, 0, 0, 255)
self.component.materialFX = 'BLEND'
self.component.width = 0.75
self.component.height = 0.1
self.component.heightMode = 'CLIP'
self.component.widthMode = 'CLIP'
self.component.minScroll = (-100, -100)
self.component.maxScroll = (+100, +100)
self.component.script = self
self.onBound()
self.autoSelectionFonts = ['default_medium.font']
self.idealVisibleCharacters = 80
registerDeviceListener(self)
return
示例4: onSave
def onSave(self, dataSection):
PyGUIBase.onSave(self, dataSection)
dataSection.writeBool('isHorizontal', self.isHorizontal)
dataSection.writeFloat('minValue', self.minValue)
dataSection.writeFloat('maxValue', self.maxValue)
dataSection.writeFloat('stepSize', self.stepSize)
VisualStateComponent.onSave(self, dataSection)
示例5: handleMouseEnterEvent
def handleMouseEnterEvent(self, comp):
PyGUIBase.handleMouseEnterEvent(self, comp)
slider = self.component.parent.script
slider.handleMouseEnterEvent(comp)
slider.thumbPressed = slider.thumbPressed and BigWorld.isKeyDown(Keys.KEY_LEFTMOUSE)
slider._updateVisualState(hover=True)
return True
示例6: onLoad
def onLoad(self, dataSection):
PyGUIBase.onLoad(self, dataSection)
self.isHorizontal = dataSection.readBool('isHorizontal', self.isHorizontal)
self.minValue = dataSection.readFloat('minValue', self.minValue)
self.maxValue = dataSection.readFloat('maxValue', self.maxValue)
self.stepSize = dataSection.readFloat('stepSize', self.stepSize)
VisualStateComponent.onLoad(self, dataSection)
示例7: __init__
def __init__(self, component = None):
PyGUIBase.__init__(self, component)
if component == None:
self.component = GUI.Window('system/maps/col_white.bmp')
self.component.colour = (128, 128, 128, 255)
self.component.widthMode = 'CLIP'
self.component.heightMode = 'CLIP'
self.component.addChild(GUI.Text(''), 'text')
self.component.text.horizontalAnchor = 'LEFT'
self.component.text.horizontalPositionMode = 'CLIP'
self.component.text.verticalAnchor = 'BOTTOM'
self.component.text.verticalPositionMode = 'CLIP'
self.component.text.position = (-1.0, -1.0, 0.5)
self.component.text.multiline = True
self.component.text.richFormatting = True
self.component.text.colour = (255, 255, 255, 255)
self.onBound()
self.component.script = self
self.maxLines = 255
self.wordWrap = True
self.minVisibleLines = 4
self.autoSelectionFonts = ['default_medium.font']
self.idealCharactersPerLine = 80
self.lines = []
self.scrollIndex = 0
self._displayedLineCount = 0
registerDeviceListener(self)
return
示例8: __init__
def __init__(self, component = None):
PyGUIBase.__init__(self, component)
self.component.script = self
self.mozillaHandlesKeyboard = True
self.prevCursorManagement = True
self.focusObserver = None
return
示例9: doLayout
def doLayout(self, parent):
PyGUIBase.doLayout(self, parent)
y = 1.0
totalHeight = 0
itemHeight = 0
screenWidth = BigWorld.screenWidth()
for discard, i in self.component.items.children:
i.position.y = y
thisItemHeight = i.script.adjustFont(screenWidth)
if itemHeight == 0 and thisItemHeight != 0:
itemHeight = thisItemHeight
y = y - itemHeight - ITEM_MARGIN
totalHeight += itemHeight + ITEM_MARGIN
self.component.items.height = totalHeight
heightMode = self.component.items.heightMode
self.component.items.heightMode = 'LEGACY'
self.totalHeightScreenClip = float(self.component.items.height)
self.component.items.heightMode = heightMode
self.items.script.maxScroll[1] = max(0, self.totalHeightScreenClip - self.component.height)
self.items.script.minScroll[1] = 0
if self.items.script.maxScroll[1] == 0.0:
self.scrollUp.visible = 0
self.scrollDown.visible = 0
self.maxVisibleItems = int(2.0 / itemHeight) if itemHeight > 0 else 1
示例10: __init__
def __init__(self, component):
PyGUIBase.__init__(self, component)
self.minScroll = [0, 0]
self.maxScroll = [0, 0]
self.scroll = [0, 0]
self.scrollSpeed = 0.5
self.scrollTransform = Math.Matrix()
self.scrollTransform.setIdentity()
示例11: onSave
def onSave(self, dataSection):
PyGUIBase.onSave(self, dataSection)
dataSection.writeBool('buttonDisabled', self.buttonDisabled)
dataSection.writeString('buttonStyle', self.buttonStyle)
if self.groupName != '':
dataSection.writeString('groupName', self.groupName)
dataSection.writeInt('groupDepth', self.groupDepth)
VisualStateComponent.onSave(self, dataSection)
示例12: onLoad
def onLoad(self, dataSection):
PyGUIBase.onLoad(self, dataSection)
self.maxLines = dataSection.readInt('maxLines', self.maxLines)
self.wordWrap = dataSection.readBool('wordWrap', self.wordWrap)
self.idealCharactersPerLine = dataSection.readInt('idealCharactersPerLine', self.idealCharactersPerLine)
fonts = dataSection.readStrings('autoFont')
if len(fonts) > 0:
self.autoSelectionFonts = fonts
示例13: __init__
def __init__(self, component=None):
PyGUIBase.__init__(self, component)
self.lines = []
self.lines.append(GUI.Text(""))
self.lines[0].horizontalAnchor = "LEFT"
self.lines[0].verticalAnchor = "TOP"
self.transcript = ""
self.component.addChild(self.lines[0])
示例14: __init__
def __init__(self, component, isHorizontal = True):
PyGUIBase.__init__(self, component)
DraggableComponent.__init__(self, isHorizontal, not isHorizontal, True)
self.component.focus = True
self.component.mouseButtonFocus = True
self.component.moveFocus = True
self.component.crossFocus = True
self.onDragging = self._onDragging
示例15: __init__
def __init__(self, component = None):
PyGUIBase.__init__(self, component)
self.lines = []
self.lines.append(GUI.Text(''))
self.lines[0].horizontalAnchor = 'LEFT'
self.lines[0].verticalAnchor = 'TOP'
self.transcript = ''
self.component.addChild(self.lines[0])