1 // Copyright (C) 2010-2015 CEA/DEN, EDF R&D
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, or (at your option) any later version.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay
21 #ifndef __VECTBOOLWIDGET_H__
22 #define __VECTBOOLWIDGET_H__
34 class VectBoolSpreadSheet;
36 class NbOfActiveTSDisplay : public QLabel
40 NbOfActiveTSDisplay(QWidget *parent=0);
42 void display(int nbOfItemsOn, int totalNbOfItems);
43 void totalNbOfItemsChanged(int totalNbOfItems);
46 int _total_nb_of_items;
49 class VectBoolItem : public QObject
52 Q_PROPERTY(bool activated READ isActivated WRITE activated)
54 VectBoolItem(QObject *parent, int pos, VectBoolModel *model);
55 bool isActivated() const;
56 void activated(bool val);
58 void theModelHasChanged();
63 mutable bool _old_status;
64 VectBoolModel *_model;
67 class VectBoolWidget : public QFrame
70 VectBoolWidget(QWidget *parent, int nbOfItems);
72 int getNumberOfBoolItems() const;
73 void setItems(const QStringList& dts, const QStringList& its, const QStringList& tts);
74 const QVector<VectBoolItem *>& getItems() const { return _items; }
76 static int GetMaxTickValueOfSlider(int val);
78 QVector<VectBoolItem *> _items;
79 QHBoxLayout *_horizontal_layout;
80 QFrame *_spreadsheet_container;
81 QGridLayout *_grid_layout;
82 QGroupBox *_group_box;
83 QVBoxLayout *_vertical_layout;
84 NbOfActiveTSDisplay *_nb_of_time_steps_on;
85 QSlider *_nb_of_rows_selecter;
86 QPushButton *_sel_unsel_all;
87 VectBoolSpreadSheet *_vbw;