itom 1.4.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 <qstring.h> 00044 #include <qcolor.h> 00045 00046 #include "ui_widgetPropEditorStyles.h" 00047 00048 namespace ito 00049 { 00050 00051 class WidgetPropEditorStyles : public AbstractPropertyPageWidget 00052 { 00053 Q_OBJECT 00054 00055 public: 00056 struct StyleNode 00057 { 00058 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) {} 00059 StyleNode() {} 00060 StyleNode(int index, QString name) : m_index(index), m_name(name), m_fillToEOL(0) {} 00061 int m_index; 00062 QString m_name; 00063 QFont m_font; 00064 bool m_fillToEOL; 00065 QColor m_foregroundColor; 00066 QColor m_backgroundColor; 00067 }; 00068 00069 WidgetPropEditorStyles(QWidget *parent = NULL); 00070 ~WidgetPropEditorStyles(); 00071 00072 void readSettings(); 00073 void writeSettings(); 00074 00075 protected: 00076 00077 private: 00078 Ui::WidgetPropEditorStyles ui; 00079 00080 QVector<StyleNode> m_styles; 00081 00082 QsciLexerPython* qSciLex; 00083 00084 void setFontSizeGeneral(const int fontSizeAdd); 00085 00086 signals: 00087 00088 public slots: 00089 00090 private slots: 00091 void on_listWidget_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous); 00092 void on_btnBackgroundColor_clicked(); 00093 void on_btnFont_clicked(); 00094 void on_btnForegroundColor_clicked(); 00095 void on_checkFillEOL_stateChanged(int state); 00096 void on_btnFontSizeDec_clicked(); 00097 void on_btnFontSizeInc_clicked(); 00098 void on_btnReset_clicked(); 00099 }; 00100 00101 } //end namespace ito 00102 00103 #endif