Python wx 模块,PyCommandEvent() 实例源码

我们从Python开源项目中,提取了以下12个代码示例,用于说明如何使用wx.PyCommandEvent()

项目:pyDataView    作者:edwardsmith999    | 项目源码 | 文件源码
def fdir_dialogue(self, event):

        fdir = ""  # Use  folder as a flag
        currentdir = self.dirchooser.textctrl.GetValue()
        dlg = wx.DirDialog(self, defaultPath = currentdir)
        if dlg.ShowModal() == wx.ID_OK:
            fdir = dlg.GetPath() + "/"
            dlg.SetPath(fdir)
        dlg.Destroy()  # best to do this sooner than later

        if fdir:
            self.dirchooser.textctrl.SetValue(fdir)
            event = wx.PyCommandEvent(wx.EVT_TEXT_ENTER.typeId, 
                                      self.dirchooser.textctrl.GetId())
            self.GetEventHandler().ProcessEvent(event)
            self.fdir = fdir
项目:code    作者:ActiveState    | 项目源码 | 文件源码
def __init__(self, func, onSuccess, onFailure, *params, **kwparams):
        wx.PyCommandEvent.__init__(self, wxEVT_RESPONSE, 1)
        self.func = func
        self.onSuccess = onSuccess
        self.onFailure = onFailure
        self.params = params
        self.kwparams = kwparams
项目:PandasDataFrameGUI    作者:bluenote10    | 项目源码 | 文件源码
def swap(self, i, j):
        self.index_mapping[i], self.index_mapping[j] = self.index_mapping[j], self.index_mapping[i]
        self.SetString(i, self.data[self.index_mapping[i]])
        self.SetString(j, self.data[self.index_mapping[j]])
        self.selected_items[i], self.selected_items[j] = self.selected_items[j], self.selected_items[i]
        # self.update_selection()
        # print("Updated mapping:", self.index_mapping)
        new_event = wx.PyCommandEvent(wx.EVT_LISTBOX.typeId, self.GetId())
        self.GetEventHandler().ProcessEvent(new_event)
项目:fmc-dialer    作者:sguron    | 项目源码 | 文件源码
def __init__(self, eventType, eventId=1, sel=-1, oldsel=-1):
        """
        Default class constructor.

        :param `eventType`: the event type;
        :param `eventId`: the event identifier;
        :param `sel`: the current selection;
        :param `oldsel`: the old selection.
        """

        wx.PyCommandEvent.__init__(self, eventType, eventId)
        self._eventType = eventType
        self._sel = sel
        self._oldsel = oldsel
        self._allowed = True
项目:cebl    作者:idfah    | 项目源码 | 文件源码
def __init__(self, choice, id=wx.ID_ANY):
        wx.PyCommandEvent.__init__(self, id=id,
            eventType=wxEVT_PIEMENU_SELECT)
        self.choice = choice
项目:dxf2gcode    作者:cnc-club    | 项目源码 | 文件源码
def __init__(self,message):
        wx.PyCommandEvent.__init__(self, myEVT_PRINT, wx.ID_ANY)
        self._message = message
项目:PancakeViewer    作者:forensicmatt    | 项目源码 | 文件源码
def __init__(self, etype, eid, value=None):
        """Creates the event object"""
        wx.PyCommandEvent.__init__(self, etype, eid)
        self._value = value

        print 'EVIDENCELOADED EVENT'
项目:pyDataView    作者:edwardsmith999    | 项目源码 | 文件源码
def post_string_event(self, eventtype, eventval, panel):
        """
            Triggers an event 
        """
        event = wx.PyCommandEvent(eventtype.typeId, panel.GetId())
        event.SetString(str(eventval))
        wx.PostEvent(self.GetEventHandler(),event)
项目:pyDataView    作者:edwardsmith999    | 项目源码 | 文件源码
def post_slide_event(self,eventval):
        """
            Updated positions triggers an
            event to let the parent know scroll 
            position has been changed 
        """
        event = wx.PyCommandEvent(wx.EVT_COMMAND_SCROLL_CHANGED.typeId, self.GetId())
        event.SetInt(eventval)
        wx.PostEvent(self.GetEventHandler(),event)
项目:Jackal_Velodyne_Duke    作者:MengGuo    | 项目源码 | 文件源码
def __init__(self, windowID, data):
        wx.PyCommandEvent.__init__(self, self.eventType, windowID)
        self.data = data
项目:btc-fpga-miner    作者:marsohod4you    | 项目源码 | 文件源码
def __init__(self, windowID, data):
        wx.PyCommandEvent.__init__(self, self.eventType, windowID)
        self.data = data
项目:GRIPy    作者:giruenf    | 项目源码 | 文件源码
def __init__(self, type=wx.wxEVT_NULL, splitter=None):
        wx.PyCommandEvent.__init__(self, type)
        if splitter:
            self.SetEventObject(splitter)
            self.SetId(splitter.GetId())
        self.sashIdx = -1
        self.sashPos = -1
        self.isAllowed = True