本文整理汇总了Python中wx.WXK_RETURN属性的典型用法代码示例。如果您正苦于以下问题:Python wx.WXK_RETURN属性的具体用法?Python wx.WXK_RETURN怎么用?Python wx.WXK_RETURN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.WXK_RETURN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_char_editor
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [as 别名]
def on_char_editor(self, event):
# EVT_CHAR_HOOK handler
keycode = event.KeyCode
if keycode not in (wx.WXK_RETURN, wx.WXK_ESCAPE, wx.WXK_UP, wx.WXK_DOWN):
event.Skip()
return
if keycode == wx.WXK_ESCAPE:
self._update_editors()
return
self._on_editor_edited(event)
if keycode==wx.WXK_UP:
self._set_row_index( self.cur_row - 1 )
elif keycode==wx.WXK_DOWN:
self._set_row_index( self.cur_row + 1 )
self._update_editors()
示例2: onFrameCharHook
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [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()
示例3: OnKeyDown
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [as 别名]
def OnKeyDown(self, event):
""" Do some work when the user press on the keys:
up and down: move the cursor
"""
keycode = event.GetKeyCode()
if keycode in [wx.WXK_DOWN, wx.WXK_UP]:
self.PopupListBox()
if keycode == wx.WXK_DOWN:
self.listbox.MoveSelection(1)
else:
self.listbox.MoveSelection(-1)
elif keycode in [wx.WXK_LEFT, wx.WXK_RIGHT, wx.WXK_RETURN] and self.listbox is not None:
selected = self.listbox.GetSelection()
if selected != "":
self.SetValueFromSelected(selected)
else:
event.Skip()
elif event.GetKeyCode() == wx.WXK_ESCAPE:
self.DismissListBox()
else:
event.Skip()
示例4: OnChar
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [as 别名]
def OnChar(self, event, isEntry):
kc = event.GetKeyCode()
if kc == wx.WXK_ESCAPE:
self.OnCancel()
elif (kc == wx.WXK_RETURN) and isEntry:
self.OnOK()
else:
event.Skip()
示例5: OnChar
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [as 别名]
def OnChar(self, event, isEntry, isButton):
kc = event.GetKeyCode()
if kc == wx.WXK_ESCAPE:
self.EndModal(wx.ID_OK)
return
if kc == wx.WXK_RETURN:
if isButton:
event.Skip()
return
else:
self.OnFind()
return
if isEntry:
event.Skip()
else:
if kc < 256:
if chr(kc) == "f":
self.OnFind()
elif chr(kc) == "r":
self.OnReplace()
else:
event.Skip()
else:
event.Skip()
示例6: on_button_char
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [as 别名]
def on_button_char(self, event):
# for e.g. the Remove button we don't want an action on the Return button
if event.GetKeyCode() != wx.WXK_RETURN:
event.Skip()
示例7: OnKeyPressed
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [as 别名]
def OnKeyPressed(self, event):
keycode = event.GetKeyCode()
if (keycode == wx.WXK_RETURN) or (keycode == 372):
self.CmdKeyExecute(STC_CMD_NEWLINE)
self.AutoIndent()
elif keycode == wx.WXK_TAB and event.GetModifiers() == wx.MOD_CONTROL:
self.Navigate()
else:
event.Skip()
示例8: OnVariablesFilterKeyDown
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [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()
示例9: OnNodesFilterKeyDown
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [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()
示例10: OnDurationChar
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [as 别名]
def OnDurationChar(self, event):
keycode = event.GetKeyCode()
if keycode in [wx.WXK_RETURN, wx.WXK_TAB]:
self.Parent.Parent.ProcessEvent(event)
elif keycode == wx.WXK_ESCAPE:
self.Duration.SetValue(self.Default)
self.Parent.Parent.CloseEditControl()
else:
event.Skip()
示例11: DoKeyPress
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [as 别名]
def DoKeyPress(self, event):
if event.GetKeyCode() == wx.WXK_RETURN:
self.mainDlg.EndModal(wx.ID_OK)
else:
event.Skip()
示例12: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [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)
示例13: OnKeyDown
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [as 别名]
def OnKeyDown(self, evt):
if evt.ControlDown() or evt.ShiftDown(): # ignore all CTRL+ / SHIFT+
evt.Skip()
return
key = evt.GetKeyCode() # only handling UP, DOWN, ENTER
if key not in (wx.WXK_DOWN, wx.WXK_UP, wx.WXK_RETURN):
evt.Skip()
return
oldRow = self.GetGridCursorRow()
oldCol = self.GetGridCursorCol()
self.set_row_background(oldRow) # ensure current row is khaki color
maxRow = self.GetTable().GetNumberRows()
if key == wx.WXK_UP:
if oldRow > 0: # only handled if not past start of grid
self.set_row_background(oldRow - 1)
self.MakeCellVisible(oldRow - 1, oldCol)
evt.Skip()
return
if key == wx.WXK_DOWN: # only handled if not past end of grid
if oldRow + 1 < maxRow:
self.set_row_background(oldRow + 1)
self.MakeCellVisible(oldRow + 1, oldCol)
evt.Skip()
return
self.DisableCellEditControl()
success = self.MoveCursorRight(False)
if not success: # we are in last cell, so move to next row
newRow = self.GetGridCursorRow() + 1
if newRow >= maxRow: # wrap to top if end of grid
newRow = 0
self.SetGridCursor(newRow, 0)
self.MakeCellVisible(newRow, 0)
self.set_row_background(newRow) # recolor rows
return
#==============================================================================
# Event Method: what to do if idling
#==============================================================================
示例14: on_char
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [as 别名]
def on_char(self, event):
# keyboard navigation: up/down arrows
focus = self.FindFocus()
k = event.GetKeyCode()
if k==wx.WXK_TAB:
if focus is self.type:
self.label.SetFocus()
else:
event.Skip()
return
if k in (wx.WXK_DOWN, wx.WXK_UP) and focus is self.type:
event.Skip()
return
if event.AltDown():
if k==wx.WXK_RETURN or k==ord("O"):
self.EndModal(wx.ID_OK)
return
if k==ord("C"):
self.EndModal(wx.ID_CANCEL)
return
if event.ControlDown() and k==wx.WXK_RETURN:
self.EndModal(wx.ID_OK)
return
if k==wx.WXK_RETURN: # ignore Enter key
return
if k==wx.WXK_DOWN:
if event.AltDown():
self.move_item_down(event)
else:
if self.selected_index+1 < self.items.GetItemCount():
self._select_item(self.selected_index+1)
else:
wx.Bell()
return
if k==wx.WXK_UP:
if event.AltDown():
self.move_item_up(event)
else:
if self.selected_index>0:
self._select_item(self.selected_index-1)
else:
wx.Bell()
return
if k==wx.WXK_RIGHT and event.AltDown():
self.move_item_right(event)
return
if k==wx.WXK_LEFT and event.AltDown():
self.move_item_left(event)
return
event.Skip()
示例15: on_char
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_RETURN [as 别名]
def on_char(self, event):
# keyboard navigation: up/down arrows and also Tab on some buttons
focus = self.FindFocus()
k = event.GetKeyCode()
if k==wx.WXK_TAB:
if focus is self.type:
self.label.SetFocus()
else:
event.Skip()
return
if k in (wx.WXK_DOWN, wx.WXK_UP) and focus is self.type:
event.Skip()
return
if event.AltDown():
if k==wx.WXK_RETURN or k==ord("O"):
self.EndModal(wx.ID_OK)
return
if k==ord("C"):
self.EndModal(wx.ID_CANCEL)
return
if event.ControlDown() and k==wx.WXK_RETURN:
self.EndModal(wx.ID_OK)
return
if k==wx.WXK_RETURN: # ignore Enter key
return
if k==wx.WXK_DOWN:
if event.AltDown():
self.move_item_down(event)
else:
if self.selected_index+1 < self.items.GetItemCount():
self._select_item(self.selected_index+1)
else:
wx.Bell()
return
if k==wx.WXK_UP:
if event.AltDown():
self.move_item_up(event)
else:
if self.selected_index>0:
self._select_item(self.selected_index-1)
else:
wx.Bell()
return
event.Skip()