10 from __future__ import unicode_literals # __IGNORE_WARNING__ |
10 from __future__ import unicode_literals # __IGNORE_WARNING__ |
11 |
11 |
12 from PyQt4.QtCore import pyqtSignal, Qt |
12 from PyQt4.QtCore import pyqtSignal, Qt |
13 from PyQt4.QtGui import QPalette, QColor, QApplication |
13 from PyQt4.QtGui import QPalette, QColor, QApplication |
14 from PyQt4.Qsci import QsciScintilla, \ |
14 from PyQt4.Qsci import QsciScintilla, \ |
15 QSCINTILLA_VERSION as QsciQSCINTILLA_VERSION, QSCINTILLA_VERSION_STR, \ |
15 QSCINTILLA_VERSION as QSCIQSCINTILLA_VERSION, QSCINTILLA_VERSION_STR, \ |
16 QsciScintillaBase |
16 QsciScintillaBase |
17 |
17 |
18 ############################################################################### |
18 ############################################################################### |
19 |
19 |
20 |
20 |
28 @return QScintilla version (integer) |
28 @return QScintilla version (integer) |
29 """ |
29 """ |
30 if '-snapshot-' in QSCINTILLA_VERSION_STR: |
30 if '-snapshot-' in QSCINTILLA_VERSION_STR: |
31 return 0x99999 |
31 return 0x99999 |
32 else: |
32 else: |
33 return QsciQSCINTILLA_VERSION |
33 return QSCIQSCINTILLA_VERSION |
34 |
34 |
35 ############################################################################### |
35 ############################################################################### |
36 |
36 |
37 |
37 |
38 class QsciScintillaCompat(QsciScintilla): |
38 class QsciScintillaCompat(QsciScintilla): |
494 |
494 |
495 @return flag indicating a rectangular selection (boolean) |
495 @return flag indicating a rectangular selection (boolean) |
496 """ |
496 """ |
497 startLine, startIndex, endLine, endIndex = self.getSelection() |
497 startLine, startIndex, endLine, endIndex = self.getSelection() |
498 return startLine != -1 and \ |
498 return startLine != -1 and \ |
499 startLine != endLine and \ |
499 startLine != endLine and \ |
500 self.SendScintilla(QsciScintilla.SCI_SELECTIONISRECTANGLE) |
500 self.SendScintilla(QsciScintilla.SCI_SELECTIONISRECTANGLE) |
501 |
501 |
502 def getRectangularSelection(self): |
502 def getRectangularSelection(self): |
503 """ |
503 """ |
504 Public method to retrieve the start and end of a rectangular selection. |
504 Public method to retrieve the start and end of a rectangular selection. |
505 |
505 |