QScintilla/Terminal.py

changeset 1131
7781e396c903
parent 1112
8a7d1b9d18db
child 1507
9225700cbff5
equal deleted inserted replaced
1130:3e9f0330f833 1131:7781e396c903
39 Constructor 39 Constructor
40 40
41 @param vm reference to the viewmanager object 41 @param vm reference to the viewmanager object
42 @param parent parent widget (QWidget) 42 @param parent parent widget (QWidget)
43 """ 43 """
44 QsciScintillaCompat.__init__(self, parent) 44 super().__init__(parent)
45 self.setUtf8(True) 45 self.setUtf8(True)
46 46
47 self.vm = vm 47 self.vm = vm
48 48
49 self.linesepRegExp = r"\r\n|\n|\r" 49 self.linesepRegExp = r"\r\n|\n|\r"
197 197
198 def __finished(self): 198 def __finished(self):
199 """ 199 """
200 Private method called, when the shell process has finished. 200 Private method called, when the shell process has finished.
201 """ 201 """
202 QsciScintilla.clear(self) 202 super().clear()
203 203
204 self.__startAct.setEnabled(True) 204 self.__startAct.setEnabled(True)
205 self.__stopAct.setEnabled(False) 205 self.__stopAct.setEnabled(False)
206 self.__resetAct.setEnabled(False) 206 self.__resetAct.setEnabled(False)
207 self.__ctrlAct.setEnabled(False) 207 self.__ctrlAct.setEnabled(False)
479 Protected method to handle the mouse press event. 479 Protected method to handle the mouse press event.
480 480
481 @param event the mouse press event (QMouseEvent) 481 @param event the mouse press event (QMouseEvent)
482 """ 482 """
483 self.setFocus() 483 self.setFocus()
484 QsciScintillaCompat.mousePressEvent(self, event) 484 super().mousePressEvent(event)
485 485
486 def editorCommand(self, cmd): 486 def editorCommand(self, cmd):
487 """ 487 """
488 Public method to perform an editor command. 488 Public method to perform an editor command.
489 489
515 if len(txt) and txt >= " ": 515 if len(txt) and txt >= " ":
516 if not self.__isCursorOnLastLine(): 516 if not self.__isCursorOnLastLine():
517 line, col = self.__getEndPos() 517 line, col = self.__getEndPos()
518 self.setCursorPosition(line, col) 518 self.setCursorPosition(line, col)
519 self.prline, self.prcol = self.getCursorPosition() 519 self.prline, self.prcol = self.getCursorPosition()
520 QsciScintillaCompat.keyPressEvent(self, ev) 520 super().keyPressEvent(ev)
521 self.incrementalSearchActive = True 521 self.incrementalSearchActive = True
522 else: 522 else:
523 ev.ignore() 523 ev.ignore()
524 524
525 def __QScintillaLeftDeleteCommand(self, method): 525 def __QScintillaLeftDeleteCommand(self, method):
828 828
829 def clear(self): 829 def clear(self):
830 """ 830 """
831 Public slot to clear the display. 831 Public slot to clear the display.
832 """ 832 """
833 QsciScintillaCompat.clear(self) 833 super().clear()
834 self.__send("\n") 834 self.__send("\n")
835 835
836 def __reset(self): 836 def __reset(self):
837 """ 837 """
838 Private slot to handle the 'reset' context menu entry. 838 Private slot to handle the 'reset' context menu entry.
905 except AttributeError: 905 except AttributeError:
906 pass 906 pass
907 self.setCaretWidth(self.caretWidth) 907 self.setCaretWidth(self.caretWidth)
908 self.setCursorFlashTime(QApplication.cursorFlashTime()) 908 self.setCursorFlashTime(QApplication.cursorFlashTime())
909 909
910 QsciScintillaCompat.focusInEvent(self, event) 910 super().focusInEvent(event)
911 911
912 def focusOutEvent(self, event): 912 def focusOutEvent(self, event):
913 """ 913 """
914 Public method called when the shell loses focus. 914 Public method called when the shell loses focus.
915 915
918 try: 918 try:
919 self.vm.editorActGrp.setEnabled(False) 919 self.vm.editorActGrp.setEnabled(False)
920 except AttributeError: 920 except AttributeError:
921 pass 921 pass
922 self.setCaretWidth(0) 922 self.setCaretWidth(0)
923 QsciScintillaCompat.focusOutEvent(self, event) 923 super().focusOutEvent(event)
924 924
925 def insert(self, txt): 925 def insert(self, txt):
926 """ 926 """
927 Public slot to insert text at the current cursor position. 927 Public slot to insert text at the current cursor position.
928 928

eric ide

mercurial