]> SALOME platform Git repositories - modules/gui.git/blob - src/SVTK/SVTK_DialogBase.cxx
Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/gui.git] / src / SVTK / SVTK_DialogBase.cxx
1 //  SALOME VTKViewer : build VTK viewer into Salome desktop
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   : 
25 //  Author : 
26 //  Module : SALOME
27 //  $Header$
28
29 #include "SVTK_DialogBase.h"
30
31 #include "QtxAction.h"
32
33 /*!
34   Constructor
35 */
36 SVTK_DialogBase
37 ::SVTK_DialogBase(QtxAction* theAction,
38                   QWidget* theParent,
39                   const char* theName, 
40                   bool theModal, 
41                   WFlags theWFalgs):
42   QDialog(theParent, 
43           theName, 
44           theModal, 
45           theWFalgs | WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
46   myAction(theAction)
47 {
48   connect(theParent, SIGNAL(Show( QShowEvent * )), this, SLOT(onParentShow()));
49   connect(theParent, SIGNAL(Hide( QHideEvent * )), this, SLOT(onParentHide()));
50 }
51
52 /*
53  *  Destroys the object and frees any allocated resources
54  */
55 SVTK_DialogBase
56 ::~SVTK_DialogBase()
57 {
58   // no need to delete child widgets, Qt does it all for us
59 }
60
61 void 
62 SVTK_DialogBase
63 ::onParentShow()
64 {
65   if(myAction->isOn())
66     show();
67   else
68     hide();
69 }
70
71 void 
72 SVTK_DialogBase
73 ::onParentHide()
74 {
75   hide();
76 }
77
78 void 
79 SVTK_DialogBase
80 ::done( int r )
81 {
82   myAction->setOn( false );
83   QDialog::done( r );
84 }