本文整理汇总了Python中wx.WXK_TAB属性的典型用法代码示例。如果您正苦于以下问题:Python wx.WXK_TAB属性的具体用法?Python wx.WXK_TAB怎么用?Python wx.WXK_TAB使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.WXK_TAB属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OnKeyPressed
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_TAB [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()
示例2: OnKeyDown
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_TAB [as 别名]
def OnKeyDown(self, event):
key_handled = False
keycode = event.GetKeyCode()
if keycode == wx.WXK_TAB:
row = self.GetGridCursorRow()
col = self.GetGridCursorCol()
if event.ShiftDown():
if row < 0 or col == 0:
self.Navigate(wx.NavigationKeyEvent.IsBackward)
key_handled = True
elif row < 0 or col == self.Table.GetNumberCols() - 1:
self.Navigate(wx.NavigationKeyEvent.IsForward)
key_handled = True
elif keycode in (wx.WXK_ADD, wx.WXK_NUMPAD_ADD) and self.Editable:
self.AddRow()
key_handled = True
elif keycode in (wx.WXK_DELETE, wx.WXK_NUMPAD_DELETE) and self.Editable:
self.DeleteRow()
key_handled = True
elif keycode == wx.WXK_UP and event.ShiftDown() and self.Editable:
self.MoveRow(self.GetGridCursorRow(), -1)
key_handled = True
elif keycode == wx.WXK_DOWN and event.ShiftDown() and self.Editable:
self.MoveRow(self.GetGridCursorRow(), 1)
key_handled = True
if not key_handled:
event.Skip()
示例3: OnDurationChar
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_TAB [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()
示例4: OnLocationChar
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_TAB [as 别名]
def OnLocationChar(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.Location.SetValue(self.Default)
self.Parent.Parent.CloseEditControl()
else:
event.Skip()
示例5: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_TAB [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)
示例6: on_char
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_TAB [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()
示例7: on_char
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_TAB [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()
示例8: _HandleChar
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_TAB [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()