Salome HOME
Porting SMESH module to Qt 4
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_DistrTable.h
1 // Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 //
4 // This library is free software; you can redistribute it and/or 
5 // modify it under the terms of the GNU Lesser General Public 
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License. 
8 //
9 // This library is distributed in the hope that it will be useful, 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details. 
13 //
14 // You should have received a copy of the GNU Lesser General Public 
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 // File   : StdMeshersGUI_DistrTable.h
21 // Author : Open CASCADE S.A.S.
22 //
23
24 #ifndef STDMESHERSGUI_DISTRTABLE_H
25 #define STDMESHERSGUI_DISTRTABLE_H
26
27 // SMESH includes
28 #include "SMESH_StdMeshersGUI.hxx"
29
30 // Qt includes
31 #include <QWidget>
32 #include <QList>
33 #include <QMap>
34
35 // IDL includes
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SMESH_Mesh)
38
39 class QPushButton;
40
41 class StdMeshersGUI_DistrTableFrame : public QWidget
42 {
43   Q_OBJECT
44
45   enum { ArgColumn, FuncColumn };
46
47   class Table;
48   class SpinBoxDelegate;
49
50   typedef SMESH::double_array DataArray;
51
52 public:
53   typedef enum { InsertRowBtn, RemoveRowBtn } TableButton;
54   
55   StdMeshersGUI_DistrTableFrame( QWidget* = 0 );
56   ~StdMeshersGUI_DistrTableFrame();
57
58   void         showButton( const TableButton, const bool );
59   bool         isButtonShown( const TableButton ) const;
60
61   void         data( DataArray& ) const;
62   void         setData( const DataArray& );
63
64   void         setFuncMinValue( double );
65
66 private:
67   QPushButton* button( const TableButton ) const;
68
69 private slots:
70   void onInsert();
71   void onRemove();
72
73 signals:
74   void         valueChanged( int, int );
75   void         currentChanged( int, int );
76
77 private:
78   QMap<int, QPushButton*>   myButtons;
79   Table*                    myTable;
80 };
81
82 #endif // STDMESHERSGUI_DISTRTABLE_H