本文整理匯總了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()