]> SALOME platform Git repositories - modules/hydro.git/blob - src/ZLEVEL/HYDROGUI_ZLevelsDlg.cxx
Salome HOME
icons are applied for visible objects
[modules/hydro.git] / src / ZLEVEL / HYDROGUI_ZLevelsDlg.cxx
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #include "HYDROGUI_ZLevelsDlg.h"
24 #include "HYDROGUI_ZLevelsModel.h"
25
26 #include <QCheckBox>
27 #include <QLayout>
28 #include <QListView>
29 #include <QPushButton>
30
31
32 HYDROGUI_ZLevelsDlg::HYDROGUI_ZLevelsDlg( QWidget* theParent )
33 : QDialog( theParent )
34 {
35   QVBoxLayout* aMainLayout = new QVBoxLayout( this );
36   aMainLayout->setMargin( 5 );
37
38   QHBoxLayout* aListLayout = new QHBoxLayout();
39
40   myList = new QListView( this );
41   myList->setModel( new HYDROGUI_ZLevelsModel );
42
43   myTop = new QPushButton( tr("TOP") );
44   myUp = new QPushButton( tr("UP") );
45   myDown = new QPushButton( tr("DOWN") );
46   myBottom = new QPushButton( tr("BOTTOM") );
47   QVBoxLayout* aListButtonsLayout = new QVBoxLayout();
48   aListButtonsLayout->addWidget( myTop );
49   aListButtonsLayout->addWidget( myUp );
50   aListButtonsLayout->addWidget( myDown );
51   aListButtonsLayout->addWidget( myBottom );
52   aListButtonsLayout->addStretch();
53   aListLayout->addWidget( myList );
54   aListLayout->addLayout( aListButtonsLayout );
55   aMainLayout->addLayout( aListLayout );
56
57   myAllObjects = new QCheckBox( tr( "ALL_OBJECTS" ) );
58   aMainLayout->addWidget( myAllObjects );
59
60   QHBoxLayout* aDlgButtonsLayout = new QHBoxLayout();
61   myApply = new QPushButton( tr("APPLY") );
62   myClose = new QPushButton( tr("CLOSE") );
63   aDlgButtonsLayout->addWidget( myApply );
64   aDlgButtonsLayout->addWidget( myClose );
65   aDlgButtonsLayout->addStretch();
66   aMainLayout->addLayout( aDlgButtonsLayout );
67 }
68
69 HYDROGUI_ZLevelsDlg::~HYDROGUI_ZLevelsDlg()
70 {
71 }
72
73 void HYDROGUI_ZLevelsDlg::setObjects( const QList<QString>& theObjects )
74 {
75   HYDROGUI_ZLevelsModel* aModel = dynamic_cast<HYDROGUI_ZLevelsModel*>( myList->model() );
76   aModel->setObjects( theObjects );
77 }