1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : VisuGUI_TableDlg.h
21 // Author : Vadim SANDLER
24 #ifndef VisuGUI_TABLE_DLG_H
25 #define VisuGUI_TABLE_DLG_H
28 #include <qlineedit.h>
29 #include <qpushbutton.h>
32 class VisuGUI_TableWidget;
34 #include <SALOMEDSClient_SObject.hxx>
36 #include "VisuGUITools.h"
38 class VISU_GUITOOLS_EXPORT VisuGUI_TableDlg : public QDialog
44 enum { ttNone, ttInt, ttReal, ttBoth, ttAuto };
46 VisuGUI_TableDlg( QWidget* parent,
50 Orientation orient = Horizontal,
51 bool showColumnTitles = true );
55 void keyPressEvent( QKeyEvent* e );
65 VisuGUI_TableWidget* myIntTable;
66 VisuGUI_TableWidget* myRealTable;
68 QPushButton* myCancelBtn;
69 QPushButton* myHelpBtn;
71 _PTR(SObject) myObject;
74 class VisuGUI_TableWidget : public QWidget
78 VisuGUI_TableWidget( QWidget* parent = 0,
81 Orientation orient = Horizontal,
82 bool showColumnTitles = true );
83 ~VisuGUI_TableWidget();
85 void setTableTitle( const QString& title );
86 QString getTableTitle();
87 void setNumRows( const int num );
89 void setNumCols( const int num );
91 void setRowTitles( QStringList& tlts );
92 void getRowTitles( QStringList& tlts );
93 void setColTitles( QStringList& tlts );
94 void getColTitles( QStringList& tlts );
95 void setUnitsTitle( const QString& tlt );
96 void setUnits( QStringList& units );
97 void getUnits( QStringList& units );
98 void setRowData( int row, QStringList& data );
99 void getRowData( int row, QStringList& data );
101 VisuGUI_Table* getTable() { return myTable; }
102 QLineEdit* getTitleEdit() { return myTitleEdit; }
104 bool eventFilter( QObject* o, QEvent* e);
107 void updateButtonsState();
117 QLineEdit* myTitleEdit;
118 VisuGUI_Table* myTable;
119 QPushButton* myAddRowBtn;
120 QPushButton* myAddColBtn;
121 QPushButton* myDelRowBtn;
122 QPushButton* myDelColBtn;
123 QPushButton* myAdjustBtn;
124 QPushButton* mySelectAllBtn;
125 QPushButton* myClearBtn;
126 Orientation myOrientation;
129 #endif // VisuGUI_TABLE_DLG_H