Salome HOME
Correct some memory leaks
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_LocalLengthDlg.h
1 //  SMESH SMESHGUI : GUI for SMESH component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SMESHGUI_LocalLengthDlg.h
25 //  Author : Nicolas REJNERI
26 //  Module : SMESH
27 //  $Header$
28
29 #ifndef DIALOGBOX_LOCAL_LENGTH_H
30 #define DIALOGBOX_LOCAL_LENGTH_H
31
32 // QT Includes
33 #include <qvariant.h>
34 #include <qdialog.h>
35 #include <qvalidator.h>
36
37 class QVBoxLayout; 
38 class QHBoxLayout; 
39 class QGridLayout; 
40 class QButtonGroup;
41 class QGroupBox;
42 class QLabel;
43 class QLineEdit;
44 class QPushButton;
45 class QRadioButton;
46 class SMESHGUI;
47 class SMESHGUI_SpinBox;
48
49
50 //=================================================================================
51 // class    : SMESHGUI_LocalLengthDlg
52 // purpose  :
53 //=================================================================================
54 class SMESHGUI_LocalLengthDlg : public QDialog
55
56     Q_OBJECT
57
58 public:
59     SMESHGUI_LocalLengthDlg( QWidget* parent = 0, const char* name = 0,  bool modal = FALSE, WFlags fl = 0 );
60     ~SMESHGUI_LocalLengthDlg();
61
62 private:
63
64     void Init() ;
65     void closeEvent( QCloseEvent* e ) ;
66     void enterEvent ( QEvent * ) ;
67
68     SMESHGUI*             mySMESHGUI ;
69
70     QString               myNameHypothesis ;
71     double                myLength ;
72     bool                  myOkNameHypothesis ;
73     bool                  myOkLength ;
74
75     int                   myConstructorId ;
76     QLineEdit*            myEditCurrentArgument; 
77
78     QGroupBox* GroupButtons;
79     QPushButton* buttonApply;
80     QPushButton* buttonOk;
81     QPushButton* buttonCancel;
82     QButtonGroup* GroupConstructors;
83     QRadioButton* Constructor1;
84     QGroupBox* GroupC1;
85     QLabel* TextLabel_NameHypothesis ;
86     QLabel* TextLabel_Length ;
87     QLineEdit* LineEdit_NameHypothesis ;
88     SMESHGUI_SpinBox* SpinBox_Length ;
89
90 private slots:
91
92     void ConstructorsClicked(int constructorId);
93     void ClickOnOk();
94     void ClickOnCancel();
95     void ClickOnApply();
96     void DeactivateActiveDialog() ;
97     void ActivateThisDialog() ;
98     void TextChangedInLineEdit(const QString& newText) ;
99   
100 protected:
101     QGridLayout* SMESHGUI_LocalLengthDlgLayout;
102     QGridLayout* GroupButtonsLayout;
103     QGridLayout* GroupConstructorsLayout;
104     QGridLayout* GroupC1Layout;
105     QGridLayout* GroupC2Layout;
106 };
107
108 #endif // DIALOGBOX_LOCAL_LENGTH_H