当前位置: 首页>>代码示例>>Python>>正文


Python wx.WXK_NUMPAD_DELETE属性代码示例

本文整理汇总了Python中wx.WXK_NUMPAD_DELETE属性的典型用法代码示例。如果您正苦于以下问题:Python wx.WXK_NUMPAD_DELETE属性的具体用法?Python wx.WXK_NUMPAD_DELETE怎么用?Python wx.WXK_NUMPAD_DELETE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在wx的用法示例。


在下文中一共展示了wx.WXK_NUMPAD_DELETE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: OnVariablesFilterKeyDown

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_NUMPAD_DELETE [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() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:16,代码来源:ConfigEditor.py

示例2: OnNodesFilterKeyDown

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_NUMPAD_DELETE [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() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:16,代码来源:ConfigEditor.py

示例3: OnProcessVariablesGridKeyDown

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_NUMPAD_DELETE [as 别名]
def OnProcessVariablesGridKeyDown(self, event):
        keycode = event.GetKeyCode()
        col = self.ProcessVariablesGrid.GetGridCursorCol()
        row = self.ProcessVariablesGrid.GetGridCursorRow()
        colname = self.ProcessVariablesTable.GetColLabelValue(col, False)
        if keycode in (wx.WXK_DELETE, wx.WXK_NUMPAD_DELETE) and \
           (colname.startswith("Read from") or colname.startswith("Write to")):
            self.ProcessVariablesTable.SetValue(row, col, "")
            self.SaveProcessVariables()
            wx.CallAfter(self.ProcessVariablesTable.ResetView, self.ProcessVariablesGrid)
        else:
            event.Skip() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:14,代码来源:ConfigEditor.py

示例4: OnKeyDown

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_NUMPAD_DELETE [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() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:29,代码来源:CustomGrid.py

示例5: OnKeyPressed

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_NUMPAD_DELETE [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() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:45,代码来源:CodeFileEditor.py


注:本文中的wx.WXK_NUMPAD_DELETE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。