itom  3.0.0
widgetPropEditorStyles.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2016, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #ifndef WIDGETPROPEDITORSTYLES_H
24 #define WIDGETPROPEDITORSTYLES_H
25 
26 #include "abstractPropertyPageWidget.h"
27 
28 #include <QtGui>
29 #include <qvector.h>
30 #include <qstring.h>
31 #include <qfont.h>
32 #include <qcolor.h>
33 
34 // Under Windows, define QSCINTILLA_MAKE_DLL to create a Scintilla DLL, or
35 // define QSCINTILLA_DLL to link against a Scintilla DLL, or define neither
36 // to either build or link against a static Scintilla library.
38 #define QSCINTILLA_DLL //http://www.riverbankcomputing.com/pipermail/qscintilla/2007-March/000034.html
39 
40 #include <Qsci/qsciscintilla.h>
41 #include <Qsci/qscilexerpython.h>
42 
43 #include <qstring.h>
44 #include <qcolor.h>
45 
46 #include "ui_widgetPropEditorStyles.h"
47 
48 namespace ito
49 {
50 
52 {
53  Q_OBJECT
54 
55 public:
56  struct StyleNode
57  {
58  StyleNode(int index, QString name, QFont font, bool fillToEOL, QColor foregroundColor, QColor backgroundColor) : m_index(index), m_name(name), m_font(font), m_fillToEOL(fillToEOL), m_foregroundColor(foregroundColor), m_backgroundColor(backgroundColor) {}
59  StyleNode() {}
60  StyleNode(int index, QString name) : m_index(index), m_name(name), m_fillToEOL(0) {}
61  int m_index;
62  QString m_name;
63  QFont m_font;
64  bool m_fillToEOL;
65  QColor m_foregroundColor;
66  QColor m_backgroundColor;
67  };
68 
69  WidgetPropEditorStyles(QWidget *parent = NULL);
71 
72  void readSettings();
73  void writeSettings();
74 
75 protected:
76 
77 private:
78  Ui::WidgetPropEditorStyles ui;
79 
80  QVector<StyleNode> m_styles;
81 
82  QsciLexerPython* qSciLex;
83  bool m_changing;
84 
85  void setFontSizeGeneral(const int fontSizeAdd);
86 
87  void writeSettingsInternal(const QString &filename);
88  void readSettingsInternal(const QString &filename);
89 
90  QColor m_paperBgcolor;
91  QColor m_foldMarginFgcolor;
92  QColor m_foldMarginBgcolor;
93  QColor m_marginFgcolor;
94  QColor m_marginBgcolor;
95  QColor m_markerCurrentBgcolor;
96  QColor m_markerInputBgcolor;
97  QColor m_markerErrorBgcolor;
98  QColor m_whitespaceFgcolor;
99  QColor m_matchedBraceFgcolor;
100  QColor m_matchedBraceBgcolor;
101  QColor m_unmatchedBraceFgcolor;
102  QColor m_unmatchedBraceBgcolor;
103  QColor m_caretBgcolor;
104  QColor m_caretFgcolor;
105  QColor m_selectionBgcolor;
106  QColor m_selectionFgcolor;
107  QColor m_markerSameStringBgcolor;
108 
109 signals:
110 
111 public slots:
112 
113 private slots:
114  void on_listWidget_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
115  void on_btnBackgroundColor_colorChanged(QColor color);
116  void on_btnFont_clicked();
117  void on_btnForegroundColor_colorChanged(QColor color);
118  void on_checkFillEOL_stateChanged(int state);
119  void on_btnFontSizeDec_clicked();
120  void on_btnFontSizeInc_clicked();
121  void on_btnReset_clicked();
122  void on_btnImport_clicked();
123  void on_btnExport_clicked();
124 };
125 
126 } //end namespace ito
127 
128 #endif
Definition: abstractPropertyPageWidget.h:31
void readSettings()
Definition: widgetPropEditorStyles.cpp:114
Definition: apiFunctionsGraph.cpp:39
Definition: widgetPropEditorStyles.h:56
void writeSettings()
Definition: widgetPropEditorStyles.cpp:120
Definition: widgetPropEditorStyles.h:51