eric6/Preferences/PreferencesLexer.py

Sat, 27 Feb 2021 12:08:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Feb 2021 12:08:23 +0100
changeset 8138
169e65a6787c
parent 7923
91e843545d9a
child 8218
7c09585bd960
permissions
-rw-r--r--

Shell: added functionality to show a prompt when the main client process has exited (e.g. a script ended).

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2002 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
7 Module implementing a special QScintilla lexer to handle the preferences.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
10 from PyQt5.QtCore import QCoreApplication, QObject
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
11 from PyQt5.Qsci import QsciScintillaBase
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 import Preferences
2503
3f1fa98e8e03 Changed code to override the QScintilla lexer default fonts to always use a monospaced family.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
14 import Globals
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
16
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 class PreferencesLexerError(Exception):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 Class defining a special error for the PreferencesLexer class.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 def __init__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 """
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
25 self._errorMessage = QCoreApplication.translate(
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
26 "PreferencesLexerError",
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
27 "Unspecific PreferencesLexer error.")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 def __repr__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3178
diff changeset
31 Special method returning a representation of the exception.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 @return string representing the error message
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
34 @rtype str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 return repr(self._errorMessage)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 def __str__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3178
diff changeset
40 Special method returning a string representation of the exception.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 @return string representing the error message
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
43 @rtype str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 return self._errorMessage
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
47
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 class PreferencesLexerLanguageError(PreferencesLexerError):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 Class defining a special error for the PreferencesLexer class.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 def __init__(self, language):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 Constructor
2964
84b65fb9e780 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2503
diff changeset
55
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
56 @param language lexer language
6866
b792455b35cd Regenerated source docu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6864
diff changeset
57 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 PreferencesLexerError.__init__(self)
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
60 self._errorMessage = QCoreApplication.translate(
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
61 "PreferencesLexerError",
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
62 'Unsupported Lexer Language: {0}').format(language)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
64
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
65 class PreferencesLexer(QObject):
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
66 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
67 Class implementing a Lexer facade for the highlighting styles
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
68 configuration.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 def __init__(self, language, parent=None):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
74 @param language language of the lexer
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
75 @type str
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
76 @param parent parent widget of this lexer (QWidget)
2964
84b65fb9e780 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2503
diff changeset
77 @exception PreferencesLexerLanguageError raised to indicate an invalid
84b65fb9e780 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2503
diff changeset
78 lexer language
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2503
diff changeset
80 super(PreferencesLexer, self).__init__(parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81
2503
3f1fa98e8e03 Changed code to override the QScintilla lexer default fonts to always use a monospaced family.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
82 # These default font families are taken from QScintilla
3f1fa98e8e03 Changed code to override the QScintilla lexer default fonts to always use a monospaced family.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
83 if Globals.isWindowsPlatform():
3f1fa98e8e03 Changed code to override the QScintilla lexer default fonts to always use a monospaced family.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
84 self.__defaultFontFamily = "Courier New"
3f1fa98e8e03 Changed code to override the QScintilla lexer default fonts to always use a monospaced family.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
85 elif Globals.isMacPlatform():
3f1fa98e8e03 Changed code to override the QScintilla lexer default fonts to always use a monospaced family.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
86 self.__defaultFontFamily = "Courier"
3f1fa98e8e03 Changed code to override the QScintilla lexer default fonts to always use a monospaced family.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
87 else:
3f1fa98e8e03 Changed code to override the QScintilla lexer default fonts to always use a monospaced family.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
88 self.__defaultFontFamily = "Bitstream Vera Sans Mono"
3f1fa98e8e03 Changed code to override the QScintilla lexer default fonts to always use a monospaced family.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
89
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 # instantiate a lexer object for the given language
2408
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
91 import QScintilla.Lexers
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
92 self.__lex = QScintilla.Lexers.getLexer(language)
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
93 if self.__lex is None:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 raise PreferencesLexerLanguageError(language)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 # read the last stored values from preferences file
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
97 self.__lex.readSettings(Preferences.Prefs.settings, "Scintilla")
6858
9d962e654978 Corrected the SubstyledLexer.hasSubStyle() method to SubstyledLexer.hasSubstyle() to be consistent.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6855
diff changeset
98 if self.__lex.hasSubstyles():
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
99 self.__lex.loadSubstyles()
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
100
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
101 def writeSettings(self):
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
102 """
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
103 Public method to write the lexer settings.
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
104 """
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
105 self.__lex.writeSettings(Preferences.Prefs.settings, "Scintilla")
6858
9d962e654978 Corrected the SubstyledLexer.hasSubStyle() method to SubstyledLexer.hasSubstyle() to be consistent.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6855
diff changeset
106 if self.__lex.hasSubstyles():
9d962e654978 Corrected the SubstyledLexer.hasSubStyle() method to SubstyledLexer.hasSubstyle() to be consistent.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6855
diff changeset
107 self.__lex.writeSubstyles()
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
108
6854
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
109 def getStyles(self):
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
110 """
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
111 Public method to get a list of all supported styles.
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
112
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
113 @return list of tuples each containing the description of the style,
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
114 style number and sub-style number (or -1 for no sub-style)
6878
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
115 @rtype list of tuples of (str, int, int)
6854
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
116 """
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
117 styles = []
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
118
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
119 for i in range(QsciScintillaBase.STYLE_MAX):
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
120 desc = self.__lex.description(i)
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
121 if desc:
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
122 styles.append((desc, i, -1))
6858
9d962e654978 Corrected the SubstyledLexer.hasSubStyle() method to SubstyledLexer.hasSubstyle() to be consistent.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6855
diff changeset
123 if self.__lex.hasSubstyles():
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
124 for baseStyle in self.__lex.getBaseStyles():
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
125 for subStyle in range(self.__lex.substylesCount(baseStyle)):
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
126 desc = self.__lex.substyleDescription(baseStyle, subStyle)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
127 styles.append((desc, baseStyle, subStyle))
6854
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
128
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
129 return styles
f4dd76230eea PreferencesLexer, EditorHighlightingPage: got rid of the 'styles' and 'ind2style' lists (that was very old style programming).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6853
diff changeset
130
6878
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
131 def getSubStyles(self, style):
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
132 """
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
133 Public method to get a list of all sub-styles of a style.
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
134
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
135 @param style style number
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
136 @type int
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
137 @return list of tuples each containing the description of the style,
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
138 style number and sub-style number (or -1 for no sub-style)
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
139 @rtype list of tuples of (str, int, int)
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
140 """
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
141 styles = []
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
142
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
143 if self.isBaseStyle(style):
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
144 for subStyle in range(self.__lex.substylesCount(style)):
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
145 desc = self.__lex.substyleDescription(style, subStyle)
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
146 styles.append((desc, style, subStyle))
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
147
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
148 return styles
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
149
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
150 def defaultColor(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 """
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
152 Public method to get the default color of a style.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
154 @param style style number
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
155 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
156 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
157 @type int
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
158 @return default color
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
159 @rtype QColor
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
161 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
162 color = self.__lex.substyleDefaultColor(style, substyle)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
163 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
164 color = self.__lex.defaultColor(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
165
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
166 return color
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
167
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
168 def color(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 """
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
170 Public method to get the color of a style.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
172 @param style style number
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
173 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
174 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
175 @type int
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
176 @return color
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
177 @rtype QColor
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
179 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
180 color = self.__lex.substyleColor(style, substyle)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
181 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
182 color = self.__lex.color(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
183
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
184 return color
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
185
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
186 def setColor(self, c, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187 """
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
188 Public method to set the color for a style.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
190 @param c color
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
191 @type QColor
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
192 @param style style number
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
193 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
194 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
195 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
197 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
198 self.__lex.setSubstyleColor(c, style, substyle)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
199 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
200 self.__lex.setColor(c, style)
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
201
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
202 def defaultPaper(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 Public method to get the default background for a style.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
206 @param style style number
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
207 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
208 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
209 @type int
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
210 @return default background color
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
211 @rtype QColor
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
213 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
214 color = self.__lex.substyleDefaultPaper(style, substyle)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
215 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
216 color = self.__lex.defaultPaper(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
217
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
218 return color
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
219
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
220 def paper(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 Public method to get the background for a style.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
224 @param style the style number
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
225 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
226 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
227 @type int
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
228 @return background color
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
229 @rtype QColor
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
231 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
232 color = self.__lex.substylePaper(style, substyle)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
233 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
234 color = self.__lex.paper(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
235
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
236 return color
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
237
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
238 def setPaper(self, c, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 Public method to set the background for a style.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
242 @param c background color
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
243 @type QColor
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
244 @param style style number
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
245 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
246 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
247 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
249 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
250 self.__lex.setSubstylePaper(c, style, substyle)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
251 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
252 self.__lex.setPaper(c, style)
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
253
6858
9d962e654978 Corrected the SubstyledLexer.hasSubStyle() method to SubstyledLexer.hasSubstyle() to be consistent.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6855
diff changeset
254 def defaultEolFill(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256 Public method to get the default eolFill flag for a style.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
258 @param style style number
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
259 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
260 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
261 @type int
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
262 @return default eolFill flag
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
263 @rtype bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
265 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
266 eolFill = self.__lex.substyleDefaultEolFill(style, substyle)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
267 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
268 eolFill = self.__lex.defaultEolFill(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
269
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
270 return eolFill
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
271
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
272 def eolFill(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 Public method to get the eolFill flag for a style.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
276 @param style style number
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
277 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
278 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
279 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 @return eolFill flag
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
281 @rtype bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
283 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
284 eolFill = self.__lex.substyleEolFill(style, substyle)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
285 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
286 eolFill = self.__lex.eolFill(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
287
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
288 return eolFill
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
289
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
290 def setEolFill(self, eolfill, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 Public method to set the eolFill flag for a style.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
293
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
294 @param eolfill eolFill flag
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
295 @type bool
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
296 @param style style number
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
297 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
298 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
299 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
301 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
302 self.__lex.setSubstyleEolFill(eolfill, style, substyle)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
303 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
304 self.__lex.setEolFill(eolfill, style)
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
305
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
306 def defaultFont(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 Public method to get the default font for a style.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
310 @param style style number
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
311 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
312 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
313 @type int
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
314 @return default font
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
315 @rtype QFont
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
317 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
318 font = self.__lex.substyleDefaultFont(style, substyle)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
319 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
320 font = self.__lex.defaultFont(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
321
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
322 return font
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
323
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
324 def font(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 Public method to get the font for a style.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
328 @param style style number
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
329 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
330 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
331 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332 @return font
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
333 @rtype QFont
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
334 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
335 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
336 font = self.__lex.substyleFont(style, substyle)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
337 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
338 font = self.__lex.font(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
339
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
340 return font
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
341
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
342 def setFont(self, f, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 Public method to set the font for a style.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 @param f font
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
347 @type QFont
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
348 @param style style number
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
349 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
350 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
351 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
353 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
354 self.__lex.setSubstyleFont(f, style, substyle)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
355 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
356 self.__lex.setFont(f, style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
357
6861
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
358 def defaultWords(self, style, substyle=-1):
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
359 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
360 Public method to get the default list of words for a style.
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
361
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
362 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
363 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
364 @param substyle sub-style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
365 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
366 @return whitespace separated default list of words
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
367 @rtype str
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
368 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
369 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
370 words = self.__lex.substyleDefaultWords(style, substyle)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
371 else:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
372 words = ""
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
373
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
374 return words
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
375
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
376 def words(self, style, substyle=-1):
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
377 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
378 Public method to get the list of words for a style.
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
379
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
380 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
381 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
382 @param substyle sub-style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
383 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
384 @return whitespace separated list of words
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
385 @rtype str
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
386 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
387 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
388 words = self.__lex.substyleWords(style, substyle)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
389 else:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
390 words = ""
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
391
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
392 return words
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
393
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
394 def setWords(self, words, style, substyle=-1):
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
395 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
396 Public method to set the list of words for a style.
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
397
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
398 @param words whitespace separated list of words
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
399 @type str
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
400 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
401 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
402 @param substyle sub-style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
403 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
404 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
405 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
406 # only supported for sub-styles
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
407 self.__lex.setSubstyleWords(words, style, substyle)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
408
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
409 def defaultDescription(self, style, substyle=-1):
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
410 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
411 Public method to get the default descriptive string for a style.
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
412
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
413 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
414 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
415 @param substyle sub-style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
416 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
417 @return default description of the style
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
418 @rtype str
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
419 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
420 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
421 desc = self.__lex.substyleDefaultDescription(style, substyle)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
422 else:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
423 # for base styles return the hard coded description
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
424 desc = self.__lex.description(style)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
425
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
426 return desc
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
427
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
428 def description(self, style, substyle=-1):
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
429 """
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
430 Public method to get a descriptive string for a style.
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
431
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
432 @param style style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
433 @type int
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
434 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
435 @type int
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
436 @return description of the style
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
437 @rtype str
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
438 """
6861
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
439 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
440 desc = self.__lex.substyleDescription(style, substyle)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
441 else:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
442 desc = self.__lex.description(style)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
443
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
444 return desc
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
445
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
446 def setDescription(self, description, style, substyle=-1):
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
447 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
448 Public method to set a descriptive string for a style.
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
449
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
450 @param description description for the style
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
451 @type str
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
452 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
453 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
454 @param substyle sub-style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
455 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
456 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
457 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
458 # only supported for sub-styles
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
459 self.__lex.setSubstyleDescription(description, style, substyle)
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
460
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
461 def language(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
462 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
463 Public method to get the lexers programming language.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
464
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
465 @return lexer programming language
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
466 @rtype str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
467 """
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
468 return self.__lex.language()
6861
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
469
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
470 def hasStyle(self, style, substyle):
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
471 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
472 Public method to test for a given style definition.
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
473
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
474 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
475 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
476 @param substyle sub-style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
477 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
478 @return flag indicating the existence of a style definition
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
479 @rtype bool
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
480 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
481 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
482 ok = self.__lex.hasSubstyle(style, substyle)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
483 else:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
484 ok = True
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
485
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
486 return ok
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
487
6864
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
488 def isBaseStyle(self, style):
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
489 """
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
490 Public method to test, if a given style may have sub-styles.
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
491
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
492 @param style base style number
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
493 @type int
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
494 @return flag indicating that the style may have sub-styles
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
495 @rtype bool
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
496 """
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
497 return self.__lex.hasSubstyles() and self.__lex.isBaseStyle(style)
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
498
6861
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
499 def addSubstyle(self, style):
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
500 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
501 Public method to add an empty sub-style to a given style.
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
502
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
503 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
504 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
505 @return allocated sub-style number or -1 to indicate an error
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
506 @rtype int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
507 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
508 return self.__lex.addSubstyle(style)
6864
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
509
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
510 def delSubstyle(self, style, substyle):
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
511 """
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
512 Public method to delete a given sub-style definition.
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
513
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
514 @param style base style number
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
515 @type int
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
516 @param substyle sub-style number
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
517 @type int
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
518 @return flag indicating successful deletion
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
519 @rtype bool
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
520 """
7837ab17f079 Sub-Styles: added buttons to the Editor Highlighting Styles configuration page to add, delete, edit and copy sub-style definitions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6861
diff changeset
521 return self.__lex.delSubstyle(style, substyle)
6878
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
522
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
523 def loadDefaultSubStyles(self, style):
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
524 """
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
525 Public method to load the default sub-styles for a given base style.
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
526
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
527 @param style style number
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
528 @type int
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
529 """
79008f970902 EditorHighlightingStylesPage: added a button to reset the sub-styles of a base style to its default values.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6866
diff changeset
530 self.__lex.loadDefaultSubStyles(style)

eric ide

mercurial