eric6/Preferences/PreferencesLexer.py

Sun, 01 Sep 2019 19:40:53 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 01 Sep 2019 19:40:53 +0200
branch
without_py2_and_pyqt4
changeset 7198
684261ef2165
parent 6942
2602857055c5
child 7229
53054eb5b15a
permissions
-rw-r--r--

Removed the Qt4 runtime stuff.

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

eric ide

mercurial