Salome HOME
mergefrom branch BR_V511_PR tag mergeto_trunk_03feb09
[modules/yacs.git] / src / genericgui / FormContainer.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 "FormContainer.hxx"
20 #include "FormComponent.hxx"
21
22 //#define _DEVDEBUG_
23 #include "YacsTrace.hxx"
24
25 #include <QList>
26
27 using namespace std;
28
29 FormContainer::FormContainer(QWidget *parent)
30 {
31   setupUi(this);
32   _checked = false;
33   _advanced = false;
34
35   gridLayout2->removeWidget(cb_host);
36   delete cb_host;
37   cb_host = new ComboBox(gb_basic);
38   gridLayout2->addWidget(cb_host, 2, 1, 1, 1);
39
40   QIcon icon;
41   icon.addFile("icons:icon_down.png");
42   icon.addFile("icons:icon_up.png",
43                 QSize(), QIcon::Normal, QIcon::On);
44   tb_container->setIcon(icon);
45   on_tb_container_toggled(false);
46   on_ch_advance_stateChanged(0);
47 }
48
49 FormContainer::~FormContainer()
50 {
51 }
52
53 void FormContainer::on_tb_container_toggled(bool checked)
54 {
55   //DEBTRACE("FormContainer::on_tb_container_toggled " << checked);
56   _checked = checked;
57   if (_checked) fr_container->show();
58   else fr_container->hide();
59 }
60
61 void FormContainer::on_ch_advance_stateChanged(int state)
62 {
63   //DEBTRACE("FormContainer::on_ch_advance_stateChanged " << state);
64   if (state) gb_advance->show();
65   else gb_advance->hide();
66 }