]> SALOME platform Git repositories - modules/yacs.git/blob - src/genericgui/CaseSwitch.cxx
Salome HOME
09fc38b4d863b19e3e0d414f2ecb9b33343f8a50
[modules/yacs.git] / src / genericgui / CaseSwitch.cxx
1 //  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 #include "CaseSwitch.hxx"
20
21 //#define _DEVDEBUG_
22 #include "YacsTrace.hxx"
23
24 using namespace std;
25 using namespace YACS::HMI;
26
27 CaseSwitch::CaseSwitch(QWidget *parent)
28 {
29   DEBTRACE("CaseSwitch::CaseSwitch");
30   setParent(parent);
31   setupUi(this);
32   _isDefault = false;
33 }
34
35 CaseSwitch::~CaseSwitch()
36 {
37   DEBTRACE("CaseSwitch::~CaseSwitch");
38 }
39
40 void CaseSwitch::on_cb_default_stateChanged(int state)
41 {
42   DEBTRACE("CaseSwitch::on_cb_default_stateChanged " << state)
43   if (state == Qt::Unchecked)
44     setDefaultChecked(false);
45   else
46     setDefaultChecked(true);
47 }
48
49 bool CaseSwitch::isDefaultChecked()
50 {
51   return _isDefault;
52 }
53
54 void CaseSwitch::setDefaultChecked(bool isDefault)
55 {
56   DEBTRACE("CaseSwitch::setDefaultChecked " << isDefault)
57   _isDefault = isDefault;
58   sb_case->setVisible(!_isDefault);
59   cb_default->setChecked(isDefault);
60 }