# eric7.QScintilla.Lexers.SubstyledLexer

Module implementing the lexer mixin class.

### Global Attributes

None

### Classes

SubstyledLexer | Class to implement the sub-styled lexer mixin class.

### Functions

None

## SubstyledLexer

Class to implement the sub-styled lexer mixin class.

### Derived from

Lexer

### Class Attributes

None

### Class Methods

None

### Methods

SubstyledLexer | Constructor
addSubstyle | Public method to add an empty sub-style to a given base style.
delSubstyle | Public method to delete a given sub-style definition.
getBaseStyles | Public method to get the list of supported base styles.
hasSubstyle | Public method to test for a given sub-style definition.
hasSubstyles | Public method to indicate the support of sub-styles.
isBaseStyle | Public method to test, if a given style may have sub-styles.
loadAllDefaultSubStyles | Public method to load the default sub-style definitions.
loadDefaultSubStyles | Public method to load the default sub-styles for a given base style.
loadSubstyles | Public method to load the sub-styles from the settings file.
readSubstyles | Public method to load the sub-styles and configure the editor.
setSubstyleColor | Public method to set the foreground color of a sub-style.
setSubstyleDescription | Public method to set the description for a sub-style.
setSubstyleEolFill | Public method to set the eolfill flag of a sub-style.
setSubstyleFont | Public method to set the font of a sub-style.
setSubstylePaper | Public method to set the background color of a sub-style.
setSubstyleWords | Public method to set the words for a sub-style.
substyleColor | Public method to get the sub-style foreground color.
substyleDefaultColor | Public method to get the sub-style default foreground color.
substyleDefaultDescription | Public method to get the default description of a sub-style.
substyleDefaultEolFill | Public method to get the default eolfill flag.
substyleDefaultFont | Public method to get the default sub-style font.
substyleDefaultPaper | Public method to get the sub-style default background color.
substyleDefaultWords | Public method to get the default words of a sub-style.
substyleDescription | Public method to get the description of a sub-style.
substyleEolFill | Public method to get the eolfill flag.
substyleFont | Public method to get the sub-style font.
substylePaper | Public method to get the sub-style background color.
substyleWords | Public method to get the words of a sub-style.
substylesCount | Public method to get the number of defined sub-styles.
writeSubstyles | Public method to save the sub-styles.

### Static Methods

None

#### SubstyledLexer (Constructor)

SubstyledLexer()

Constructor

#### SubstyledLexer.addSubstyle

addSubstyle(style)

Public method to add an empty sub-style to a given base style.

style (int)
  base style number

Return:
  allocated sub-style number or -1 to indicate an error

Return Type:
  int

#### SubstyledLexer.delSubstyle

delSubstyle(style, substyle)

Public method to delete a given sub-style definition.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  flag indicating successful deletion

Return Type:
  bool

#### SubstyledLexer.getBaseStyles

getBaseStyles()

Public method to get the list of supported base styles.

Return:
  list of base styles

Return Type:
  list of int

#### SubstyledLexer.hasSubstyle

hasSubstyle(style, substyle)

Public method to test for a given sub-style definition.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  flag indicating the existence of a sub-style definition

Return Type:
  bool

#### SubstyledLexer.hasSubstyles

hasSubstyles()

Public method to indicate the support of sub-styles.

Return:
  flag indicating sub-styling support

Return Type:
  bool

#### SubstyledLexer.isBaseStyle

isBaseStyle(style)

Public method to test, if a given style may have sub-styles.

style (int)
  base style number

Return:
  flag indicating that the style may have sub-styles

Return Type:
  bool

#### SubstyledLexer.loadAllDefaultSubStyles

loadAllDefaultSubStyles()

Public method to load the default sub-style definitions.

#### SubstyledLexer.loadDefaultSubStyles

loadDefaultSubStyles(style)

Public method to load the default sub-styles for a given base style.

style (int)
  style number

#### SubstyledLexer.loadSubstyles

loadSubstyles()

Public method to load the sub-styles from the settings file.

#### SubstyledLexer.readSubstyles

readSubstyles(editor)

Public method to load the sub-styles and configure the editor.

editor (QsciScintilla)
  reference to the editor object

#### SubstyledLexer.setSubstyleColor

setSubstyleColor(color, style, substyle)

Public method to set the foreground color of a sub-style.

color (QColor)
  foreground color to be set
style (int)
  base style number
substyle (int)
  sub-style number

#### SubstyledLexer.setSubstyleDescription

setSubstyleDescription(description, style, substyle)

Public method to set the description for a sub-style.

description (str)
  description to be set
style (int)
  base style number
substyle (int)
  sub-style number

#### SubstyledLexer.setSubstyleEolFill

setSubstyleEolFill(eolFill, style, substyle)

Public method to set the eolfill flag of a sub-style.

eolFill (bool)
  eolfill flag to be set
style (int)
  base style number
substyle (int)
  sub-style number

#### SubstyledLexer.setSubstyleFont

setSubstyleFont(font, style, substyle)

Public method to set the font of a sub-style.

font (QFont)
  font to be set
style (int)
  base style number
substyle (int)
  sub-style number

#### SubstyledLexer.setSubstylePaper

setSubstylePaper(color, style, substyle)

Public method to set the background color of a sub-style.

color (QColor)
  background color to be set
style (int)
  base style number
substyle (int)
  sub-style number

#### SubstyledLexer.setSubstyleWords

setSubstyleWords(words, style, substyle)

Public method to set the words for a sub-style.

words (str)
  words to be set separated by white-space
style (int)
  base style number
substyle (int)
  sub-style number

#### SubstyledLexer.substyleColor

substyleColor(style, substyle)

Public method to get the sub-style foreground color.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  foreground color

Return Type:
  QColor

#### SubstyledLexer.substyleDefaultColor

substyleDefaultColor(style, substyle)

Public method to get the sub-style default foreground color.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  default foreground color

Return Type:
  QColor

#### SubstyledLexer.substyleDefaultDescription

substyleDefaultDescription(style, substyle)

Public method to get the default description of a sub-style.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  sub-style default description

Return Type:
  str

#### SubstyledLexer.substyleDefaultEolFill

substyleDefaultEolFill(style, substyle)

Public method to get the default eolfill flag.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  default eolfill flag

Return Type:
  bool

#### SubstyledLexer.substyleDefaultFont

substyleDefaultFont(style, substyle)

Public method to get the default sub-style font.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  default font

Return Type:
  QFont

#### SubstyledLexer.substyleDefaultPaper

substyleDefaultPaper(style, substyle)

Public method to get the sub-style default background color.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  default background color

Return Type:
  QColor

#### SubstyledLexer.substyleDefaultWords

substyleDefaultWords(style, substyle)

Public method to get the default words of a sub-style.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  white-space separated default word list

Return Type:
  str

#### SubstyledLexer.substyleDescription

substyleDescription(style, substyle)

Public method to get the description of a sub-style.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  sub-style description

Return Type:
  str

#### SubstyledLexer.substyleEolFill

substyleEolFill(style, substyle)

Public method to get the eolfill flag.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  eolfill flag

Return Type:
  bool

#### SubstyledLexer.substyleFont

substyleFont(style, substyle)

Public method to get the sub-style font.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  font

Return Type:
  QFont

#### SubstyledLexer.substylePaper

substylePaper(style, substyle)

Public method to get the sub-style background color.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  background color

Return Type:
  QColor

#### SubstyledLexer.substyleWords

substyleWords(style, substyle)

Public method to get the words of a sub-style.

style (int)
  base style number
substyle (int)
  sub-style number

Return:
  white-space separated word list

Return Type:
  str

#### SubstyledLexer.substylesCount

substylesCount(style)

Public method to get the number of defined sub-styles.

style (int)
  base style number

Return:
  number of defined sub-styles

Return Type:
  int

#### SubstyledLexer.writeSubstyles

writeSubstyles()

Public method to save the sub-styles.

Up