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