Mercurial > hg > octave-lyh
comparison libgui/src/m-editor/lexer-octave-gui.h @ 16402:7fa90eb41240
gui: individually configurable styles of the editor lexers
* color-picker.cc/.h: new class for a simple color picker
* libgui/src/module.mk: added color-picker.cc/.h
* file-editor-tab.cc(update_lexer): read config of the lexer from settings file
* file-editor-tab(notice_settings): editor font not directly configured from
the settings file but via the lexer settings in update_lexer
* lexer-octave-gui.cc(constructor): inherits from QsciLexerOctave instaead of
QsciLexer, code cleanup
* lexer-octave-gui.cc(language,lexer,defaultFont,defaultColor,description):
removed, original methods used and configured via settings
* lexer-octave-gui.h: removed functions language,lexer,defaultFont,defaultColor,
description and enum; using methods of octave lexer instead
* settings-dialog.cc(constructor): editor font not configured from settings,
defining lexers for supported languages and reading their actual settings
from the settings file (via read_lexer_settings)
* settings-dialog.cc(read_lexer_settings): new function for reading the lexers
settings from settings file and creating the tabs with interactive elements
for configuring these settings
* settings-dialog.cc(write_changed_settings): remove settings for editor font,
defining lexers for supported languages and writing the settings from the
dialog into the settings file (via write_lexer_settings)
* settings-dialog.cc(write_lexer_settings): new funciton for getting the new
lexer settings from the interactive elements and write them into the settings
file
* settings-dialog.h: new functiond read_lexer_settings, write_lexer_settings
* settings-dialog.ui: new tab for the editor styles which contents is
dynamically created in settings_dialog ()
author | Torsten <ttl@justmail.de> |
---|---|
date | Sun, 31 Mar 2013 23:56:11 +0200 |
parents | c22a6cecaedd |
children | 3781abc74540 |
comparison
equal
deleted
inserted
replaced
16401:2a294ee8efc0 | 16402:7fa90eb41240 |
---|---|
24 #define LEXEROCTAVE_H | 24 #define LEXEROCTAVE_H |
25 | 25 |
26 #include "resource-manager.h" | 26 #include "resource-manager.h" |
27 #include <QObject> | 27 #include <QObject> |
28 #include <Qsci/qsciglobal.h> | 28 #include <Qsci/qsciglobal.h> |
29 #include <Qsci/qscilexer.h> | 29 #include <Qsci/qscilexeroctave.h> |
30 #include <Qsci/qsciapis.h> | 30 #include <Qsci/qsciapis.h> |
31 | 31 |
32 class lexer_octave_gui : public QsciLexer | 32 class lexer_octave_gui : public QsciLexerOctave |
33 { | 33 { |
34 Q_OBJECT | 34 Q_OBJECT |
35 | 35 |
36 public: | 36 public: |
37 // the used styles | |
38 enum | |
39 { | |
40 Default = 0, | |
41 Comment = 1, | |
42 Command = 2, | |
43 Number = 3, | |
44 Keyword = 4, | |
45 SingleQuotedString = 5, | |
46 Operator = 6, | |
47 Identifier = 7, | |
48 DoubleQuotedString = 8 | |
49 }; | |
50 | 37 |
51 lexer_octave_gui (QObject *parent = 0); | 38 lexer_octave_gui (QObject *parent = 0); |
52 ~lexer_octave_gui (); | 39 ~lexer_octave_gui (); |
53 const char *language () const; | 40 virtual const char *keywords (int set) const; |
54 const char *lexer () const; | |
55 QColor defaultColor (int style) const; | |
56 QFont defaultFont (int style) const; | |
57 const char *keywords (int set) const; | |
58 QString description (int style) const; | |
59 | 41 |
60 private: | 42 private: |
61 lexer_octave_gui (const lexer_octave_gui &); | 43 lexer_octave_gui (const lexer_octave_gui &); |
62 lexer_octave_gui &operator= (const lexer_octave_gui &); | 44 lexer_octave_gui &operator= (const lexer_octave_gui &); |
63 QsciAPIs *lexer_api; | 45 QsciAPIs *lexer_api; |