本文整理汇总了Python中wx.WXK_NUMPAD_ADD属性的典型用法代码示例。如果您正苦于以下问题:Python wx.WXK_NUMPAD_ADD属性的具体用法?Python wx.WXK_NUMPAD_ADD怎么用?Python wx.WXK_NUMPAD_ADD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.WXK_NUMPAD_ADD属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OnKeyDown
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_NUMPAD_ADD [as 别名]
def OnKeyDown(self, event):
button = None
keycode = event.GetKeyCode()
if keycode in (wx.WXK_ADD, wx.WXK_NUMPAD_ADD):
button = self.GetNewButton()
elif keycode in (wx.WXK_DELETE, wx.WXK_NUMPAD_DELETE):
button = self.GetDelButton()
elif keycode == wx.WXK_UP and event.ShiftDown():
button = self.GetUpButton()
elif keycode == wx.WXK_DOWN and event.ShiftDown():
button = self.GetDownButton()
elif keycode == wx.WXK_SPACE:
button = self.GetEditButton()
if button is not None and button.IsEnabled():
button.ProcessEvent(wx.CommandEvent(wx.EVT_BUTTON.typeId, button.GetId()))
else:
event.Skip()
示例2: OnKeyDown
# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_NUMPAD_ADD [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()