]> SALOME platform Git repositories - modules/gui.git/blob - src/QDS/QDS_RadioBox.h
Salome HOME
Merge from OCC_development_generic_2006
[modules/gui.git] / src / QDS / QDS_RadioBox.h
1 #ifndef QDS_RADIOBOX_H
2 #define QDS_RADIOBOX_H
3
4 #include "QDS_Datum.h"
5
6 #include <Qtx.h>
7
8 #include <qmap.h>
9 #include <qpixmap.h>
10 #include <qstringlist.h>
11
12 #ifdef WNT
13 #pragma warning( disable:4251 )
14 #endif
15
16 class QButtonGroup;
17 class QRadioButton;
18
19 class QDS_EXPORT QDS_RadioBox : public QDS_Datum
20 {
21   Q_OBJECT
22
23 public:
24   QDS_RadioBox( const QString&, QWidget* = 0, const int = All, const QString& = QString::null );
25   virtual ~QDS_RadioBox();
26
27   int                        count( bool = false ) const;
28   void                       values( QValueList<int>&, bool = false ) const;
29
30   int                        columns() const;
31   void                       setColumns( const int );
32
33   bool                       state( const int ) const;
34   void                       setState( const bool, const int, const bool = true );
35   void                       setState( const bool, const QValueList<int>&, const bool = true );
36   void                       setValues( const QValueList<int>&, const QStringList& );
37   void                       setValues( const QStringList& );
38
39 signals:
40   void                       activated( int );
41
42 protected slots:
43   virtual void               onToggled( bool );
44
45 protected:
46   QButtonGroup*              buttonGroup() const;
47   virtual QWidget*           createControl( QWidget* );
48   void                       buttons( QPtrList<QRadioButton>& ) const;
49
50   virtual QString            getString() const;
51   virtual void               setString( const QString& );
52
53   virtual void               unitSystemChanged( const QString& );
54
55 private:
56   void                       updateRadioBox();
57
58 private:
59   typedef QMap<int, QString> IdValueMap;
60   typedef QMap<int, bool>    IdStateMap;
61
62 private:
63   IdValueMap                 myValue;
64   IdStateMap                 myState;
65
66   QIntList                   myDataIds;
67   QIntList                   myUserIds;
68   QStringList                myUserNames;
69 };
70
71 #ifdef WNT
72 #pragma warning( default:4251 )
73 #endif
74
75 #endif