itom 1.1.0
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2013, Institut für Technische Optik (ITO), 00005 Universität Stuttgart, Germany 00006 00007 This file is part of itom. 00008 00009 itom is free software; you can redistribute it and/or modify it 00010 under the terms of the GNU Library General Public Licence as published by 00011 the Free Software Foundation; either version 2 of the Licence, or (at 00012 your option) any later version. 00013 00014 itom is distributed in the hope that it will be useful, but 00015 WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library 00017 General Public Licence for more details. 00018 00019 You should have received a copy of the GNU Library General Public License 00020 along with itom. If not, see <http://www.gnu.org/licenses/>. 00021 *********************************************************************** */ 00022 00023 #ifndef WIDGETPROPEDITORSTYLES_H 00024 #define WIDGETPROPEDITORSTYLES_H 00025 00026 #include "abstractPropertyPageWidget.h" 00027 00028 #include <QtGui> 00029 #include <qvector.h> 00030 #include <qstring.h> 00031 #include <qfont.h> 00032 #include <qcolor.h> 00033 00034 // Under Windows, define QSCINTILLA_MAKE_DLL to create a Scintilla DLL, or 00035 // define QSCINTILLA_DLL to link against a Scintilla DLL, or define neither 00036 // to either build or link against a static Scintilla library. 00038 #define QSCINTILLA_DLL //http://www.riverbankcomputing.com/pipermail/qscintilla/2007-March/000034.html 00039 00040 #include <Qsci/qsciscintilla.h> 00041 #include <Qsci/qscilexerpython.h> 00042 00043 #include "ui_widgetPropEditorStyles.h" 00044 00045 class WidgetPropEditorStyles : public AbstractPropertyPageWidget 00046 { 00047 Q_OBJECT 00048 00049 public: 00050 struct StyleNode 00051 { 00052 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) {} 00053 StyleNode() {} 00054 StyleNode(int index, QString name) : m_index(index), m_name(name), m_fillToEOL(0) {} 00055 int m_index; 00056 QString m_name; 00057 QFont m_font; 00058 bool m_fillToEOL; 00059 QColor m_foregroundColor; 00060 QColor m_backgroundColor; 00061 }; 00062 00063 WidgetPropEditorStyles(QWidget *parent = NULL); 00064 ~WidgetPropEditorStyles(); 00065 00066 void readSettings(); 00067 void writeSettings(); 00068 00069 protected: 00070 00071 private: 00072 Ui::WidgetPropEditorStyles ui; 00073 00074 QVector<StyleNode> m_styles; 00075 00076 QsciLexerPython* qSciLex; 00077 00078 void setFontSizeGeneral(const int fontSizeAdd); 00079 00080 signals: 00081 00082 public slots: 00083 00084 private slots: 00085 void on_listWidget_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous); 00086 void on_btnBackgroundColor_clicked(); 00087 void on_btnFont_clicked(); 00088 void on_btnForegroundColor_clicked(); 00089 void on_checkFillEOL_stateChanged(int state); 00090 void on_btnFontSizeDec_clicked(); 00091 void on_btnFontSizeInc_clicked(); 00092 00093 }; 00094 00095 #endif