723 # move cursor to end of line |
723 # move cursor to end of line |
724 self.moveCursorToEOL() |
724 self.moveCursorToEOL() |
725 |
725 |
726 def paste(self): |
726 def paste(self): |
727 """ |
727 """ |
728 Reimplemented slot to handle the paste action. |
728 Public slot to handle the paste action. |
729 """ |
729 """ |
730 lines = QApplication.clipboard().text() |
730 lines = QApplication.clipboard().text() |
731 self.executeLines(lines) |
731 self.executeLines(lines) |
732 |
732 |
733 def __middleMouseButton(self): |
733 def __middleMouseButton(self): |
834 |
834 |
835 super(Shell, self).wheelEvent(evt) |
835 super(Shell, self).wheelEvent(evt) |
836 |
836 |
837 def event(self, evt): |
837 def event(self, evt): |
838 """ |
838 """ |
839 Protected method handling events. |
839 Public method handling events. |
840 |
840 |
841 @param evt reference to the event (QEvent) |
841 @param evt reference to the event (QEvent) |
842 @return flag indicating, if the event was handled (boolean) |
842 @return flag indicating, if the event was handled (boolean) |
843 """ |
843 """ |
844 if evt.type() == QEvent.Gesture: |
844 if evt.type() == QEvent.Gesture: |
891 cline, ccol = self.getCursorPosition() |
891 cline, ccol = self.getCursorPosition() |
892 return cline == self.lines() - 1 |
892 return cline == self.lines() - 1 |
893 |
893 |
894 def keyPressEvent(self, ev): |
894 def keyPressEvent(self, ev): |
895 """ |
895 """ |
896 Re-implemented to handle the user input a key at a time. |
896 Protected method to handle the user input a key at a time. |
897 |
897 |
898 @param ev key event (QKeyEvent) |
898 @param ev key event (QKeyEvent) |
899 """ |
899 """ |
900 txt = ev.text() |
900 txt = ev.text() |
901 |
901 |
1369 idx -= 1 |
1369 idx -= 1 |
1370 return idx |
1370 return idx |
1371 |
1371 |
1372 def focusNextPrevChild(self, next): |
1372 def focusNextPrevChild(self, next): |
1373 """ |
1373 """ |
1374 Reimplemented to stop Tab moving to the next window. |
1374 Public method to stop Tab moving to the next window. |
1375 |
1375 |
1376 While the user is entering a multi-line command, the movement to |
1376 While the user is entering a multi-line command, the movement to |
1377 the next window by the Tab key being pressed is suppressed. |
1377 the next window by the Tab key being pressed is suppressed. |
1378 |
1378 |
1379 @param next next window |
1379 @param next next window |
1384 |
1384 |
1385 return QsciScintillaCompat.focusNextPrevChild(self, next) |
1385 return QsciScintillaCompat.focusNextPrevChild(self, next) |
1386 |
1386 |
1387 def contextMenuEvent(self, ev): |
1387 def contextMenuEvent(self, ev): |
1388 """ |
1388 """ |
1389 Reimplemented to show our own context menu. |
1389 Protected method to show our own context menu. |
1390 |
1390 |
1391 @param ev context menu event (QContextMenuEvent) |
1391 @param ev context menu event (QContextMenuEvent) |
1392 """ |
1392 """ |
1393 self.menu.popup(ev.globalPos()) |
1393 self.menu.popup(ev.globalPos()) |
1394 ev.accept() |
1394 ev.accept() |
1568 |
1568 |
1569 self.inDragDrop = False |
1569 self.inDragDrop = False |
1570 |
1570 |
1571 def focusInEvent(self, event): |
1571 def focusInEvent(self, event): |
1572 """ |
1572 """ |
1573 Public method called when the shell receives focus. |
1573 Protected method called when the shell receives focus. |
1574 |
1574 |
1575 @param event the event object (QFocusEvent) |
1575 @param event the event object (QFocusEvent) |
1576 """ |
1576 """ |
1577 if not self.__actionsAdded: |
1577 if not self.__actionsAdded: |
1578 self.addActions(self.vm.editorActGrp.actions()) |
1578 self.addActions(self.vm.editorActGrp.actions()) |
1604 |
1604 |
1605 super(Shell, self).focusInEvent(event) |
1605 super(Shell, self).focusInEvent(event) |
1606 |
1606 |
1607 def focusOutEvent(self, event): |
1607 def focusOutEvent(self, event): |
1608 """ |
1608 """ |
1609 Public method called when the shell loses focus. |
1609 Protected method called when the shell loses focus. |
1610 |
1610 |
1611 @param event the event object (QFocusEvent) |
1611 @param event the event object (QFocusEvent) |
1612 """ |
1612 """ |
1613 try: |
1613 try: |
1614 self.vm.editorActGrp.setEnabled(False) |
1614 self.vm.editorActGrp.setEnabled(False) |