--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_ListModel.h"
+
+HYDROGUI_ListModel::HYDROGUI_ListModel( QObject* theParent )
+ : QAbstractListModel( theParent )
+{
+}
+
+HYDROGUI_ListModel::~HYDROGUI_ListModel()
+{
+}
+
+QVariant HYDROGUI_ListModel::data( const QModelIndex &theIndex, int theRole ) const
+{
+ QVariant aVariant;
+
+ int aRow = theIndex.row();
+ if ( theIndex.isValid() && aRow < myObjects.count() &&
+ theRole == Qt::DisplayRole ) {
+ aVariant = myObjects.at( aRow );
+ }
+
+ return aVariant;
+}
+
+int HYDROGUI_ListModel::rowCount( const QModelIndex &theParent ) const
+{
+ return myObjects.count();
+}
+
+void HYDROGUI_ListModel::setObjects( const QList<QString>& theObjects )
+{
+ myObjects = theObjects;
+}
\ No newline at end of file
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_LISTMODEL_H
+#define HYDROGUI_LISTMODEL_H
+
+#include <QAbstractListModel>
+
+/**
+ * \class HYDROGUI_ListModel
+ * \brief The class representing custom list model
+ */
+class HYDROGUI_ListModel : public QAbstractListModel
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_ListModel( QObject* theParent = 0 );
+ ~HYDROGUI_ListModel();
+
+ virtual QVariant data( const QModelIndex &theIndex, int theRole = Qt::DisplayRole ) const;
+
+ virtual int rowCount( const QModelIndex &theParent = QModelIndex() ) const;
+
+ void setObjects( const QList<QString>& theObjects );
+
+private:
+ QList<QString> myObjects;
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_ZLevelsDlg.h"
+#include "HYDROGUI_ListModel.h"
+
+#include <QCheckBox>
+#include <QLayout>
+#include <QListView>
+#include <QPushButton>
+
+
+HYDROGUI_ZLevelsDlg::HYDROGUI_ZLevelsDlg( QWidget* theParent )
+: QDialog( theParent )
+{
+ QVBoxLayout* aMainLayout = new QVBoxLayout( this );
+ aMainLayout->setMargin( 5 );
+
+ QHBoxLayout* aListLayout = new QHBoxLayout();
+
+ myList = new QListView( this );
+ myList->setModel( new HYDROGUI_ListModel );
+
+ myTop = new QPushButton( tr("TOP") );
+ myUp = new QPushButton( tr("UP") );
+ myDown = new QPushButton( tr("DOWN") );
+ myBottom = new QPushButton( tr("BOTTOM") );
+ QVBoxLayout* aListButtonsLayout = new QVBoxLayout();
+ aListButtonsLayout->addWidget( myTop );
+ aListButtonsLayout->addWidget( myUp );
+ aListButtonsLayout->addWidget( myDown );
+ aListButtonsLayout->addWidget( myBottom );
+ aListButtonsLayout->addStretch();
+ aListLayout->addWidget( myList );
+ aListLayout->addLayout( aListButtonsLayout );
+ aMainLayout->addLayout( aListLayout );
+
+ myAllObjects = new QCheckBox( tr( "ALL_OBJECTS" ) );
+ aMainLayout->addWidget( myAllObjects );
+
+ QHBoxLayout* aDlgButtonsLayout = new QHBoxLayout();
+ myApply = new QPushButton( tr("APPLY") );
+ myClose = new QPushButton( tr("CLOSE") );
+ aDlgButtonsLayout->addWidget( myApply );
+ aDlgButtonsLayout->addWidget( myClose );
+ aDlgButtonsLayout->addStretch();
+ aMainLayout->addLayout( aDlgButtonsLayout );
+}
+
+HYDROGUI_ZLevelsDlg::~HYDROGUI_ZLevelsDlg()
+{
+}
+
+void HYDROGUI_ZLevelsDlg::setObjects( const QList<QString>& theObjects )
+{
+ HYDROGUI_ListModel* aModel = dynamic_cast<HYDROGUI_ListModel*>( myList->model() );
+ aModel->setObjects( theObjects );
+}
\ No newline at end of file
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_ZLEVELSPANEL_H
+#define HYDROGUI_ZLEVELSPANEL_H
+
+#include <QDialog>
+
+class QCheckBox;
+class QListView;
+class QPushButton;
+
+/**
+ * \class HYDROGUI_ZLevelsDlg
+ * \brief The class representing widget for managing Z levels
+ */
+class HYDROGUI_ZLevelsDlg : public QDialog
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_ZLevelsDlg( QWidget* theParent );
+ virtual ~HYDROGUI_ZLevelsDlg();
+
+ void setObjects( const QList<QString>& theObjects );
+
+private:
+ QListView* myList;
+ QPushButton* myTop;
+ QPushButton* myUp;
+ QPushButton* myDown;
+ QPushButton* myBottom;
+ QCheckBox* myAllObjects;
+ QPushButton* myApply;
+ QPushButton* myClose;
+};
+
+#endif
--- /dev/null
+call "%VS90COMNTOOLS%..\..\VC\vcvarsall.bat" x86
+SET appendix="Visual Studio 9 2008"
+
+@SET PDIR=..\..\..\..\..\PRODUCTSD
+call %PDIR%\env_compile.bat
+
+echo %PATH%
+
+qmake -tp vc -spec win32-msvc2008 zlevel.pro -r
\ No newline at end of file
--- /dev/null
+#include "HYDROGUI_ZLevelsDlg.h"
+
+#include <QApplication>
+
+int main( int argc, char** argv ){
+ QApplication app(argc, argv);
+
+ HYDROGUI_ZLevelsDlg* aDlg = new HYDROGUI_ZLevelsDlg( 0 );
+ QList< QString > anObjects;
+ anObjects << "A" << "B" << "C" << "D" << "E" << "F" << "G" << "H";
+ aDlg->setObjects( anObjects );
+ aDlg->exec();
+
+ return app.exec();
+}
\ No newline at end of file
--- /dev/null
+HEADERS = HYDROGUI_ZLevelsDlg.h HYDROGUI_ListModel.h
+
+SOURCES = main.cpp HYDROGUI_ZLevelsDlg.cxx HYDROGUI_ListModel.cxx
+CONFIG += qt
+
+TEMPLATE = app
\ No newline at end of file