1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : Style_PrefDlg.h
23 // Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
25 #ifndef STYLE_PREFDLG_H
26 #define STYLE_PREFDLG_H
30 #include <QtxDialog.h>
38 class QListWidgetItem;
45 class QtxDoubleSpinBox;
47 class Style_ResourceMgr;
50 class STYLE_SALOME_EXPORT Style_PrefDlg : public QtxDialog
55 enum { Current, Default, Global, User };
56 enum { TypeRole = Qt::UserRole + 123, NameRole };
59 Style_PrefDlg( QWidget* = 0 );
65 void keyPressEvent( QKeyEvent* );
68 Style_ResourceMgr* resourceMgr();
69 void fromModel( Style_Model* );
70 void toModel( Style_Model* ) const;
72 QString findUniqueName( const QString&, QListWidgetItem* = 0, bool = false );
81 void onStyleChanged();
84 void onItemChanged( QListWidgetItem* );
85 void onEffectChanged( QAbstractButton* );
88 Style_ResourceMgr* myResMgr;
89 QCheckBox* myStyleCheck;
90 QListWidget* myStylesList;
91 QTabWidget* myStylesTab;
93 PaletteEditor* myPaletteEditor;
94 QtxFontEdit* myFontEdit;
95 QComboBox* myLinesCombo;
96 QSlider* myLinesTransparency;
97 QtxDoubleSpinBox* myEditRound;
98 QtxDoubleSpinBox* myButtonRound;
99 QtxDoubleSpinBox* myFrameRound;
100 QtxDoubleSpinBox* mySliderRound;
101 QCheckBox* myAntiAliasing;
102 QSpinBox* myHorHandleDelta;
103 QSpinBox* myVerHandleDelta;
104 QSpinBox* mySplitterLength;
105 QSpinBox* mySliderSize;
106 QRadioButton* myEffectNone;
107 QRadioButton* myEffectHighlight;
108 QRadioButton* myEffectAutoRaise;
110 QRadioButton* myCurrentEffect;
113 class Style_PrefDlg::PaletteEditor : public QFrame
118 PaletteEditor( QWidget* = 0 );
121 void addColumn( const QString& );
123 QList<int> items() const;
125 void setColor( int, QPalette::ColorGroup, const QColor& );
126 void setColor( int, const QColor&, const QColor& = QColor(), const QColor& = QColor() );
127 QColor color( int, QPalette::ColorGroup ) const;
130 void setAuto( bool );
132 void fromColor( const QColor& );
135 static QString idToName( int );
146 typedef QMap<QPalette::ColorGroup, QtxColorButton*> Btns;
149 QPushButton* myQuickButton;
150 QCheckBox* myAutoCheck;
152 QLabel* myInactiveLab;
153 QLabel* myDisabledLab;
155 QMap<int, Btns> myButtons;
159 friend class Style_PrefDlg;
162 #endif // STYLE_PREFDLG_H