Salome HOME
Prevent exception at shape selection if no mesh was pre-selected
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_DeleteGroupDlg.h
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 // 
4 //  This library is free software; you can redistribute it and/or 
5 //  modify it under the terms of the GNU Lesser General Public 
6 //  License as published by the Free Software Foundation; either 
7 //  version 2.1 of the License. 
8 // 
9 //  This library is distributed in the hope that it will be useful, 
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 //  Lesser General Public License for more details. 
13 // 
14 //  You should have received a copy of the GNU Lesser General Public 
15 //  License along with this library; if not, write to the Free Software 
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 // 
18 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
19 //
20 //
21 //
22 //  File   : SMESHGUI_DeleteGroupDlg.h
23 //  Author : Sergey LITONIN
24 //  Module : SMESH
25
26
27 #ifndef SMESHGUI_DELETEGROUPDLG_H
28 #define SMESHGUI_DELETEGROUPDLG_H
29
30 #include <qdialog.h>
31 #include <qlist.h>
32
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SMESH_Group)
35
36 class QCloseEvent;
37 class QFrame;
38 class QPushButton;
39 class SALOME_Selection;
40 class QListBox;
41
42 /*
43   Class       : SMESHGUI_DeleteGroupDlg
44   Description : Delete groups and their contents
45 */
46
47 class SMESHGUI_DeleteGroupDlg : public QDialog
48
49   Q_OBJECT
50     
51 public:
52                                      SMESHGUI_DeleteGroupDlg( QWidget*, SALOME_Selection* );
53   virtual                            ~SMESHGUI_DeleteGroupDlg();
54
55   void                               Init( SALOME_Selection* ) ;
56   
57 private:
58
59   void                               closeEvent( QCloseEvent* e ) ;
60   void                               enterEvent ( QEvent * ) ;            
61   
62 private slots:
63
64   void                               onOk();
65   bool                               onApply();
66   void                               onClose();
67
68   void                               onDeactivate();
69
70   void                               onSelectionDone();
71
72 private:
73
74   QFrame*                            createButtonFrame( QWidget* );
75   QFrame*                            createMainFrame  ( QWidget* );
76   bool                               isValid();
77   
78 private:
79
80   QPushButton*                       myOkBtn;
81   QPushButton*                       myApplyBtn;
82   QPushButton*                       myCloseBtn;
83   QListBox*                          myListBox;
84   SALOME_Selection*                  mySelection;
85   
86   QValueList<SMESH::SMESH_GroupBase_var> myListGrp;
87   bool                                   myBlockSelection;
88   
89 };
90
91 #endif
92
93
94
95
96