--- a/src/eric7/QScintilla/QsciScintillaCompat.py Fri Oct 13 08:30:15 2023 +0200 +++ b/src/eric7/QScintilla/QsciScintillaCompat.py Fri Oct 13 09:10:05 2023 +0200 @@ -8,6 +8,7 @@ """ import contextlib +import enum from PyQt6.Qsci import QsciScintilla, QsciScintillaBase from PyQt6.QtCore import QPoint, Qt, pyqtSignal, pyqtSlot @@ -15,6 +16,19 @@ from PyQt6.QtWidgets import QApplication, QListWidget +class QsciScintillaPrintColorMode(enum.IntEnum): + """ + Class defining the various print color modes. + """ + + Normal = QsciScintillaBase.SC_PRINT_NORMAL + InvertLight = QsciScintillaBase.SC_PRINT_INVERTLIGHT + BlackOnWhite = QsciScintillaBase.SC_PRINT_BLACKONWHITE + ColorOnWhite = QsciScintillaBase.SC_PRINT_COLOURONWHITE + ColorOnWhiteDefaultBackground = QsciScintillaBase.SC_PRINT_COLOURONWHITEDEFAULTBG + ScreenColors = QsciScintillaBase.SC_PRINT_SCREENCOLOURS + + class QsciScintillaCompat(QsciScintilla): """ Class implementing a compatability interface to QsciScintilla. @@ -1789,6 +1803,17 @@ pos = self.positionFromPoint(point) return self.lineIndexFromPosition(pos) + if "setPrintColorMode" not in QsciScintilla.__dict__: + + def setPrintColorMode(self, colorMode): + """ + Public method to set the print color mode (i.e. background handling). + + @param colorMode color mode to be set + @type QsciScintillaPrintColorMode + """ + self.SendScintilla(QsciScintilla.SCI_SETPRINTCOLOURMODE, colorMode) + ## ######################################################################### ## ## Methods below have been added to QScintilla starting with version 2.x.