1 // Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
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/
19 #ifndef QDS_COMBOBOX_H
20 #define QDS_COMBOBOX_H
22 #include "QDS_Datum.h"
26 #include <qstringlist.h>
28 #include <QtxComboBox.h>
31 #pragma warning( disable:4251 )
34 class QDS_EXPORT QDS_ComboBox : public QDS_Datum
39 QDS_ComboBox( const QString&, QWidget* = 0, const int = All, const QString& = QString::null );
40 virtual ~QDS_ComboBox();
42 bool editable() const;
43 void setEditable( const bool );
45 int count( bool = false ) const;
46 void values( QValueList<int>&, bool = false ) const;
48 virtual int integerValue() const;
49 virtual double doubleValue() const;
50 virtual void setIntegerValue( const int );
51 virtual void setDoubleValue( const double );
53 bool state( const int ) const;
54 void setState( const bool, const int, const bool = true );
55 void setState( const bool, const QValueList<int>&, const bool = true );
56 void setValues( const QValueList<int>&, const QStringList& );
57 void setValues( const QStringList& );
61 int stringToValue( const QString& ) const;
62 QString valueToString( const int ) const;
65 void activated( int );
66 void activated( const QString& );
69 virtual void onActivated( int );
70 virtual void onTextChanged( const QString& );
73 QtxComboBox* comboBox() const;
74 virtual QWidget* createControl( QWidget* );
76 virtual QString getString() const;
77 virtual void setString( const QString& );
79 virtual void unitSystemChanged( const QString& );
82 int getId( const int ) const;
83 int getId( const QString& ) const;
84 int getIndex( const int ) const;
85 int getIndex( const QString& ) const;
87 void updateComboBox();
90 typedef QMap<int, QPixmap> IdIconsMap;
91 typedef QMap<int, QString> IdValueMap;
92 typedef QMap<int, bool> IdStateMap;
93 typedef QMap<int, int> IdIndexMap;
103 QStringList myUserNames;
107 #pragma warning( default:4251 )