Salome HOME
428b1900865ad89739f7d5fd8f8a919f48680920
[modules/kernel.git] / src / SALOMEGUI / SALOMEGUI_SetValueDlg.h
1 //  File      : SALOMEGUI_SetValueDlg.h
2 //  Created   : Wed Jan 21 16:38:42 2001
3 //  Author    : Vadim SANDLER
4 //  Project   : SALOME
5 //  Module    : SALOMEGUI
6 //  Copyright : Open CASCADE
7 //  $Header$
8
9 #ifndef SALOMEGUI_SETVALUEDLG_H
10 #define SALOMEGUI_SETVALUEDLG_H
11
12 #include <qdialog.h>
13
14 class QLineEdit;
15 class QPushButton;
16 class QValidator;
17 class QLabel;
18
19 //=================================================================================
20 // class    : SALOMEGUI_SetValueDlg
21 // purpose  : Common dialog box for setting integer, double and string values
22 //=================================================================================
23 class SALOMEGUI_SetValueDlg : public QDialog
24
25 public:
26   static QString  getString ( const QString& caption, 
27                               const QString& label, 
28                               const QString& oldValue = QString::null,
29                               bool*          ok = 0, 
30                               QWidget*       parent = 0 );
31   static int      getInteger( const QString& caption, 
32                               const QString& label, 
33                               const int      oldValue = 0,
34                               bool*          ok = 0, 
35                               QWidget*       parent = 0 );
36   static double   getDouble ( const QString& caption, 
37                               const QString& label, 
38                               const double   oldValue = 0.0,
39                               bool*          ok = 0, 
40                               QWidget*       parent = 0 );
41
42 private:
43   SALOMEGUI_SetValueDlg( QWidget* parent = 0 );
44   ~SALOMEGUI_SetValueDlg();
45   
46   void            setValue( const QString& value );
47   QString         value();
48   void            setValidator( QValidator* v );
49   void            setLabel( const QString& label );
50     
51 private:
52   QLabel*         myLabel;
53   QLineEdit*      myLineEdit;
54   QPushButton*    myButtonOk;
55   QPushButton*    myButtonCancel;
56 };
57
58 #endif // SALOMEGUI_SETVALUEDLG_H