本文整理汇总了Python中wx.EVT_RIGHT_DOWN属性的典型用法代码示例。如果您正苦于以下问题:Python wx.EVT_RIGHT_DOWN属性的具体用法?Python wx.EVT_RIGHT_DOWN怎么用?Python wx.EVT_RIGHT_DOWN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.EVT_RIGHT_DOWN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def __init__(self, parent, id):
style = wx.WANTS_CHARS | wx.FULL_REPAINT_ON_RESIZE | wx.NO_BORDER
wx.Control.__init__(self, parent, id, style = style)
self.panel = parent
wx.EVT_SIZE(self, self.OnSize)
wx.EVT_PAINT(self, self.OnPaint)
wx.EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
wx.EVT_LEFT_DOWN(self, self.OnLeftDown)
wx.EVT_LEFT_UP(self, self.OnLeftUp)
wx.EVT_LEFT_DCLICK(self, self.OnLeftDown)
wx.EVT_RIGHT_DOWN(self, self.OnRightDown)
wx.EVT_MOTION(self, self.OnMotion)
wx.EVT_MOUSEWHEEL(self, self.OnMouseWheel)
wx.EVT_CHAR(self, self.OnKeyChar)
self.createEmptySp()
self.updateScreen(redraw = False)
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def __init__(self, parentWin, size=wx.DefaultSize, style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT):
DragTreeCtrl.__init__(self, parentWin, "Server", size=size, style=style)
self.groups={}
self.nodes=[]
self.Bind(wx.EVT_RIGHT_DOWN, self.OnTreeRightClick)
self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnTreeActivate)
self.currentNode=None
self.currentItem=None
for groupName in adm.config.Read("ServerGroups", []):
self.addGroup(groupName)
for server in adm.config.getServers():
settings=adm.config.getServerSettings(server)
if settings:
logger.debug("Registering %s", server)
self.RegisterServer(settings, True)
else:
logger.debug("Registration for %s missing", server)
示例3: create_widget
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def create_widget(self):
if self.overlapped and self.parent._IS_GRIDBAG: return
style = wx.FULL_REPAINT_ON_RESIZE
if self.parent.CHILDREN in (-1, 1): # e.g. Panel in a Frame
size = self.parent.widget.GetClientSize()
else:
size = (20, 20)
self.widget = wx.Window(self.parent_window.widget, -1, size=size, style=style)
self.widget.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
#self.widget.SetAutoLayout(True)
self.widget.Bind(wx.EVT_PAINT, self.on_paint)
self.widget.Bind(wx.EVT_ERASE_BACKGROUND, self.on_erase_background)
self.widget.Bind(wx.EVT_RIGHT_DOWN, self.popup_menu)
self.widget.Bind(wx.EVT_LEFT_DOWN, self.on_drop_widget)
self.widget.Bind(wx.EVT_MIDDLE_DOWN, misc.exec_after(self.on_select_and_paste))
self.widget.Bind(wx.EVT_ENTER_WINDOW, self.on_enter)
self.widget.Bind(wx.EVT_LEAVE_WINDOW, self.on_leave)
#self.widget.Bind(wx.EVT_CHAR_HOOK, misc.on_key_down_event) # catch cursor keys XXX still required?
示例4: destroy_widget
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def destroy_widget(self, level):
if self.widget is None: return
if misc.currently_under_mouse is self.widget:
misc.currently_under_mouse = None
self.widget.Hide()
if wx.VERSION_STRING!="2.8.12.0":
# unbind events to prevent new created (and queued) events
self.widget.Bind(wx.EVT_PAINT, None)
self.widget.Bind(wx.EVT_RIGHT_DOWN, None)
self.widget.Bind(wx.EVT_LEFT_DOWN, None)
self.widget.Bind(wx.EVT_MIDDLE_DOWN, None)
self.widget.Bind(wx.EVT_ENTER_WINDOW, None)
self.widget.Bind(wx.EVT_LEAVE_WINDOW, None)
self.widget.Bind(wx.EVT_KEY_DOWN, None)
compat.DestroyLater(self.widget)
self.widget = None
if misc.focused_widget is self:
misc.set_focused_widget(None)
示例5: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def __init__(self, parent, plugin):
self.parent = parent
wx.Panel.__init__(self, parent)
if plugin.moveOnDrag:
self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
if plugin.iconizeOnDoubleClick:
self.Bind(wx.EVT_LEFT_DCLICK, self.OnCmdIconize)
self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
self.menu = menu = wx.Menu()
item = wx.MenuItem(menu, wx.NewId(), "Hide")
menu.AppendItem(item)
menu.Bind(wx.EVT_MENU, self.OnCmdIconize, item)
item = wx.MenuItem(menu, wx.NewId(),"Close")
menu.AppendItem(item)
menu.Bind(wx.EVT_MENU, self.OnCmdClose, item)
示例6: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def __init__(self, parent):
attribs = (glcanvas.WX_GL_RGBA, glcanvas.WX_GL_DOUBLEBUFFER, glcanvas.WX_GL_DEPTH_SIZE, 24)
glcanvas.GLCanvas.__init__(self, parent, -1, attribList = attribs)
self.context = glcanvas.GLContext(self)
self.parent = parent
#Camera state variables
self.size = self.GetClientSize()
#self.camera = MouseSphericalCamera(self.size.x, self.size.y)
self.camera = MousePolarCamera(self.size.width, self.size.height)
#Main state variables
self.MousePos = [0, 0]
self.bbox = BBox3D()
#Face mesh variables and manipulation variables
self.mesh = None
self.meshCentroid = None
self.displayMeshFaces = True
self.displayMeshEdges = False
self.displayMeshVertices = True
self.displayVertexNormals = False
self.displayFaceNormals = False
self.useLighting = True
self.useTexture = False
self.GLinitialized = False
#GL-related events
wx.EVT_ERASE_BACKGROUND(self, self.processEraseBackgroundEvent)
wx.EVT_SIZE(self, self.processSizeEvent)
wx.EVT_PAINT(self, self.processPaintEvent)
#Mouse Events
wx.EVT_LEFT_DOWN(self, self.MouseDown)
wx.EVT_LEFT_UP(self, self.MouseUp)
wx.EVT_RIGHT_DOWN(self, self.MouseDown)
wx.EVT_RIGHT_UP(self, self.MouseUp)
wx.EVT_MIDDLE_DOWN(self, self.MouseDown)
wx.EVT_MIDDLE_UP(self, self.MouseUp)
wx.EVT_MOTION(self, self.MouseMotion)
示例7: _bind_events
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def _bind_events(self):
"""Bind events to various event handlers."""
self.Bind(wx.EVT_PAINT, self._on_paint)
self.Bind(wx.EVT_SIZE, self._on_size)
# self.Bind(wx.EVT_MOTION, self.on_mouse_move)
# self.Bind(wx.EVT_LEFT_DOWN, self.on_mouse_left_down)
# self.Bind(wx.EVT_RIGHT_DOWN, self.on_mouse_right_down)
示例8: _bind_events
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def _bind_events(self):
"""
Bind panel and canvas events.
Note that key-down is bound again - this allws hotkeys to work
even if the main Frame, which defines hotkeys in menus, is not
present. wx sents the EVT_KEY_DOWN up the chain and, if the Frame
and hotkeys are present, executes those instead.
At least I think that's how that works...
See http://wxpython.org/Phoenix/docs/html/events_overview.html
for more info.
"""
# Canvas Events
self.canvas.Bind(FloatCanvas.EVT_MOTION, self.on_mouse_move)
self.canvas.Bind(FloatCanvas.EVT_MOUSEWHEEL, self.on_mouse_wheel)
self.canvas.Bind(FloatCanvas.EVT_MIDDLE_DOWN, self.on_mouse_middle_down)
self.canvas.Bind(FloatCanvas.EVT_MIDDLE_UP, self.on_mouse_middle_up)
self.canvas.Bind(wx.EVT_PAINT, self._on_first_paint)
# XXX: Binding the EVT_LEFT_DOWN seems to cause Issue #24.
# What seems to happen is: If I bind EVT_LEFT_DOWN, then the
# parent panel or application can't set focus to this
# panel, which prevents the EVT_MOUSEWHEEL event from firing
# properly.
# self.canvas.Bind(wx.EVT_LEFT_DOWN, self.on_mouse_left_down)
# self.canvas.Bind(wx.EVT_RIGHT_DOWN, self.on_mouse_right_down)
# self.canvas.Bind(wx.EVT_LEFT_UP, self.on_mouse_left_up)
# self.canvas.Bind(wx.EVT_KEY_DOWN, self._on_key_down)
# This is supposed to fix flicker on mouse move, but it doesn't work.
# self.Bind(wx.EVT_ERASE_BACKGROUND, None)
# Panel Events
self.Bind(csel.EVT_COLOURSELECT, self.on_color_change)
示例9: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def __init__(self, parent, df, status_bar_callback):
wx.ListCtrl.__init__(
self, parent, -1,
style=wx.LC_REPORT | wx.LC_VIRTUAL | wx.LC_HRULES | wx.LC_VRULES | wx.LB_MULTIPLE
)
self.status_bar_callback = status_bar_callback
self.df_orig = df
self.original_columns = self.df_orig.columns[:]
if isinstance(self.original_columns,(pd.RangeIndex,pd.Int64Index)):
# RangeIndex is not supported by self._update_columns
self.original_columns = pd.Index([str(i) for i in self.original_columns])
self.current_columns = self.df_orig.columns[:]
self.sort_by_column = None
self._reset_mask()
# prepare attribute for alternating colors of rows
self.attr_light_blue = wx.ListItemAttr()
self.attr_light_blue.SetBackgroundColour("#D6EBFF")
self.Bind(wx.EVT_LIST_COL_CLICK, self._on_col_click)
self.Bind(wx.EVT_RIGHT_DOWN, self._on_right_click)
self.df = pd.DataFrame({}) # init empty to force initial update
self._update_rows()
self._update_columns(self.original_columns)
示例10: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def __init__(self, dlg, notebook, resname=None):
adm.NotebookPanel.__init__(self, dlg, notebook, resname)
self.grid.Bind(wxpg.EVT_PG_CHANGED, self.OnGridChange)
self.grid.Bind(wx.EVT_RIGHT_DOWN, self.OnGridRightClick)
self.grid.Bind(wx.EVT_MOTION, self.OnMouseMove)
self.availableObjectClasses={}
self.may=[]
self.lastRdnOid=None
self.dialog.BindMenuId(self.OnDelAttrs)
self.Bind("ObjectClass", self.OnClassChange)
self.Bind("AddObjectClass", self.OnAddObjectClass)
self.Bind("DelObjectClass", self.OnDelObjectClass)
self.Bind("RDN", self.OnRDN)
示例11: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def __init__(self, parentWin, server, editor):
DragTreeCtrl.__init__(self, parentWin, "Snippets", style=wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT)
self.editor=editor
self.server=server
self.frame=parentWin
self.snippets={}
self.Bind(wx.EVT_RIGHT_DOWN, self.OnTreeRightClick)
self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnTreeSelChanged)
self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnTreeActivate)
rootSnippets=[]
if self.frame.snippet_table:
set=self.server.GetCursor().ExecuteSet("SELECT * FROM %s ORDER BY parent, sort" % self.frame.snippet_table)
for row in set:
snippet=Snippet(row['id'], row['parent'], row['name'], row['snippet'], row['sort'])
self.snippets[snippet.id]=snippet
if not snippet.parent:
rootSnippets.append(snippet)
for snippet in rootSnippets:
if not snippet.parent:
self.AppendSnippet(snippet, parentItem=self.GetRootItem())
self.checkChildren(snippet)
for snippet in self.snippets.values():
if not snippet.treeitem:
self.AppendSnippet(snippet, parentItem=self.GetRootItem())
else:
item=self.AppendItem(self.GetRootItem(), xlt("Snippets not available:"))
item=self.AppendItem(item, xlt("Server not instrumented."))
self.ExpandAll()
示例12: finish_widget_creation
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def finish_widget_creation(self, level):
"Binds the popup menu handler and connects some event handlers to self.widgets; set tooltip string"
if not self.widget: return
self.widget.Bind(wx.EVT_RIGHT_DOWN, self.popup_menu)
if self.WX_CLASS in ("wxStatusBar",): return
compat.SetToolTip(self.widget, self._get_tooltip_string())
# callbacks when children were created
示例13: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def __init__(self, parent, application):
style = wx.TR_DEFAULT_STYLE|wx.TR_HAS_VARIABLE_ROW_HEIGHT
style |= wx.TR_EDIT_LABELS
if wx.Platform == '__WXGTK__': style |= wx.TR_NO_LINES|wx.TR_FULL_ROW_HIGHLIGHT
elif wx.Platform == '__WXMAC__': style &= ~wx.TR_ROW_LINES
wx.TreeCtrl.__init__(self, parent, -1, style=style)
self.cur_widget = None # reference to the selected widget
self.root = application
image_list = wx.ImageList(21, 21)
image_list.Add(wx.Bitmap(os.path.join(config.icons_path, 'application.xpm'), wx.BITMAP_TYPE_XPM))
for w in WidgetTree.images:
WidgetTree.images[w] = image_list.Add(misc.get_xpm_bitmap(WidgetTree.images[w]))
self.AssignImageList(image_list)
application.item = self.AddRoot(_('Application'), 0)
self._SetItemData(application.item, application)
self.skip_select = 0 # avoid an infinite loop on win32, as SelectItem fires an EVT_TREE_SEL_CHANGED event
self.drop_target = clipboard.DropTarget(self, toplevel=True)
self.SetDropTarget(self.drop_target)
self._drag_ongoing = False
self.auto_expand = True # this control the automatic expansion of nodes: it is set to False during xml loading
self.Bind(wx.EVT_TREE_SEL_CHANGED, self.on_change_selection)
self.Bind(wx.EVT_RIGHT_DOWN, self.popup_menu)
self.Bind(wx.EVT_LEFT_DCLICK, self.on_left_dclick)
self.Bind(wx.EVT_LEFT_DOWN, self.on_left_click) # allow direct placement of widgets
self.Bind(wx.EVT_MENU, self.on_menu) # for handling the selection of the first item
self._popup_menu_widget = None # the widget for the popup menu
self.Bind(wx.EVT_TREE_BEGIN_DRAG, self.begin_drag)
self.Bind(wx.EVT_LEAVE_WINDOW, self.on_leave_window)
self.Bind(wx.EVT_MOUSE_EVENTS, self.on_mouse_events)
self.Bind(wx.EVT_TREE_BEGIN_LABEL_EDIT, self.begin_edit_label)
self.Bind(wx.EVT_TREE_END_LABEL_EDIT, self.end_edit_label)
#self.Bind(wx.EVT_KEY_DOWN, misc.on_key_down_event)
self.Bind(wx.EVT_KEY_DOWN, self.on_key_down_event)
#self.Bind(wx.EVT_CHAR_HOOK, self.on_char) # on wx 2.8 the event will not be delivered to the child
self.Bind(wx.EVT_TREE_DELETE_ITEM, self.on_delete_item)
示例14: _create_button
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def _create_button(self, label):
r = wxGladeRadioButton(self.widget, -1, label)
r.Bind(wx.EVT_LEFT_DOWN, self.on_set_focus)
r.Bind(wx.EVT_RIGHT_DOWN, self.popup_menu)
return r
示例15: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_RIGHT_DOWN [as 别名]
def __init__(self, parent, id, sizer):
GenButton.__init__(self, parent.widget, id, '', size=(5, 5))
self.sizer = sizer
self.SetUseFocusIndicator(False)
self.Bind(wx.EVT_RIGHT_DOWN, self.sizer.popup_menu )
#self.Bind(wx.EVT_KEY_DOWN, misc.on_key_down_event)
color = compat.wx_SystemSettings_GetColour(wx.SYS_COLOUR_BTNFACE)
self.SetBackgroundColour(color)