def __init__(self, parent, sourceKey): KeyDisplayPane.__init__(self, parent, border=10, displayMode=DISPLAY_MODE_DYNAMIC_RESIZE) self._sourceKey = sourceKey self._dispKey = DisplayKey(sourceKey.handle, Rect(0, 0, 1.8, 1.8)) self._displayKeys = {sourceKey.handle: self._dispKey} self._updateKeys() KeyDisplayPane._initKeys(self)
def __init__(self, parent, sourceKey): KeyDisplayPane.__init__(self, parent, border=10, displayMode=DISPLAY_MODE_WRAPPED) self._displayKeys = {} KeyDisplayPane._initKeys(self) self.Bind(wx.EVT_PAINT, self.OnPaint) self._keySize = Size(6.0, 2.5) self._keySpacing = Size(0.2, 0.2) keyRect = Rect(0, 0, *self._keySize) handle = None if sourceKey.usage: handle = sourceKey.usage.MakeHandle() elif sourceKey.mode: handle = "mode:%s" % sourceKey.mode elif len(sourceKey.macro) > 0: for (i, macroKey) in enumerate(sourceKey.macro): handle = macroKey.MakeHandle(i) self._displayKeys[handle] = DisplayKey(handle, keyRect) self._orderedKeyHandles.append(handle) handle = None if handle is not None: dispKey = DisplayKey(handle, keyRect) self._displayKeys[handle] = dispKey self._orderedKeyHandles.append(handle) self._updateKeys()
def __init__(self, parent, keymap): self._kb = Model.keyboard KeyDisplayPane.__init__(self, parent, border=10, displayMode=DISPLAY_MODE_DYNAMIC_RESIZE) self._keymap = keymap ModelChangeNotification.AddObserver(self.NotifyModelChange) self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE)) dt = DestDropTarget(self) self.SetDropTarget(dt)
def __init__(self, parent): KeyDisplayPane.__init__(self, parent, border=10, displayMode=DISPLAY_MODE_WRAPPED) self._category = None CategoryChangeNotification.AddObserver(self.NotifyCategoryChange) color = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW) self.SetBackgroundColour(color)
def __init__(self, parent): KeyDisplayPane.__init__(self, parent, border=0, displayMode=DISPLAY_MODE_DYNAMIC_RESIZE) self._initKeys()