1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : Style_PrefDlg.h
21 // Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
23 #ifndef STYLE_PREFDLG_H
24 #define STYLE_PREFDLG_H
28 #include <QtxDialog.h>
36 class QListWidgetItem;
43 class QtxDoubleSpinBox;
45 class Style_ResourceMgr;
48 class STYLE_SALOME_EXPORT Style_PrefDlg : public QtxDialog
53 enum { Current, Default, Global, User };
54 enum { TypeRole = Qt::UserRole + 123, NameRole };
57 Style_PrefDlg( QWidget* = 0 );
61 bool eventFilter( QObject*, QEvent* );
64 Style_ResourceMgr* resourceMgr();
65 void fromModel( Style_Model* );
66 void toModel( Style_Model* ) const;
68 QString findUniqueName( const QString&, QListWidgetItem* = 0, bool = false );
77 void onStyleChanged();
80 void onItemChanged( QListWidgetItem* );
81 void onEffectChanged( QAbstractButton* );
84 Style_ResourceMgr* myResMgr;
85 QCheckBox* myStyleCheck;
86 QListWidget* myStylesList;
87 QTabWidget* myStylesTab;
89 PaletteEditor* myPaletteEditor;
90 QtxFontEdit* myFontEdit;
91 QComboBox* myLinesCombo;
92 QSlider* myLinesTransparency;
93 QtxDoubleSpinBox* myEditRound;
94 QtxDoubleSpinBox* myButtonRound;
95 QtxDoubleSpinBox* myFrameRound;
96 QtxDoubleSpinBox* mySliderRound;
97 QCheckBox* myAntiAliasing;
98 QSpinBox* myHorHandleDelta;
99 QSpinBox* myVerHandleDelta;
100 QSpinBox* mySplitterLength;
101 QSpinBox* mySliderSize;
102 QRadioButton* myEffectNone;
103 QRadioButton* myEffectHighlight;
104 QRadioButton* myEffectAutoRaise;
106 QRadioButton* myCurrentEffect;
109 class Style_PrefDlg::PaletteEditor : public QFrame
114 PaletteEditor( QWidget* = 0 );
117 void addColumn( const QString& );
119 QList<int> items() const;
121 void setColor( int, QPalette::ColorGroup, const QColor& );
122 void setColor( int, const QColor&, const QColor& = QColor(), const QColor& = QColor() );
123 QColor color( int, QPalette::ColorGroup ) const;
126 void setAuto( bool );
128 void fromColor( const QColor& );
131 static QString idToName( int );
142 typedef QMap<QPalette::ColorGroup, QtxColorButton*> Btns;
145 QPushButton* myQuickButton;
146 QCheckBox* myAutoCheck;
148 QLabel* myInactiveLab;
149 QLabel* myDisabledLab;
151 QMap<int, Btns> myButtons;
155 friend class Style_PrefDlg;
158 #endif // STYLE_PREFDLG_H