def customEvent(self, event): if event.type() == EventoTecladoConsole.KeyType: self.onKey(event.tecla()) elif event.type() == EventoTecladoConsole.EscapeType: self.onEscape() elif event.type() == EventoTecladoConsole.EnterType: self.onEnter() elif event.type() == EventoTecladoConsole.DirecionalType: self.onDirecional(event.tecla()) elif event.type() == EventoTecladoConsole.FuncionalType: self.onFuncional(event.tecla()) elif event.type() == EventoTecladoConsole.EspecialType: self.onEspecial(event.tecla()) elif event.type() == EventoTecladoConsole.TabType: tela = self while tela: if tela.focusNextChild(): break tela = tela.parent() else: CApplication.setFocusTelaPrincipal() elif event.type() == EventoFocusConsole.FocusIn: self.onFocusIn(event) elif event.type() == EventoFocusConsole.FocusOut: self.onFocusOut(event)
def update(self): painter = QPainter(self)#CApplication.getTelaPrincipal()) painter.translate(self.getPos()) self.paint(painter) painter.end() if not CApplication.updateRequested(): CApplication.setUpdateRequested(True) QCoreApplication.postEvent(CApplication.getInstance(), EventoUpdateConsole(EventoUpdateConsole.UpdateRequest)) return
def show(self): self._telaFocada = CApplication.getTelaFocada() self._telaPrincipal = CApplication.getTelaPrincipal() self._telaPrincipal.setVisible(False) CApplication.hideTelaPrincipal() self._telaPopup.show() CApplication.setFocus(None) self.focusNextChild()
#-*- coding: utf-8 -*- import sys sys.path.append("C:/Users/infox/My Documents/Aptana Studio 3 Workspace/mensageiroConsole/src") from engineConsole.base.baseApplication import CApplication from servicos.servicoMensageiro import ServicoServidorMensageiro, ServicoClienteMensageiro from telasMensageiro.telaUsuarios import TelaUsuarios cApp = CApplication() s = ServicoServidorMensageiro() sc = ServicoClienteMensageiro() t = TelaUsuarios(sc) t.show() cApp.exec_()
def setFocus(self): if self.acceptFocus(): CApplication.setFocus(self)
def __init__(self, parent=None): super().__init__(parent) CApplication.registrarTela(self) self._visible = True
def hasFocus(self): return CApplication.getTelaFocada() == self
def update(self): if self.isVisible(): CApplication.updateApp()
def hide(self): CApplication.hideTelaPrincipal()
def show(self): CApplication.setTelaPrincipal(self)
#-*- coding: utf-8 -*- import sys sys.path.append("C:/Users/infox/My Documents/Aptana Studio 3 Workspace/mensageiroConsole/src") sys.path.append("C:/Users/infox/My Documents/Aptana Studio 3 Workspace/base mensageiro/src") from engineConsole.base.baseApplication import CApplication from engineConsole.telas import LabelEditConsole from remoto.eventoTecladoRemoto import EventoTecladoRemotoReceber cApp = CApplication() e = EventoTecladoRemotoReceber() cApp.setEventoTeclado(e) l = LabelEditConsole("Teste") l.show() cApp.exec_()
def _atualizar(self): tela = CApplication.getScreenshot() self._tela.setTela(tela.rstrip('\n')+' ') self.update()
def __init__(self, parent=None): super().__init__("",parent) self._tela = TelaDeviceConsole() self.resize(80*8+5, 24*11+10) CApplication.getInstance().telaAtualizada.connect(self._atualizar)
def close(self): CApplication.hideTelaPrincipal() self._telaPrincipal.setVisible(True) self._telaPrincipal.show() CApplication.setFocus(self._telaFocada)