42 |
42 |
43 @param dbs reference to the debug server object |
43 @param dbs reference to the debug server object |
44 @param vm reference to the viewmanager object |
44 @param vm reference to the viewmanager object |
45 @param parent parent widget (QWidget) |
45 @param parent parent widget (QWidget) |
46 """ |
46 """ |
47 QsciScintillaCompat.__init__(self, parent) |
47 super().__init__(parent) |
48 self.setUtf8(True) |
48 self.setUtf8(True) |
49 |
49 |
50 self.vm = vm |
50 self.vm = vm |
51 |
51 |
52 self.linesepRegExp = r"\r\n|\n|\r" |
52 self.linesepRegExp = r"\r\n|\n|\r" |
532 |
532 |
533 @param version interpreter version string (string) |
533 @param version interpreter version string (string) |
534 @param platform platform of the remote interpreter (string) |
534 @param platform platform of the remote interpreter (string) |
535 @param dbgclient debug client variant used (string) |
535 @param dbgclient debug client variant used (string) |
536 """ |
536 """ |
537 QsciScintillaCompat.clear(self) |
537 super().clear() |
538 if self.passive and not self.dbs.isConnected(): |
538 if self.passive and not self.dbs.isConnected(): |
539 self.__write(self.trUtf8('Passive Debug Mode')) |
539 self.__write(self.trUtf8('Passive Debug Mode')) |
540 self.__write(self.trUtf8('\nNot connected')) |
540 self.__write(self.trUtf8('\nNot connected')) |
541 else: |
541 else: |
542 version = version.replace("#", self.trUtf8("No.")) |
542 version = version.replace("#", self.trUtf8("No.")) |
720 """ |
720 """ |
721 self.setFocus() |
721 self.setFocus() |
722 if event.button() == Qt.MidButton: |
722 if event.button() == Qt.MidButton: |
723 self.__middleMouseButton() |
723 self.__middleMouseButton() |
724 else: |
724 else: |
725 QsciScintillaCompat.mousePressEvent(self, event) |
725 super().mousePressEvent(event) |
726 |
726 |
727 def editorCommand(self, cmd): |
727 def editorCommand(self, cmd): |
728 """ |
728 """ |
729 Public method to perform an editor command. |
729 Public method to perform an editor command. |
730 |
730 |
758 line, col = self.__getEndPos() |
758 line, col = self.__getEndPos() |
759 self.setCursorPosition(line, col) |
759 self.setCursorPosition(line, col) |
760 self.prline, self.prcol = self.getCursorPosition() |
760 self.prline, self.prcol = self.getCursorPosition() |
761 if self.echoInput: |
761 if self.echoInput: |
762 ac = self.isListActive() |
762 ac = self.isListActive() |
763 QsciScintillaCompat.keyPressEvent(self, ev) |
763 super().keyPressEvent(ev) |
764 self.incrementalSearchActive = True |
764 self.incrementalSearchActive = True |
765 if ac and \ |
765 if ac and \ |
766 self.racEnabled: |
766 self.racEnabled: |
767 self.dbs.remoteCompletion(self.completionText + txt) |
767 self.dbs.remoteCompletion(self.completionText + txt) |
768 else: |
768 else: |
1332 """ |
1332 """ |
1333 self.inDragDrop = event.mimeData().hasUrls() or event.mimeData().hasText() |
1333 self.inDragDrop = event.mimeData().hasUrls() or event.mimeData().hasText() |
1334 if self.inDragDrop: |
1334 if self.inDragDrop: |
1335 event.acceptProposedAction() |
1335 event.acceptProposedAction() |
1336 else: |
1336 else: |
1337 QsciScintillaCompat.dragEnterEvent(self, event) |
1337 super().dragEnterEvent(event) |
1338 |
1338 |
1339 def dragMoveEvent(self, event): |
1339 def dragMoveEvent(self, event): |
1340 """ |
1340 """ |
1341 Protected method to handle the drag move event. |
1341 Protected method to handle the drag move event. |
1342 |
1342 |
1343 @param event the drag move event (QDragMoveEvent) |
1343 @param event the drag move event (QDragMoveEvent) |
1344 """ |
1344 """ |
1345 if self.inDragDrop: |
1345 if self.inDragDrop: |
1346 event.accept() |
1346 event.accept() |
1347 else: |
1347 else: |
1348 QsciScintillaCompat.dragMoveEvent(self, event) |
1348 super().dragMoveEvent(event) |
1349 |
1349 |
1350 def dragLeaveEvent(self, event): |
1350 def dragLeaveEvent(self, event): |
1351 """ |
1351 """ |
1352 Protected method to handle the drag leave event. |
1352 Protected method to handle the drag leave event. |
1353 |
1353 |
1382 if s: |
1382 if s: |
1383 event.acceptProposedAction() |
1383 event.acceptProposedAction() |
1384 self.executeLines(s) |
1384 self.executeLines(s) |
1385 del s |
1385 del s |
1386 else: |
1386 else: |
1387 QsciScintillaCompat.dropEvent(self, event) |
1387 super().dropEvent(event) |
1388 |
1388 |
1389 self.inDragDrop = False |
1389 self.inDragDrop = False |
1390 |
1390 |
1391 def focusInEvent(self, event): |
1391 def focusInEvent(self, event): |
1392 """ |
1392 """ |
1408 except AttributeError: |
1408 except AttributeError: |
1409 pass |
1409 pass |
1410 self.setCaretWidth(self.caretWidth) |
1410 self.setCaretWidth(self.caretWidth) |
1411 self.setCursorFlashTime(QApplication.cursorFlashTime()) |
1411 self.setCursorFlashTime(QApplication.cursorFlashTime()) |
1412 |
1412 |
1413 QsciScintillaCompat.focusInEvent(self, event) |
1413 super().focusInEvent(event) |
1414 |
1414 |
1415 def focusOutEvent(self, event): |
1415 def focusOutEvent(self, event): |
1416 """ |
1416 """ |
1417 Public method called when the shell loses focus. |
1417 Public method called when the shell loses focus. |
1418 |
1418 |
1421 try: |
1421 try: |
1422 self.vm.editorActGrp.setEnabled(False) |
1422 self.vm.editorActGrp.setEnabled(False) |
1423 except AttributeError: |
1423 except AttributeError: |
1424 pass |
1424 pass |
1425 self.setCaretWidth(0) |
1425 self.setCaretWidth(0) |
1426 QsciScintillaCompat.focusOutEvent(self, event) |
1426 super().focusOutEvent(event) |
1427 |
1427 |
1428 def insert(self, txt): |
1428 def insert(self, txt): |
1429 """ |
1429 """ |
1430 Public slot to insert text at the current cursor position. |
1430 Public slot to insert text at the current cursor position. |
1431 |
1431 |