Ejemplo n.º 1
0
def pdispatch(event):
    type, win, detail = event
    if not win:
        win = stdwin.getactive()
        if not win: return
    if type == WE_CLOSE:
        do_close(win)
        return
    elif type == WE_SIZE:
        win.editor.move((0, 0), win.getwinsize())
    elif type == WE_COMMAND and detail == WC_RETURN:
        if win.auto:
            do_exec(win)
        else:
            void = win.editor.event(event)
    elif type == WE_COMMAND and detail == WC_CANCEL:
        if win.busy:
            raise KeyboardInterrupt
        else:
            win.command = ''
            settitle(win)
    elif type == WE_MENU:
        mp, item = detail
        mp.callback[item](win)
    else:
        void = win.editor.event(event)
    if win in mainloop.windows:
        # May have been deleted by close...
        win.setdocsize(0, win.editor.getrect()[1][1])
        if type in (WE_CHAR, WE_COMMAND):
            win.editor.setfocus(win.editor.getfocus())
Ejemplo n.º 2
0
def pdispatch(event):
	type, win, detail = event
	if not win:
		win = stdwin.getactive()
		if not win: return
	if type == WE_CLOSE:
		do_close(win)
		return
	elif type == WE_SIZE:
		win.editor.move((0, 0), win.getwinsize())
	elif type == WE_COMMAND and detail == WC_RETURN:
		if win.auto:
			do_exec(win)
		else:
			void = win.editor.event(event)
	elif type == WE_COMMAND and detail == WC_CANCEL:
		if win.busy:
			raise KeyboardInterrupt
		else:
			win.command = ''
			settitle(win)
	elif type == WE_MENU:
		mp, item = detail
		mp.callback[item](win)
	else:
		void = win.editor.event(event)
	if win in mainloop.windows:
		# May have been deleted by close...
		win.setdocsize(0, win.editor.getrect()[1][1])
		if type in (WE_CHAR, WE_COMMAND):
			win.editor.setfocus(win.editor.getfocus())
Ejemplo n.º 3
0
def dispatch(event):
    global last_window
    if event[1] == None:
        active = stdwin.getactive()
        if active: last_window = active
    else:
        last_window = event[1]
    if last_window in windows:
        last_window.dispatch(event)
Ejemplo n.º 4
0
def dispatch(event):
	global last_window
	if event[1] == None:
		active = stdwin.getactive()
		if active: last_window = active
	else:
		last_window = event[1]
	if last_window in windows:
		last_window.dispatch(event)
Ejemplo n.º 5
0
	def popup(self):
		if self.win is not stdwin.getactive():
			self.win.setactive()