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