1 // File : SALOMEGUI_TableDlg.h
2 // Created : Wed Dec 25 12:00:00 2002
3 // Descr : Dialog box for displaying/editing of table
5 // Author : Vadim SANDLER
6 // Project : SALOME for ALLIANCES
8 // Copyright : Open CASCADE
11 #ifndef SALOMEGUI_TABLE_DLG_H
12 #define SALOMEGUI_TABLE_DLG_H
15 #include <qlineedit.h>
16 #include <qpushbutton.h>
18 class SALOMEGUI_Table;
19 class SALOMEGUI_TableWidget;
21 #include <SALOMEconfig.h>
22 #include CORBA_SERVER_HEADER(SALOMEDS)
23 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
25 class SALOMEGUI_TableDlg : public QDialog
31 enum { ttNone, ttInt, ttReal, ttBoth, ttAuto };
33 SALOMEGUI_TableDlg( QWidget* parent,
34 SALOMEDS::SObject_var obj,
37 Orientation orient = Horizontal,
38 bool showColumnTitles = true );
39 ~SALOMEGUI_TableDlg();
48 SALOMEGUI_TableWidget* myIntTable;
49 SALOMEGUI_TableWidget* myRealTable;
51 QPushButton* myCancelBtn;
53 SALOMEDS::SObject_var myObject;
56 class SALOMEGUI_TableWidget : public QWidget
60 SALOMEGUI_TableWidget( QWidget* parent = 0,
63 Orientation orient = Horizontal,
64 bool showColumnTitles = true );
65 ~SALOMEGUI_TableWidget();
67 void setTableTitle( const QString& title );
68 QString getTableTitle();
69 void setNumRows( const int num );
71 void setNumCols( const int num );
73 void setRowTitles( QStringList& tlts );
74 void getRowTitles( QStringList& tlts );
75 void setColTitles( QStringList& tlts );
76 void getColTitles( QStringList& tlts );
77 void setUnitsTitle( const QString& tlt );
78 void setUnits( QStringList& units );
79 void getUnits( QStringList& units );
80 void setRowData( int row, QStringList& data );
81 void getRowData( int row, QStringList& data );
83 SALOMEGUI_Table* getTable() { return myTable; }
84 QLineEdit* getTitleEdit() { return myTitleEdit; }
86 bool eventFilter( QObject* o, QEvent* e);
89 void updateButtonsState();
99 QLineEdit* myTitleEdit;
100 SALOMEGUI_Table* myTable;
101 QPushButton* myAddRowBtn;
102 QPushButton* myAddColBtn;
103 QPushButton* myDelRowBtn;
104 QPushButton* myDelColBtn;
105 QPushButton* myAdjustBtn;
106 QPushButton* mySelectAllBtn;
107 QPushButton* myClearBtn;
108 Orientation myOrientation;
111 #endif // SALOMEGUI_TABLE_DLG_H