# eric4.Preferences.ConfigurationPages.EditorHighlightingStylesPage

Module implementing the Editor Highlighting Styles configuration page.

### Global Attributes

None

### Classes

EditorHighlightingStylesPage | Class implementing the Editor Highlighting Styles configuration page.

### Functions

create | Module function to create the configuration page.

## EditorHighlightingStylesPage

Class implementing the Editor Highlighting Styles configuration page.

### Derived from

ConfigurationPageBase, Ui_EditorHighlightingStylesPage

### Class Attributes

FAMILYANDSIZE
FAMILYONLY
FONT
SIZEONLY

### Class Methods

None

### Methods

EditorHighlightingStylesPage | Constructor
__allFontsButtonMenuTriggered | Private slot used to change the font of all styles of a selected lexer.
__changeFont | Private slot to change the highlighter font.
__exportStyles | Private method to export the styles of the given lexers.
__fontButtonMenuTriggered | Private slot used to select the font of the selected style and lexer.
__importStyles | Private method to import the styles of the given lexers.
__setToDefault | Private method to set a specific style to its default values.
on_allBackgroundColoursButton_clicked | Private method used to select the background colour of all styles of a selected lexer.
on_allDefaultButton_clicked | Private method to set all styles to their default values.
on_allEolFillButton_clicked | Private method used to set the eolfill for all styles of a selected lexer.
on_backgroundButton_clicked | Private method used to select the background colour of the selected style and lexer.
on_defaultButton_clicked | Private method to set the current style to its default values.
on_eolfillCheckBox_toggled | Private method used to set the eolfill for the selected style and lexer.
on_exportAllButton_clicked | Private slot to export the styles of all lexers.
on_exportCurrentButton_clicked | Private slot to export the styles of the current lexer.
on_foregroundButton_clicked | Private method used to select the foreground colour of the selected style and lexer.
on_importAllButton_clicked | Private slot to import the styles of all lexers.
on_importCurrentButton_clicked | Private slot to import the styles of the current lexer.
on_lexerLanguageComboBox_activated | Private slot to fill the style combo of the source page.
on_styleElementList_currentRowChanged | Private method to set up the style element part of the source page.
save | Public slot to save the Editor Highlighting Styles configuration.
saveState | Public method to save the current state of the widget.
setFont | Local function to set the font.
setSampleFont | Local function to set the font of the sample text.
setState | Public method to set the state of the widget.

### Static Methods

None

#### EditorHighlightingStylesPage (Constructor)

EditorHighlightingStylesPage(lexers)

Constructor

lexers
  reference to the lexers dictionary

#### EditorHighlightingStylesPage.__allFontsButtonMenuTriggered

__allFontsButtonMenuTriggered(act)

Private slot used to change the font of all styles of a selected lexer.

act
  reference to the triggering action (QAction)

#### EditorHighlightingStylesPage.__changeFont

__changeFont(doAll, familyOnly, sizeOnly)

Private slot to change the highlighter font.

doAll
  flag indicating to change the font for all styles (boolean)
familyOnly
  flag indicating to set the font family only (boolean)
sizeOnly
  flag indicating to set the font size only (boolean

#### EditorHighlightingStylesPage.__exportStyles

__exportStyles(lexers)

Private method to export the styles of the given lexers.

lexers
  list of lexer objects for which to export the styles

#### EditorHighlightingStylesPage.__fontButtonMenuTriggered

__fontButtonMenuTriggered(act)

Private slot used to select the font of the selected style and lexer.

act
  reference to the triggering action (QAction)

#### EditorHighlightingStylesPage.__importStyles

__importStyles(lexers)

Private method to import the styles of the given lexers.

lexers
  dictionary of lexer objects for which to import the styles

#### EditorHighlightingStylesPage.__setToDefault

__setToDefault(style)

Private method to set a specific style to its default values.

style
  style to be reset (integer)

#### EditorHighlightingStylesPage.on_allBackgroundColoursButton_clicked

on_allBackgroundColoursButton_clicked()

Private method used to select the background colour of all styles of a selected lexer.

#### EditorHighlightingStylesPage.on_allDefaultButton_clicked

on_allDefaultButton_clicked()

Private method to set all styles to their default values.

#### EditorHighlightingStylesPage.on_allEolFillButton_clicked

on_allEolFillButton_clicked()

Private method used to set the eolfill for all styles of a selected lexer.

#### EditorHighlightingStylesPage.on_backgroundButton_clicked

on_backgroundButton_clicked()

Private method used to select the background colour of the selected style and lexer.

#### EditorHighlightingStylesPage.on_defaultButton_clicked

on_defaultButton_clicked()

Private method to set the current style to its default values.

#### EditorHighlightingStylesPage.on_eolfillCheckBox_toggled

on_eolfillCheckBox_toggled(b)

Private method used to set the eolfill for the selected style and lexer.

b
  Flag indicating enabled or disabled state.

#### EditorHighlightingStylesPage.on_exportAllButton_clicked

on_exportAllButton_clicked()

Private slot to export the styles of all lexers.

#### EditorHighlightingStylesPage.on_exportCurrentButton_clicked

on_exportCurrentButton_clicked()

Private slot to export the styles of the current lexer.

#### EditorHighlightingStylesPage.on_foregroundButton_clicked

on_foregroundButton_clicked()

Private method used to select the foreground colour of the selected style and lexer.

#### EditorHighlightingStylesPage.on_importAllButton_clicked

on_importAllButton_clicked()

Private slot to import the styles of all lexers.

#### EditorHighlightingStylesPage.on_importCurrentButton_clicked

on_importCurrentButton_clicked()

Private slot to import the styles of the current lexer.

#### EditorHighlightingStylesPage.on_lexerLanguageComboBox_activated

on_lexerLanguageComboBox_activated(language)

Private slot to fill the style combo of the source page.

language
  The lexer language (string or QString)

#### EditorHighlightingStylesPage.on_styleElementList_currentRowChanged

on_styleElementList_currentRowChanged(index)

Private method to set up the style element part of the source page.

index
  the style index.

#### EditorHighlightingStylesPage.save

save()

Public slot to save the Editor Highlighting Styles configuration.

#### EditorHighlightingStylesPage.saveState

saveState()

Public method to save the current state of the widget.

Returns:
  array containing the index of the selected lexer language (integer) and the index of the selected lexer entry (integer)

#### EditorHighlightingStylesPage.setFont

setFont(style, familyOnly, sizeOnly)

Local function to set the font.

font
  font to be set (QFont)
style
  style to set the font for (integer)
familyOnly
  flag indicating to set the font family only (boolean)
sizeOnly
  flag indicating to set the font size only (boolean

#### EditorHighlightingStylesPage.setSampleFont

setSampleFont(familyOnly, sizeOnly)

Local function to set the font of the sample text.

font
  font to be set (QFont)
familyOnly
  flag indicating to set the font family only (boolean)
sizeOnly
  flag indicating to set the font size only (boolean

#### EditorHighlightingStylesPage.setState

setState(state)

Public method to set the state of the widget.

state
  state data generated by saveState

Up

## create

create(dlg)

Module function to create the configuration page.

dlg
  reference to the configuration dialog

Up