eric6/Preferences/PreferencesLexer.py

Tue, 10 Sep 2019 19:30:07 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 10 Sep 2019 19:30:07 +0200
changeset 7229
53054eb5b15a
parent 6942
2602857055c5
child 7360
9190402e4505
permissions
-rw-r--r--

Removed obsolete "from __future__ import ..." statements.

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
6645
ad476851d7e0 Updated copyright for 2019.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
3 # Copyright (c) 2002 - 2019 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
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
10
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
11 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
12 from PyQt5.Qsci import QsciScintillaBase
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 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
15 import Globals
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
17
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 class PreferencesLexerError(Exception):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 Class defining a special error for the PreferencesLexer class.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 def __init__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
26 self._errorMessage = QCoreApplication.translate(
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
27 "PreferencesLexerError",
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
28 "Unspecific PreferencesLexer error.")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 def __repr__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3178
diff changeset
32 Special method returning a representation of the exception.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 @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
35 @rtype str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 return repr(self._errorMessage)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 def __str__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3178
diff changeset
41 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
42
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 @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
44 @rtype str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 return self._errorMessage
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
48
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 class PreferencesLexerLanguageError(PreferencesLexerError):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 Class defining a special error for the PreferencesLexer class.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 def __init__(self, language):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 Constructor
2964
84b65fb9e780 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2503
diff changeset
56
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
57 @param language lexer language
6866
b792455b35cd Regenerated source docu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6864
diff changeset
58 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 PreferencesLexerError.__init__(self)
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
61 self._errorMessage = QCoreApplication.translate(
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
62 "PreferencesLexerError",
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
63 'Unsupported Lexer Language: {0}').format(language)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
65
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
66 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
67 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
68 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
69 configuration.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 def __init__(self, language, parent=None):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
75 @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
76 @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
77 @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
78 @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
79 lexer language
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 """
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
81 super(PreferencesLexer, self).__init__(parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82
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
83 # 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
84 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
85 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
86 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
87 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
88 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
89 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
90
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 # 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
92 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
93 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
94 if self.__lex is None:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 raise PreferencesLexerLanguageError(language)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 # 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
98 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
99 if self.__lex.hasSubstyles():
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
100 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
101
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
102 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
103 """
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
104 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
105 """
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
106 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
107 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
108 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
109
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
110 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
111 """
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 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
113
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 @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
115 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
116 @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
117 """
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 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
119
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 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
121 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
122 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
123 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
124 if self.__lex.hasSubstyles():
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
125 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
126 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
127 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
128 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
129
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 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
131
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
132 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
133 """
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 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
135
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 @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
137 @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
138 @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
139 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
140 @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
141 """
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 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
143
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 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
145 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
146 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
147 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
148
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 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
150
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
151 def defaultColor(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 """
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
153 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
154
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
155 @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
156 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
157 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
158 @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
159 @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
160 @rtype QColor
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
162 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
163 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
164 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
165 color = self.__lex.defaultColor(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
166
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
167 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
168
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
169 def color(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 """
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
171 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
172
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
173 @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
174 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
175 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
176 @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
177 @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
178 @rtype QColor
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
180 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
181 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
182 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
183 color = self.__lex.color(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
184
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
185 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
186
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
187 def setColor(self, c, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 """
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
189 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
190
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
191 @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
192 @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
193 @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
194 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
195 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
196 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
198 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
199 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
200 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
201 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
202
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
203 def defaultPaper(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 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
206
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
207 @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
208 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
209 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
210 @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
211 @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
212 @rtype QColor
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
214 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
215 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
216 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
217 color = self.__lex.defaultPaper(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
218
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
219 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
220
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
221 def paper(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 Public method to get the background for a style.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
225 @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
226 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
227 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
228 @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
229 @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
230 @rtype QColor
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
232 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
233 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
234 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
235 color = self.__lex.paper(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
236
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
237 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
238
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
239 def setPaper(self, c, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 Public method to set the background for a style.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
243 @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
244 @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
245 @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
246 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
247 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
248 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
250 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
251 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
252 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
253 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
254
6858
9d962e654978 Corrected the SubstyledLexer.hasSubStyle() method to SubstyledLexer.hasSubstyle() to be consistent.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6855
diff changeset
255 def defaultEolFill(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257 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
258
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
259 @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
260 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
261 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
262 @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
263 @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
264 @rtype bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
266 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
267 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
268 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
269 eolFill = self.__lex.defaultEolFill(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
270
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
271 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
272
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
273 def eolFill(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 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
276
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
277 @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
278 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
279 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
280 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 @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
282 @rtype bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
284 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
285 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
286 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
287 eolFill = self.__lex.eolFill(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
288
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
289 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
290
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
291 def setEolFill(self, eolfill, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
293 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
294
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
295 @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
296 @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
297 @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
298 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
299 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
300 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
302 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
303 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
304 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
305 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
306
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
307 def defaultFont(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309 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
310
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
311 @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
312 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
313 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
314 @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
315 @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
316 @rtype QFont
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
318 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
319 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
320 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
321 font = self.__lex.defaultFont(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
322
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
323 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
324
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
325 def font(self, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 Public method to get the font for a style.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
329 @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
330 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
331 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
332 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
333 @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
334 @rtype QFont
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
336 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
337 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
338 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
339 font = self.__lex.font(style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
340
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
341 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
342
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
343 def setFont(self, f, style, substyle=-1):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 Public method to set the font for a style.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347 @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
348 @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
349 @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
350 @type int
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
351 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
352 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353 """
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
354 if substyle >= 0:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
355 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
356 else:
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
357 self.__lex.setFont(f, style)
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
358
6861
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
359 def defaultWords(self, style, substyle=-1):
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
360 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
361 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
362
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
363 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
364 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
365 @param substyle sub-style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
366 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
367 @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
368 @rtype str
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
369 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
370 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
371 words = self.__lex.substyleDefaultWords(style, substyle)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
372 else:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
373 words = ""
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
374
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
375 return words
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
376
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
377 def words(self, style, substyle=-1):
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
378 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
379 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
380
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
381 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
382 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
383 @param substyle sub-style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
384 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
385 @return whitespace separated list of words
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
386 @rtype str
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
387 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
388 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
389 words = self.__lex.substyleWords(style, substyle)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
390 else:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
391 words = ""
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
392
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
393 return words
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
394
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
395 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
396 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
397 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
398
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
399 @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
400 @type str
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
401 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
402 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
403 @param substyle sub-style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
404 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
405 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
406 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
407 # only supported for sub-styles
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
408 self.__lex.setSubstyleWords(words, style, substyle)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
409
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
410 def defaultDescription(self, style, substyle=-1):
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
411 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
412 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
413
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
414 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
415 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
416 @param substyle sub-style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
417 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
418 @return default description of the style
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
419 @rtype str
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
420 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
421 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
422 desc = self.__lex.substyleDefaultDescription(style, substyle)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
423 else:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
424 # 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
425 desc = self.__lex.description(style)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
426
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
427 return desc
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
428
6855
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
429 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
430 """
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
431 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
432
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
433 @param style style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
434 @type int
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
435 @param substyle sub-style number
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
436 @type int
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
437 @return description of the style
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
438 @rtype str
4d80c8cc99a1 SubstyledLexer: continued implementing the getter and setter methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6854
diff changeset
439 """
6861
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
440 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
441 desc = self.__lex.substyleDescription(style, substyle)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
442 else:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
443 desc = self.__lex.description(style)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
444
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
445 return desc
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
446
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
447 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
448 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
449 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
450
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
451 @param description description for the style
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
452 @type str
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
453 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
454 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
455 @param substyle sub-style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
456 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
457 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
458 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
459 # only supported for sub-styles
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
460 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
461
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
462 def language(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
463 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
464 Public method to get the lexers programming language.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
466 @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
467 @rtype str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
468 """
6853
0922aa829e5e PreferencesLexer: started to prepare it for handling of sub-style aware lexers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
469 return self.__lex.language()
6861
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
470
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
471 def hasStyle(self, style, substyle):
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
472 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
473 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
474
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
475 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
476 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
477 @param substyle sub-style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
478 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
479 @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
480 @rtype bool
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
481 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
482 if substyle >= 0:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
483 ok = self.__lex.hasSubstyle(style, substyle)
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
484 else:
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
485 ok = True
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
486
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
487 return ok
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
488
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
489 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
490 """
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 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
492
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 @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
494 @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
495 @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
496 @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
497 """
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 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
499
6861
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
500 def addSubstyle(self, style):
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
501 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
502 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
503
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
504 @param style style number
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
505 @type int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
506 @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
507 @rtype int
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
508 """
20899dc18e59 PreferencesLexer, SubstyledLexer: completed the list of methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6858
diff changeset
509 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
510
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 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
512 """
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 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
514
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 @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
516 @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
517 @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
518 @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
519 @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
520 @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
521 """
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
522 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
523
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 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
525 """
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 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
527
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 @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
529 @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
530 """
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
531 self.__lex.loadDefaultSubStyles(style)

eric ide

mercurial