Salome HOME
e9389341b3b1534c14416a28c679128e19727d3c
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_BrowseNodeDlg.h
1 //  File      : SUPERVGUI_BrowseNodeDlg.h
2 //  Created   : 10 / 01 / 2003
3 //  Author    : Vitaly SMETANNIKOV
4 //  Project   : SALOME 
5 //  Module    : SUPERVGUI
6 //  Copyright : Open CASCADE 
7
8
9 #ifndef SUPERVGUI_BrowseNodeDlg_H
10 #define SUPERVGUI_BrowseNodeDlg_H
11
12 #include <qdialog.h>
13 #include "SUPERVGUI_Def.h"
14 #include "SUPERVGUI_Port.h"
15 #include "SALOME_Selection.h"
16
17 class SUPERVGUI_Node;
18
19 /** 
20  * Class for ports values management (for internal using)
21  */
22 class SUPERVGUI_PortField : public QObject {
23
24   Q_OBJECT
25
26 public:
27   SUPERVGUI_PortField( QWidget* theParent, SUPERV_Port thePort );
28   virtual ~SUPERVGUI_PortField() {};
29
30   bool eventFilter( QObject* o, QEvent* e );
31
32   bool isEditable () { return myIsEditable; }
33
34   void setData( const QString& data ) { myValue->setText( data ); myValue->home( false ); }
35   void updateGUI()   { myValue->setText( myPort->ToString() ); }
36
37   bool setNewValue();
38   
39 signals :
40   void activated();
41
42 public:
43   SUPERV_Port myPort;
44   QLabel*     myLabel;
45   QLineEdit*  myValue;
46   bool        myIsEditable;
47 };
48
49
50 /**
51  * Browse Node Dialog box
52  */
53 class SUPERVGUI_BrowseNodeDlg: public QDialog {
54   
55   Q_OBJECT
56
57 public:
58   SUPERVGUI_BrowseNodeDlg( SUPERVGUI_Node* theNode );
59   virtual ~SUPERVGUI_BrowseNodeDlg();
60
61   void setValues();
62
63 protected slots:
64   void accept();
65   void reject();
66   void onFieldActivated();
67   void onSelectionChanged();
68
69 protected:
70   void showEvent( QShowEvent* theEvent );
71
72 private:
73   SUPERVGUI_Node*               myNode;
74   bool                          myIsEditable;
75   QPtrList<SUPERVGUI_PortField> myPortsList;
76   SUPERVGUI_PortField*          myActiveField;
77   SALOME_Selection*             mySelection;
78 };
79
80 /**
81  * Get Value dialog box
82  */
83 class SUPERVGUI_GetValueDlg: public QDialog {
84   Q_OBJECT
85
86 public:
87 //  SUPERVGUI_GetValueDlg( SUPERVGUI_Port thePort );
88   SUPERVGUI_GetValueDlg( SUPERVGUI_PortIn* thePort );
89   SUPERVGUI_GetValueDlg( SUPERVGUI_PortInESNode* thePort );
90   ~SUPERVGUI_GetValueDlg();
91
92 private slots:
93   void accept();
94   void reject();
95   void onSelectionChanged();
96   
97 private:
98   QPushButton*         myOKBtn;
99   QPushButton*         myCancelBtn;    
100   SUPERVGUI_PortField* myField;
101   SUPERVGUI_PortIn*    myPort;
102   SUPERVGUI_PortInESNode*    myPortESNode;  //last correction
103   SALOME_Selection*    mySelection;
104 };
105
106 #endif