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


Python wx.WXK_ESCAPE属性代码示例

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


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

示例1: on_char_editor

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

示例2: onFrameCharHook

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

示例3: OnKeyDown

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

示例4: OnChar

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

示例5: OnChar

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_ESCAPE [as 别名]
def OnChar(self, event):
        kc = event.GetKeyCode()

        if kc == wx.WXK_ESCAPE:
            self.EndModal(wx.ID_OK)

            return

        event.Skip() 
开发者ID:trelby,项目名称:trelby,代码行数:11,代码来源:spellcheckdlg.py

示例6: OnChar

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

示例7: on_char

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_ESCAPE [as 别名]
def on_char(self, event):
        event.Skip()
        if event.GetKeyCode() == wx.WXK_ESCAPE:
            self.GetParent().Close()
        elif event.GetKeyCode() == wx.WXK_SPACE:
            self.next() 
开发者ID:fogleman,项目名称:GraphLayout,代码行数:8,代码来源:viewer.py

示例8: key

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_ESCAPE [as 别名]
def key(self, event):
        c = event.GetKeyCode()
        if c == wx.WXK_ESCAPE:
            self.EndModal(wx.ID_CANCEL)
        event.Skip() 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:7,代码来源:__init__.py

示例9: key

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_ESCAPE [as 别名]
def key(self, event):
        c = event.GetKeyCode()
        if c == wx.WXK_ESCAPE:
            self.close()
        event.Skip() 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:7,代码来源:DownloadManager.py

示例10: on_char

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_ESCAPE [as 别名]
def on_char(self, event):
        if self.text is None: return
        keycode = event.GetKeyCode()
        if keycode == wx.WXK_ESCAPE:
            # reset
            self.text.SetValue( self._convert_to_text(self.value) )
            if self.text.GetInsertionPoint()!=-1:
                self.text.SetInsertionPointEnd()
        if not self.multiline and keycode==13:
            # enter
            if self._check_for_user_modification(): return
        event.Skip() 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:14,代码来源:new_properties.py

示例11: on_char_hook

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_ESCAPE [as 别名]
def on_char_hook(self, event):
        # handler for EVT_CHAR_HOOK events on preview windows
        if event.GetKeyCode()==wx.WXK_ESCAPE:
            wx.FindWindowById(event.GetId()).GetTopLevelParent().Close()
            return
        misc.handle_key_event(event, "preview") 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:8,代码来源:application.py

示例12: OnChar

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_ESCAPE [as 别名]
def OnChar ( self, event ):
		key = event.GetKeyCode()
		# print (key)
		if key == ord('q') or key == ord('Q') or key == wx.WXK_ESCAPE: # Q or ESCAPE
			# print ("closing")
			self.window.Close()
			sys.exit(0) # In non-debug mode, Frame.Close() does not seem to close the application
			return
		#self.window.Refresh(False)
		event.Skip() 
开发者ID:cmbruns,项目名称:pyopenvr,代码行数:12,代码来源:wx_app.py

示例13: OnChar

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_ESCAPE [as 别名]
def OnChar(self, event):
        if event.GetKeyCode() == wx.WXK_ESCAPE:
            wx.Frame.Show(self, False)
        event.Skip() 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:6,代码来源:__init__.py

示例14: on_key_press

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_ESCAPE [as 别名]
def on_key_press(self, event):
        keycode = event.GetKeyCode()
        if keycode == wx.WXK_ESCAPE:
            self.Close()
        event.Skip() 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:7,代码来源:Adjustments.py

示例15: OnEscapeKey

# 需要导入模块: import wx [as 别名]
# 或者: from wx import WXK_ESCAPE [as 别名]
def OnEscapeKey(self, event):
        keycode = event.GetKeyCode()
        if keycode == wx.WXK_ESCAPE:
            self.EndModal(wx.ID_CANCEL)
        else:
            event.Skip() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:8,代码来源:IDManager.py


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