本文整理汇总了Python中wx.WXK_NUMPAD_ENTER属性的典型用法代码示例。如果您正苦于以下问题:Python wx.WXK_NUMPAD_ENTER属性的具体用法?Python wx.WXK_NUMPAD_ENTER怎么用?Python wx.WXK_NUMPAD_ENTER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.WXK_NUMPAD_ENTER属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onFrameCharHook
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_NUMPAD_ENTER [as 别名]
def onFrameCharHook(self, event):
keyCode = event.GetKeyCode()
if keyCode == wx.WXK_F4:
if event.AltDown():
self.destroyMenu()
elif keyCode == wx.WXK_RETURN or keyCode == wx.WXK_NUMPAD_ENTER:
self.GoTo()
elif keyCode == wx.WXK_RIGHT or keyCode == wx.WXK_NUMPAD_RIGHT:
self.MoveCursor(1)
elif keyCode == wx.WXK_ESCAPE:
self.destroyMenu()
elif keyCode == wx.WXK_UP or keyCode == wx.WXK_NUMPAD_UP:
self.Turn(1)
elif keyCode == wx.WXK_DOWN or keyCode == wx.WXK_NUMPAD_DOWN:
self.Turn(-1)
elif keyCode == wx.WXK_LEFT or keyCode == wx.WXK_NUMPAD_LEFT:
self.MoveCursor(-1)
else:
event.Skip()
示例2: OnVariablesFilterKeyDown
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_NUMPAD_ENTER [as 别名]
def OnVariablesFilterKeyDown(self, event):
if self.VariablesFilterFirstCharacter:
keycode = event.GetKeyCode()
if keycode not in [wx.WXK_RETURN,
wx.WXK_NUMPAD_ENTER]:
self.VariablesFilterFirstCharacter = False
if keycode not in NAVIGATION_KEYS:
self.VariablesFilter.SetValue("")
if keycode not in [wx.WXK_DELETE,
wx.WXK_NUMPAD_DELETE,
wx.WXK_BACK]:
event.Skip()
else:
event.Skip()
示例3: OnNodesFilterKeyDown
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_NUMPAD_ENTER [as 别名]
def OnNodesFilterKeyDown(self, event):
if self.NodesFilterFirstCharacter:
keycode = event.GetKeyCode()
if keycode not in [wx.WXK_RETURN,
wx.WXK_NUMPAD_ENTER]:
self.NodesFilterFirstCharacter = False
if keycode not in NAVIGATION_KEYS:
self.NodesFilter.SetValue("")
if keycode not in [wx.WXK_DELETE,
wx.WXK_NUMPAD_DELETE,
wx.WXK_BACK]:
event.Skip()
else:
event.Skip()
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_NUMPAD_ENTER [as 别名]
def __init__(self, acceptableChars="0123456789+-"):
wx.PyValidator.__init__(self)
self.Bind(wx.EVT_CHAR, self._OnChar)
self.acceptableChars = acceptableChars
self.acceptableCodes = [ord(x) for x in self.acceptableChars]
stdEditKeys = [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER, wx.WXK_ESCAPE, wx.WXK_CANCEL,
wx.WXK_TAB, wx.WXK_BACK, wx.WXK_DELETE, wx.WXK_HOME, wx.WXK_END,
wx.WXK_LEFT, wx.WXK_RIGHT]
self.acceptableCodes.extend(stdEditKeys)
示例5: OnKeyPressed
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_NUMPAD_ENTER [as 别名]
def OnKeyPressed(self, event):
if self.CallTipActive():
self.CallTipCancel()
key = event.GetKeyCode()
current_pos = self.GetCurrentPos()
selected = self.GetSelection()
text_selected = selected[0] != selected[1]
# Test if caret is before Windows like new line
text = self.GetText()
if current_pos < len(text) and ord(text[current_pos]) == 13:
newline_size = 2
else:
newline_size = 1
# Disable to type any character in section header lines
if self.GetLineState(self.LineFromPosition(current_pos)) and \
not text_selected and \
key not in NAVIGATION_KEYS + [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]:
return
# Disable to delete line between code and header lines
elif (self.GetCurLine()[0].strip() != "" and not text_selected and
(key == wx.WXK_BACK and
self.GetLineState(self.LineFromPosition(max(0, current_pos - 1))) or
key in [wx.WXK_DELETE, wx.WXK_NUMPAD_DELETE] and
self.GetLineState(self.LineFromPosition(min(len(text), current_pos + newline_size))))):
return
elif key == 32 and event.ControlDown():
# Tips
if event.ShiftDown():
pass
# Code completion
else:
self.AutoCompSetIgnoreCase(False) # so this needs to match
keywords = self.KEYWORDS + [var["Name"]
for var in self.Controler.GetVariables()]
keywords.sort()
self.AutoCompShow(0, " ".join(keywords))
else:
event.Skip()
示例6: _HandleChar
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_NUMPAD_ENTER [as 别名]
def _HandleChar(self, evt):
if evt.GetKeyCode() == wx.WXK_F2 and not self.IsCellEditing():
return self._PossibleStartCellEdit(self.GetFocusedRow(), self.GetPrimaryColumnIndex())
# We have to catch Return/Enter/Escape here since some types of controls
# (e.g. ComboBox, UserControl) don't trigger key events that we can listen for.
# Treat Return or Enter as committing the current edit operation unless the control
# is a multiline text control, in which case we treat it as data
if evt.GetKeyCode() in (wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER) and self.IsCellEditing():
if self.cellEditor and self.cellEditor.HasFlag(wx.TE_MULTILINE):
return evt.Skip()
else:
return self.FinishCellEdit()
# Treat Escape as cancel the current edit operation
if evt.GetKeyCode() in (wx.WXK_ESCAPE, wx.WXK_CANCEL) and self.IsCellEditing():
return self.CancelCellEdit()
# Tab to the next editable column
if evt.GetKeyCode() == wx.WXK_TAB and self.IsCellEditing():
return self._HandleTabKey(evt.ShiftDown())
# Space bar with a selection on a listview with checkboxes toggles the checkboxes
if (evt.GetKeyCode() == wx.WXK_SPACE and
not self.IsCellEditing() and
self.checkStateColumn is not None and
self.GetSelectedItemCount() > 0):
return self._ToggleCheckBoxForSelection()
if not self.IsCellEditing():
if self._HandleTypingEvent(evt):
return
if not self.IsCellEditing() and self.handleStandardKeys:
# Copy selection on Ctrl-C
# Why is Ctrl-C represented by 3?! Is this Windows only?
if (evt.GetKeyCode() == 3):
self.CopySelectionToClipboard()
return
# Select All on Ctrl-A
if (evt.GetKeyCode() == 1):
self.SelectAll()
return
evt.Skip()