# eric3.QScintilla.QextScintillaCompat

Module implementing a compatability interface class to QextScintilla.

### Classes

QextScintillaCompat | Class implementing a compatability interface to QextScintilla.

### Functions

QSCINTILLA_VERSION | Module function to return the QScintilla version.

## QextScintillaCompat

Class implementing a compatability interface to QextScintilla.

This class implements all the functions, that were added to QextScintilla incrementally. This class ensures compatibility to older versions of QextScintilla.

### Derived from

QextScintilla

### Methods

QextScintillaCompat | Constructor
_handleModificationChanged | Private slot to handle the modificationChanged signal.
cancelAutoCompletion | Public method to cancel autocompletion.
clearAlternateKeys | Protected method to clear the alternate key commands.
clearStyles | Public method to set the styles according the selected Qt style.
delete | Public method to delete the character to the right of the cursor.
deleteBack | Public method to delete the character to the left of the cursor.
deleteLineLeft | Public method to delete the line to the left of the cursor.
deleteLineRight | Public method to delete the line to the right of the cursor.
deleteWordLeft | Public method to delete the word to the left of the cursor.
deleteWordRight | Public method to delete the word to the right of the cursor.
editorCommand | Public method to perform a simple editor command.
extendSelectionLeft | Public method to extend the selection one character to the left.
extendSelectionRight | Public method to extend the selection one character to the right.
extendSelectionToBOL | Public method to extend the selection to the beginning of the line.
extendSelectionToEOL | Public method to extend the selection to the end of the line.
extendSelectionWordLeft | Public method to extend the selection one word to the left.
extendSelectionWordRight | Public method to extend the selection one word to the right.
firstVisibleLine | Public method to get the line number of the first visible line.
isAutoCompletionActive | Public method to check, if autocompletion is active.
isModified | Public method to retrieve the modification status.
keyPressEvent | Workaround for QScintilla <= 1.3 bug w/ keyboard layouts having a AltGr key in win32: AltGr is reported as state == Qt.ControlButton | Qt.AltButton, but QScintilla expects (Unix-style) Qt.MetaButton.
lineAt | Public method to calculate the line at a position.
monospacedStyles | Public method to set the current style to be monospaced.
moveCursorLeft | Public method to move the cursor left.
moveCursorRight | Public method to move the cursor right.
moveCursorToEOL | Public method to move the cursor to the end of line.
moveCursorWordLeft | Public method to move the cursor left one word.
moveCursorWordRight | Public method to move the cursor right one word.
recolor | Public method to recolor the given region.
resetSelectionForegroundColor | Public method to reset the foreground color of the selection.
scrollVertical | Public method to scroll the text area.
setCaretForegroundColor | Public method to set the foreground color of the caret.
setCaretLineBackgroundColor | Public method to set the background color of the caret line.
setCaretLineVisible | Public method to enable the highlighting of the caret line.
setCaretWidth | Public method to enable the highlighting of the caret line.
setEdgeColor | Public method to set the color of the edge mode highlight.
setEdgeColumn | Public method to set the edge column.
setEdgeMode | Public method to set the edge mode.
setLayoutCache | Public method to set the layout cache mode.
setLexer | Public method to set the lexer.
setModified | Public method to set the modification status.
setSelectionBackgroundColor | Public method to set the background color of the selection.
setSelectionForegroundColor | Public method to set the foreground color of the selection.
setWrapMode | Public slot to set the wrap mode of the text display.
setWrapVisualFlags | Public method to set the visual flags for wrapped lines.
showUserList | Public method to show a user list.
textHeight | Public method to get the text height.

### QextScintillaCompat (Constructor)

QextScintillaCompat(parent=None, name=None, flags=0)

Constructor

parent
  parent widget (QWidget)
name
  name of this instance (string or QString)
flags
  window flags

### QextScintillaCompat._handleModificationChanged

_handleModificationChanged(m)

Private slot to handle the modificationChanged signal.

It emits the signal modificationStatusChanged with parameters m and self.

m
  modification status

### QextScintillaCompat.cancelAutoCompletion

cancelAutoCompletion()

Public method to cancel autocompletion.

### QextScintillaCompat.clearAlternateKeys

clearAlternateKeys()

Protected method to clear the alternate key commands.

### QextScintillaCompat.clearStyles

clearStyles()

Public method to set the styles according the selected Qt style.

### QextScintillaCompat.delete

delete()

Public method to delete the character to the right of the cursor.

### QextScintillaCompat.deleteBack

deleteBack()

Public method to delete the character to the left of the cursor.

### QextScintillaCompat.deleteLineLeft

deleteLineLeft()

Public method to delete the line to the left of the cursor.

### QextScintillaCompat.deleteLineRight

deleteLineRight()

Public method to delete the line to the right of the cursor.

### QextScintillaCompat.deleteWordLeft

deleteWordLeft()

Public method to delete the word to the left of the cursor.

### QextScintillaCompat.deleteWordRight

deleteWordRight()

Public method to delete the word to the right of the cursor.

### QextScintillaCompat.editorCommand

editorCommand(cmd)

Public method to perform a simple editor command.

cmd
  the scintilla command to be performed

### QextScintillaCompat.extendSelectionLeft

extendSelectionLeft()

Public method to extend the selection one character to the left.

### QextScintillaCompat.extendSelectionRight

extendSelectionRight()

Public method to extend the selection one character to the right.

### QextScintillaCompat.extendSelectionToBOL

extendSelectionToBOL()

Public method to extend the selection to the beginning of the line.

### QextScintillaCompat.extendSelectionToEOL

extendSelectionToEOL()

Public method to extend the selection to the end of the line.

### QextScintillaCompat.extendSelectionWordLeft

extendSelectionWordLeft()

Public method to extend the selection one word to the left.

### QextScintillaCompat.extendSelectionWordRight

extendSelectionWordRight()

Public method to extend the selection one word to the right.

### QextScintillaCompat.firstVisibleLine

firstVisibleLine()

Public method to get the line number of the first visible line.

Returns:
  number of the first visible line (integer)

### QextScintillaCompat.isAutoCompletionActive

isAutoCompletionActive()

Public method to check, if autocompletion is active.

Returns:
  flag indicating autocompletion active state (boolean)

### QextScintillaCompat.isModified

isModified()

Public method to retrieve the modification status.

Returns:
  flag indicating the modification status (boolean)

### QextScintillaCompat.keyPressEvent

keyPressEvent(event)

Workaround for QScintilla <= 1.3 bug w/ keyboard layouts having a AltGr key in win32: AltGr is reported as state == Qt.ControlButton | Qt.AltButton, but QScintilla expects (Unix-style) Qt.MetaButton. Just translate states for infected QScintilla versions.

Reimplemented from QextScintilla.keyPressEvent

event
  reference to the key press event (QKeyEvent)

Author(s): Torsten Marek, 2004-08-22

### QextScintillaCompat.lineAt

lineAt(pos)

Public method to calculate the line at a position.

This variant is able to calculate the line for positions in the margins and for empty lines.

pos
  position to calculate the line for (QPoint)

Returns:
  linenumber at position or -1, if there is no line at pos (integer, zero based)

### QextScintillaCompat.monospacedStyles

monospacedStyles(font)

Public method to set the current style to be monospaced.

font
  font to be used (QFont)

### QextScintillaCompat.moveCursorLeft

moveCursorLeft()

Public method to move the cursor left.

### QextScintillaCompat.moveCursorRight

moveCursorRight()

Public method to move the cursor right.

### QextScintillaCompat.moveCursorToEOL

moveCursorToEOL()

Public method to move the cursor to the end of line.

### QextScintillaCompat.moveCursorWordLeft

moveCursorWordLeft()

Public method to move the cursor left one word.

### QextScintillaCompat.moveCursorWordRight

moveCursorWordRight()

Public method to move the cursor right one word.

### QextScintillaCompat.recolor

recolor(start = 0, end = -1)

Public method to recolor the given region.

start
  linenumber where to start recolourisation (integer)
end
  linenumber where to end recolourisation (integer)

### QextScintillaCompat.resetSelectionForegroundColor

resetSelectionForegroundColor()

Public method to reset the foreground color of the selection.

### QextScintillaCompat.scrollVertical

scrollVertical(lines)

Public method to scroll the text area.

lines
  number of lines to scroll (negative scrolls up, positive scrolls down) (integer)

### QextScintillaCompat.setCaretForegroundColor

setCaretForegroundColor(colour)

Public method to set the foreground color of the caret.

colour
  colour to be set (QColor)

### QextScintillaCompat.setCaretLineBackgroundColor

setCaretLineBackgroundColor(colour)

Public method to set the background color of the caret line.

colour
  colour to be set (QColor)

### QextScintillaCompat.setCaretLineVisible

setCaretLineVisible(enable)

Public method to enable the highlighting of the caret line.

enable
  flag indicating the highlighting state to be set (boolean)

### QextScintillaCompat.setCaretWidth

setCaretWidth(width)

Public method to enable the highlighting of the caret line.

width
  width of the caret (integer - 0, 1, 2 or 3)

### QextScintillaCompat.setEdgeColor

setEdgeColor(colour)

Public method to set the color of the edge mode highlight.

colour
  colour to be set (QColor)

### QextScintillaCompat.setEdgeColumn

setEdgeColumn(column)

Public method to set the edge column.

column
  column number to be set for the edge mode (integer)

### QextScintillaCompat.setEdgeMode

setEdgeMode(edgeMode)

Public method to set the edge mode.

edgeMode
  mode to be set

### QextScintillaCompat.setLayoutCache

setLayoutCache(cacheMode)

Public method to set the layout cache mode.

cacheMode
  layout cache mode to be set

### QextScintillaCompat.setLexer

setLexer(lex = None)

Public method to set the lexer.

lex
  the lexer to be set or None to reset it.

### QextScintillaCompat.setModified

setModified(m)

Public method to set the modification status.

m
  flag indicating the new modification status

### QextScintillaCompat.setSelectionBackgroundColor

setSelectionBackgroundColor(colour)

Public method to set the background color of the selection.

colour
  colour to be set (QColor)

### QextScintillaCompat.setSelectionForegroundColor

setSelectionForegroundColor(colour)

Public method to set the foreground color of the selection.

colour
  colour to be set (QColor)

### QextScintillaCompat.setWrapMode

setWrapMode(mode)

Public slot to set the wrap mode of the text display.

mode
  wrap mode (QextScintilla.WrapNone or QextScintilla.WrapWord)

### QextScintillaCompat.setWrapVisualFlags

setWrapVisualFlags(visualFlags)

Public method to set the visual flags for wrapped lines.

visualFlags
  flags to be set

### QextScintillaCompat.showUserList

showUserList(id, userlist)

Public method to show a user list.

id
  id of the list to be shown (integer)
userlist
  list of items to be shown (QStringList)

### QextScintillaCompat.textHeight

textHeight()

Public method to get the text height.

Returns:
  text height (integer)

Up

## QSCINTILLA_VERSION

QSCINTILLA_VERSION()

Module function to return the QScintilla version.

If the installed QScintilla is a snapshot version, then assume it is of the latest release and return a version number of 0x99999.

Returns:
  QScintilla version (integer)

Up