1 // Copyright (C) 2010-2022 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__
35 class VectBoolSpreadSheet;
37 class NbOfActiveTSDisplay : public QLabel
41 NbOfActiveTSDisplay(QWidget *parent=0);
43 void display(int nbOfItemsOn, int totalNbOfItems);
44 void totalNbOfItemsChanged(int totalNbOfItems);
47 int _total_nb_of_items;
50 class VectBoolItem : public QObject
53 Q_PROPERTY(bool activated READ isActivated WRITE activated)
55 VectBoolItem(QObject *parent, int pos, VectBoolModel *model);
56 bool isActivated() const;
57 void activated(bool val);
59 void theModelHasChanged();
64 mutable bool _old_status;
65 VectBoolModel *_model;
68 class VectBoolWidget : public QFrame
71 VectBoolWidget(QWidget *parent, int nbOfItems);
73 int getNumberOfBoolItems() const;
74 void setItems(const QStringList& dts, const QStringList& its, const QStringList& tts);
75 const QMap<QString, VectBoolItem *>& getItems() const { return _items; }
77 static int GetMaxTickValueOfSlider(int val);
79 QMap<QString, VectBoolItem *> _items;
80 QHBoxLayout *_horizontal_layout;
81 QFrame *_spreadsheet_container;
82 QGridLayout *_grid_layout;
83 QGroupBox *_group_box;
84 QVBoxLayout *_vertical_layout;
85 NbOfActiveTSDisplay *_nb_of_time_steps_on;
86 QSlider *_nb_of_rows_selecter;
87 QPushButton *_sel_unsel_all;
88 VectBoolSpreadSheet *_vbw;