Salome HOME
Porting to Mandrake 10.1 and new products:
[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 int      getInteger( const QString& caption, 
40                               const QString& label, 
41                               int            bottom,
42                               int            top,
43                               const int      oldValue = 0,
44                               bool*          ok = 0, 
45                               QWidget*       parent = 0 );
46   static double   getDouble ( const QString& caption, 
47                               const QString& label, 
48                               const double   oldValue = 0.0,
49                               bool*          ok = 0, 
50                               QWidget*       parent = 0 );
51 public slots:
52   void accept();
53
54 private:
55   SALOMEGUI_SetValueDlg( QWidget* parent = 0 );
56   ~SALOMEGUI_SetValueDlg();
57   
58   void            setValue( const QString& value );
59   QString         value();
60   void            setValidator( QValidator* v );
61   void            setLabel( const QString& label );
62     
63 private:
64   QLabel*         myLabel;
65   QLineEdit*      myLineEdit;
66   QPushButton*    myButtonOk;
67   QPushButton*    myButtonCancel;
68 };
69
70 #endif // SALOMEGUI_SETVALUEDLG_H